home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 June
/
PCWorld_2005-06_cd.bin
/
software
/
vyzkuste
/
firewally
/
firewally.exe
/
framework-2.3.exe
/
demo_range.pl
< prev
next >
Wrap
Perl Script
|
2003-11-07
|
365b
|
22 lines
package UNIVERSAL;
use Attribute::Handlers;
use Tie::RangeHash;
sub Ranged : ATTR(HASH) {
my ($package, $symbol, $referent, $attr, $data) = @_;
tie %$referent, 'Tie::RangeHash';
}
package main;
my %next : Ranged;
$next{'cat,dog'} = "animal";
$next{'fish,fowl'} = "meal";
$next{'heaven,hell'} = "reward";
while (<>) {
chomp;
print $next{$_}||"???", "\n";
}