[Melbourne-pm] just my opinion

Toby Corkindale tjc at wintrmute.net
Thu Sep 18 04:59:33 PDT 2008

On Thu, Sep 18, 2008 at 12:22:51PM +1000, Jacinta Richardson wrote:
> I agree that this is initially confusing.  We explain it by saying that $
> means singular ie "this", "the" or "that", while @ and % are multiple, ie
> "these", "those".
> my $fish;     # this fish.
> my @fruits;   # those fruits
> my %facts;    # those facts
> $fruits[0];   # _that_ fruit in position 0
> $fact{Jane};  # Jane's fact, or _the_ fact about Jane
> > some operators silently quote things and turn undef into 'undef'
> Do you have an example?  I have never seen undef turned into 'undef'.  That
> sounds like a bug.  undef does get turned into '' or 0 (as appropriate to the
> operator) when used in some scalar contexts, but they are not true values
> whereas 'undef' would be.  So

What would you expect the output of the following script to be?

my %foo = (
    undef => 'null',
    foo   => 'bar',
    qux   => 'qaaz'
print join(' ', @foo{qw(undef foo qux)}) . "\n";


Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --recv-key B1CCF88E)

More information about the Melbourne-pm mailing list