Help for this page

Select Code to Download


  1. or download this
    foreach my $name (@names) {
       if ($dbpattern{$name} =~ /$pattern/i or $dbcolor{$name} =~ /$color/
    +i) {
           # print out the record
       }
    }
    
  2. or download this
    $i =0;
    while (my $name[$i] = <DBFILE>) {
    ...
       # now go on as before ...
       $i++;
    }
    
  3. or download this
    superpicture|TerraCotta|Offset Brick|5
    
  4. or download this
    chomp $line;
    my @record = split /\|/, $line, 4;
    # $record[0] is name, 1 => color 2 => pattern, etc.
    
  5. or download this
    perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); 
    +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth
    +er_name\n"'