Help for this page

Select Code to Download


  1. or download this
       open IN, '<', $infile
          or die "Cannot open infile: $!\n";
       my $foo = <IN>;
       print "The foo value is " . $foo . ".\n";
    
  2. or download this
       ((open(IN, '<', $infile))
          or (die "Cannot open infile: $!\n"));
       ((my $foo) = <IN>);
       (print(("The foo value is " . $foo) . ".\n"));