in reply to Convert a number to another number?
use strict; use warnings; my %lookup = ( 1 => 567898, 2 => 543267, ); my @test = qw(0 a 2 1); for (@test) { print exists $lookup{$_} ? $lookup{$_} : $_, "\n"; } __END__ 0 a 543267 567898
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert a number to another number?
by Narveson (Chaplain) on Sep 16, 2008 at 18:40 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |