- or download this
my %h = (
sub { return sprintf ("0x%x", shift) },
sub { return sprintf ("%b", shift) },
sub { return sprintf ("%d", shift) },
);
- or download this
$result = process_args(1, 2, 3, 4);
print "Result is $result \n";
...
print "Arg array is now: @_ \n";
return $c + $d;
}
- or download this
my %h = (
hex => sub { return sprintf ("0x%x", shift) },
bin => sub { return sprintf ("%b", shift) },
dec => sub { return sprintf ("%d", shift) },
);
- or download this
my $hex_val = $h{hex}->(5);
- or download this
print "Arg array is now: @_ \n";