in reply to Re: Module constant and constants in Hashes
in thread Module constant and constants in Hashes

What is a "translation hash"?

Lya

  • Comment on Re^2: Module constant and constants in Hashes

Replies are listed 'Best First'.
Re^3: Module constant and constants in Hashes
by zentara (Cardinal) on Jan 14, 2009 at 15:16 UTC
    #!/usr/bin/perl use warnings; use strict; #But I want to have something like: #0 = Zero #1 = One #2 = Three my %hash = ( 'NULL' => "Zero", 'EINS' => "One", 'ZWEI' => "Two", ); my %trans_hash =( 'NULL' => 0, 'EINS' => 1, 'ZWEI' => 2, ); foreach (sort keys %hash ) { print "$trans_hash{$_} = $hash{$_}\n"; }

    I'm not really a human, but I play one on earth Remember How Lucky You Are