--- James Ferree <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am looking for a way to load a file containing the
> following example data into a hash
>
> #From TO
> Jim James
> Art Arthur
> John Arthur
>
> Then when $a=Jim I would like to convert it to
> $a=James.
>
> Can this be done?
>
> Jim
>
Thanks to your help so far, I have the following:
sub load_keys_file
{
open(KEY,$keys_file) || die "could not open $file:
$!\n";
while (<IN>)
{
next unless (/\S/ && /^#/); # make sure
there's something to input and line does not start
with #
($old_phase,$new_phase,$ii_new_phase)=split /\t/;
# split the line by tab
$phase_hash{$old_phase}=$new_phase;
$ii_hash{$old_phase}=$ii_new_phase;
}
close KEY;
Now, how do I check to see if a hash value is defined?
I thought this would work but I get a syntax error
if ( $phase_hash($Phase))
{
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]