Help for this page

Select Code to Download


  1. or download this
    my $stuff = 'file.txt';
    open(F, "$stuff") || die "Can not open file: $!\n";
    ...
    print "@records\n";
    s/lastlineofdata//;  #This is the part I am struggling with
    close(F);
    
  2. or download this
    use strict;
    use warnings;
    ...
    print $out_fh, @records;
    
    $out_fh->close;
    
  3. or download this
    perl -pi -e 'last if eof()' file.txt