Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
  2. or download this
    no strict;  # Yuk!  
    no warnings;  # Yuk!
    # s/no/use/gsm;
    
  3. or download this
    my $step1;
    my $step2;
    ...
    my @array1;
    my @array;
    my $i = 0;
    
  4. or download this
    open(FILE, "assign");
    
  5. or download this
    open my $fh, '<', 'assign' or
      die "hard, but say why (\$!): $!\n";
    
  6. or download this
    $line = <FILE>;
    while ($line ne ""){
    
  7. or download this
    while (<$fh>) { ... # or
    while (my $line=<$fh>) { ...
    
  8. or download this
            chomp($line);
            if($line =~ /^(\S+)\s+(\d+)$/) {
                    print "inside\n";
                    $hash{$1} = $2;
    
  9. or download this
                    $i++;
    
  10. or download this
    while( ($key, $value) = each %hash) {
            print "$key +> $value\n";
            $key = $value;
    }
    
  11. or download this
    #!/usr/bin/perl -ln
    
    ...
    }
    
    __END__