Help for this page

Select Code to Download


  1. or download this
    $line = <$filehandle>; # simple scalar variable = read op
    @files = <*.c>;        # anything else is a directory glob
    
  2. or download this
    $tmp = $this->{THAT}->[0]->{THE_OTHER};
    $line = <$tmp>;
    
  3. or download this
    open FH, $file1 or die;    # open it, okay ...
    push @filehandles, *FH;    # push the typeglob, fine ...
    open FH, $file2 or die;    # reopening it, closing the previously open
    +ed file!
    push @filehandles, *FH;    # push it again
    
  4. or download this
    sub open_file {
      my ($self, $filename) = @_;
    ...
      open FH, $filename or die "opening $filename: $!";
      $self->{FH} = *FH;
    }