Help for this page

Select Code to Download


  1. or download this
    $filename = @ARGV[0];
    
  2. or download this
    open (FILE,"$filename") || die "Can't Open $filename: $!\n";
    
  3. or download this
    use strict;
    my $filename = shift;
    open(my $fh, '<', $filename) or die "Can't open $filename: $!";
    my $text = do { local $/; <$fh> };  # slurping into a string
    # do something with $text here