Help for this page

Select Code to Download


  1. or download this
    my $data = do { local $/; <DATA> };
    @array = split 'on something', $data;
    
  2. or download this
    while ( my $line = <DATA> ) {
        # handle the line here instead of as an element of an array
    }
    
  3. or download this
    use Path::Tiny 'path';
    my $file_path = '/foo/bar/baz.txt';
    ...
        chomp $line;
        ...
    }