in reply to code that runs at module loading
print "my %opcode_map = (\n"; print "LD$_ => [".join(',',$_*3,$_*5,$_*7)."],\n" foreach (1,2,3); print ")\n";
Also, note that you should use parentheses not squiggly brackets to set up your hash, or else you may not get what you expect; use warnings will warn you about that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: code that runs at module loading
by rrwo (Friar) on Dec 07, 2004 at 20:34 UTC | |
by sgifford (Prior) on Dec 07, 2004 at 21:06 UTC |