- or download this
#! /usr/local/bin/perl -w
# myHash.pl
...
use warnings;
use Data::Dumper;
- or download this
# Hash Assignment
# In this case, a
...
print "\n";
- or download this
# hash element access
my $State = 'SD'; # planetscape's home state
...
print "planetscape lives in " . $Name . "\.\n\n";
- or download this
# exists ( $hash{$key} )
$State = 'QC'; # Quebec, Canada
...
}
- or download this
# keys( %hash )
my $count = keys %StateName;
...
print "\n";
- or download this
# delete ( $hash{key} )
delete($StateName{DC}); # DC is not actually a state,
# it's a postal abbreviation
- or download this
# values( %hash )
$count = values %StateName; # $count is one less since we deleted DC
...
print "\n";
- or download this
# each( %hash )
while (my($key,$value)=each(%StateName)) { # there's lots more to
+know
...
print "\n";
- or download this
# make an inverse hash
my %StateAbbreviation = reverse %StateName;
...
print "\n";
- or download this
# let's expand our real-world example from a hash of States
# to a hash of postal abbreviations (not exhaustive)
...
print "PostalCode for '$PostalCode{$pc}' is '$pc'\n";
}
- or download this
use strict;
use warnings;
...
$fake->draw($FILEHANDLE);
close $FILEHANDLE;
- or download this
.PS
boxwid:=1.5; boxht:=0.75
...
boxwid:=1.5; boxht:=0.75
B15: box with .n at B14.s
.PE
- or download this
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
...
<rect x="0" y="-11.625" width="1.5" height="0.75" style="stroke-width:
+0.010267;"/>
</g>
</svg>