Help for this page

Select Code to Download


  1. or download this
    open(MYFILE, "<words") or die "Opening words: $!";
    print MYFILE @words;
    close(MYFILE);
    
  2. or download this
    my $filename = 'words';
    open(my $myfile, '+>', $filename)
    ...
    rand($.) < 1 and $line = $_ while <$myfile>;
    close $myfile
        or die "Cannot close file '$filename': $!";