Help for this page

Select Code to Download


  1. or download this
    my @positions = (0);
    open FILE, '<', 'file' or die $!;
    while(<FILE>) {
        push @positions, tell FILE;
    }
    
  2. or download this
    my $randData = do{ seek FILE, $positions[rand @positions], 0; <FILE>; 
    +}