Bro. Doug has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl use strict ; use warnings ; local $\ = "\n" ; # some formatting my %h ; print ( defined %h ? "Defined!" : "Undefined!" ); undef( %h ) ; print ( defined %h ? "Defined!" : "Undefined!" ); %h = undef ; print ( defined %h ? "Defined!" : "Undefined!" ); undef( %h ) ; print ( defined %h ? "Defined!" : "Undefined!" ); #OUTPUT #Undefined! #Undefined! #Defined! #Undefined!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: hash assignment wierdness
by DigitalKitty (Parson) on Apr 20, 2007 at 16:00 UTC | |
by shmem (Chancellor) on Apr 21, 2007 at 12:33 UTC | |
Re: hash assignment wierdness
by logie17 (Friar) on Apr 20, 2007 at 15:56 UTC | |
Re: hash assignment wierdness
by Errto (Vicar) on Apr 20, 2007 at 17:59 UTC | |
Re: hash assignment wierdness
by Ploux (Acolyte) on Apr 20, 2007 at 16:00 UTC | |
Re: hash assignment wierdness
by Obidan (Initiate) on Apr 20, 2007 at 18:06 UTC |