Help for this page

Select Code to Download


  1. or download this
    package Tie::File::AnyData;
    
    ...
      }
    
    1;
    
  2. or download this
    use Tie::File::AnyData;
    my $coderef = sub{
    ...
    };
    tie my @data, 'Tie::File::AnyData', $file, code => $coderef;
    ## Use the tied array
    
  3. or download this
    my $format1 = sub {
      ## Subroutine that reads records with format 1
    ...
    }
    tie my @dataf1, 'Tie::File::AnyData', $file_format1, code => $format1;
    + ## Creates get_next_rec and redefines _read_record
    tie my @dataf2, 'Tie::File::AnyData', $file_format2, code => $format2;
    + ## Re-defines get_next_rec!!