samedi 25 octobre 2014

Perl: how to write the ouput of a script in a new text file


Vote count:

0




First of all, I'm a noob on perl, and I've tried to find the answer to that question on the internet but couldn't get (or understand) it... So, I have a script that scan throught a text file and writes all line except those starting with an A.



#!/usr/bin/perl
use strict;
use warnings;
open (my $file, "<", "/file.txt") or die "cannot open < file.txt $!";
while (<$file>) {
unless (/^A/) {
print ; }
}


That works. But I get the results of this script in the terminal. Now, I just want these results to be saved in a new text file. Can somebody help me ?


Thanks a lot !



asked 3 mins ago







Perl: how to write the ouput of a script in a new text file

Aucun commentaire:

Enregistrer un commentaire