[thelist] Adding as element to hash (Perl)

Keith cache at dowebscentral.com
Sun Apr 28 03:33:01 CDT 2002


At 01:45 AM Sunday 4/28/02, Dovalle wrote:

>How can I add an element to existing hash?


Suppose your hash is constructed:

%animals = ("dog" => "snoopy",
"cat" => "garfield",
"pig" => "porky");

and you want to add one more, like so:

$animals{"Belushi"} = "John";


keith

cache at dowebscentral.com




More information about the thelist mailing list