- or download this
use strict;
use warnings;
- or download this
print "\n Enter the file name :>";
chomp( my $filename1 = <STDIN> );
- or download this
my @lines = ();
- or download this
open my $fh, '<', $filename1 or die "Cannot find the file $filename1:
+$!";
- or download this
while (<$fh>)
{
push @lines, $_;
}
- or download this
close $fh;
- or download this
open my $w, '>', 'Result.txt' or die "Cannot open the file Result.txt:
+ $!";
- or download this
foreach my $line (@lines)
{
...
}
}
close $w;