perl kweschun

der.hans plug-discuss@lists.plug.phoenix.az.us
Tue, 21 May 2002 12:45:05 -0700 (MST)


Am 21. May, 2002 schwätzte Roderick Ford so:

> Does anybody know if, in perl, I 'push' an empty list or array to an
> array, does the array still grow by one?  Or should I handle the
> indexing manually in those cases where it is empty.  Sometimes my array
> that I am pushing is empty, but I still want the array to grow by one.

$ perl -e '@a = "a"; print "$#a\n"; push( @a, @a ); print "$#a\n"; push( @a,
"" ); print "$#a\n";'
0
1
2
$

I'd say it does.

ciao,

der.hans
-- 
#  https://www.LuftHans.com/
#  The only way for a woman to change a man
#  is if he's wearing Depends[TM] - der.hans