Help for this page

Select Code to Download


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