Help for this page

Select Code to Download


  1. or download this
    if ($data_choice eq 'l' || $data_choice eq 'L') {
        open my $fh, '<', 'stations.dat'
    ...
            or warn "Trouble closing file lock for stations.dat";
        @data_lines = split /\n/, $stations_data;
    }
    
  2. or download this
        # update file if necessary:
        mirror( $url, 'stations.dat' );
    ...
            or die "Trouble opening stations.dat - $!";
        # LOCK_SH not necessary when using mirror()
        @data_lines = <$fh>;