Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / 5.8.0 / Attribute / Handlers / demo / demo_range.pl
CommitLineData
86530b38
AT
1package UNIVERSAL;
2use Attribute::Handlers;
3use Tie::RangeHash;
4
5sub Ranged : ATTR(HASH) {
6 my ($package, $symbol, $referent, $attr, $data) = @_;
7 tie %$referent, 'Tie::RangeHash';
8}
9
10package main;
11
12my %next : Ranged;
13
14$next{'cat,dog'} = "animal";
15$next{'fish,fowl'} = "meal";
16$next{'heaven,hell'} = "reward";
17
18while (<>) {
19 chomp;
20 print $next{$_}||"???", "\n";
21}