in reply to Re: ask about array and hash
in thread ask about array and hash

Why do *you* use:
while(<@array>) { print; }
?

Do you realize you're globbing?

Why would you unneccessarily glob?

$$>perl -MO=Deparse -le"@a=qw,1 2 3,;print while<@a>;" @a = ('1', '2', '3'); print $_ while defined($_ = CORE::GLOBAL::glob(join($", @a), 0)); -e syntax OK

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: (crazyinsomniac) ask about array and hash
by xtype (Deacon) on Jan 17, 2002 at 10:27 UTC
    Indeed. I wanted to show that there was more than one way to print and or access the data in an array or hash. Hence my using a foreach loop in the second example, also showing use of sort(). I am sorry if my globbing offended you in anyway. -xtype