Re: While query

From: Abigail (abigail_at_abigail.nl)
Date: 10/01/04


Date: 01 Oct 2004 21:39:40 GMT

Keith Keller (kkeller-usenet@wombat.san-francisco.ca.us) wrote on
MMMMXLIX September MCMXCIII in <URL:news:99m032x5ic.ln2@goaway.wombat.san-francisco.ca.us>:
|| -----BEGIN PGP SIGNED MESSAGE-----
|| Hash: SHA1
||
|| On 2004-10-01, Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
|| >
|| > use strict;
|| > use warnings;
|| >
|| > my @array=('','2');
|| >
|| > foreach (reverse @array)
|| > {
|| > print "''popped'' [$_]\n";
|| > }
||
|| Oops--this won't actually empty the array as the various pop-based
|| methods will. Depending on what the goal is, that may or may not be an
|| issue. (It does continue to loop if an element is undef, which also may
|| or may not be a concern.)

    printf "Popped: %s\n" => pop @array while @array;

Abigail

-- 
A perl rose:  perl -e '@}>-`-,-`-%-'


Relevant Pages