Help for this page

Select Code to Download


  1. or download this
    #! c:\perl\bin
    
    print("Enter filename to open (text only):\n\n");
    
  2. or download this
    use strict;
    use warnings;
    
  3. or download this
    $in=<STDIN>;
    chomp $in;
    ...
            {
                $in.=".txt";
            }
    
  4. or download this
    chomp(my $in=<STDIN>);
    $in .= '.txt' unless $in =~ /\.txt$/i;
    
  5. or download this
    open ($in, "$in") or die("$in could not be opened:$!\n");
    
  6. or download this
    open my $infh, '<', $in or die "$in could not be opened:$!\n";
    
  7. or download this
            s/\band\b/$word/ig;
                    
    ...
                        {
                        ++$count;
                        }