lc() with undefined arg



I expected this to give a warning for "uninitialized value" :
perl -w -e 'my $abc; print "\L$abc";'
But it doesn't!

Why is this different from:
perl -w -e 'my $abc; print "$abc";'
which DOES give the expected warning ?

Is it documented that lc() doesn't mind an undefined argument ?
Or is something else going on?

I'm interested in this because the following would be kind of neat
if I could trust that it would work cleanly into the future,
even if Flag was missing from the hash:
if ("\L$hash->{'Flag'}" eq 'yes') {...}

If I don't understand why it works, I'll continue to use the rather
messier:
if (lc ($hash->{'Flag'} || '') eq 'yes') {...}

(BTW, about omitting the quotes, as in $hash->{Flag} :
is this considered sound practice, or is it just lazy ?)

Cheers,

-Len

.



Relevant Pages

  • Re: So what is the point of darwinports then?
    ... Mind you, my use of LaTeX has just taken a downturn. ... I had to edit *all* the bloody quotes and apostrophes, ... No such concept in TeX. ... that I've yet to find a tool to let me do that sort of search+replace ...
    (uk.comp.sys.mac)
  • Re: Google Cindy Sheehan
    ... She changed her mind later. ... > Must be those folks who pulled her quotes out of context didn't expect the ... The president cannot address her simple questions. ...
    (misc.writing)
  • Re: Google Cindy Sheehan
    ... >Ray Haddad wrote: ... She changed her mind later. ... >Must be those folks who pulled her quotes out of context didn't expect ...
    (misc.writing)
  • Re: Throwing the ball at the batsman
    ... > Mind you, where we've only really heard from Hoggard and Pietersen, ... > who will always have a motor mouth, I've read quotes from Langer, ...
    (rec.sport.cricket)
  • Re: Is a fact something that has been proven?
    ... repeat myself, and you're going to continue acting like you didn't hear ... Because it can't, that's why, and I have all these quotes to prove it! ... Did mind come before matter in the universe or matter come before mind? ...
    (talk.origins)