in reply to using hash key as hash value ...

The hash %media hasn't been scoped yet, the interpreter executes the 'line' at the semicolon. Therefore %media doesn't exist until perl sees the semicolon. In your case, I would suggest breaking out the assignments into different instructions. Such as the following:

my %media = ( bond => "USLetter:Plain:white:75" ); $media{'letter'} = $media{'bond'}; $media{'plain'} = $media{'bond'};

Though there's probably better ways to do it through looping etc, it all depends on what you need done.

Replies are listed 'Best First'.
Re: Re: using hash key as hash value ...
by blueflashlight (Pilgrim) on Oct 02, 2001 at 07:11 UTC
    I'll probably do it the way you suggest. It seems like it's "easiest" on the eyes.

    thanks, --sandy