* A. Pagaltzis <pagaltzis at gmx.de> [2003-11-03 17:38]: > * Orton, Yves <yves.orton@de.mci.com> [2003-11-03 17:27]: > > > If the 'foo' attribute hasn't been set to anything, then you > > > want an empty list to iterate over. With version C, that's > > > what you get. > > > > No. If $self->{foo} is undef you get an error with version C. > > You're forgetting autovivification. If $self->{foo} is undef it > is coerced into a appropriate reftype. $ perl -Mstrict -wle 'my $f = { }; my @a = @{ $f->{foo} }' Can't use an undefined value as an ARRAY reference at -e line 1. (darren) -- How you look depends on where you go.Thread Previous | Thread Next