projects
/
OpenSPARC-T2-DV
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
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
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
"
;
}