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

The reason it doesn't work is that you use $media{bond} before you've finished defining %media. Run under strict, therefore, it fails with
Global symbol "%media" requires explicit package name
You get that error for both the lines where you use $media{bond} within the definition of %media. But this works fine:
my %media = ( bond => "USLetter:Plain:white:75", ); $media{letter} = $media{bond}; $media{plain} = $media{bond};


Hey! Another reason to use strict!

§ George Sherston

Replies are listed 'Best First'.
Re: using hash key as hash value ...
by blueflashlight (Pilgrim) on Oct 02, 2001 at 07:05 UTC
    thanks ... actually, I did (and always) 'use strict;' but I just pasted a snippet of the code above, not the whole thing. Your explanation is great. Thanks.

    --Sandy
      Sorry to doubt you, Sibling... I have the zeal of the converted sinner :)

      § George Sherston