[sf-perl] Odd behavior for dot operator?

Andrew Sigmund ASIGMUND at altera.com
Fri Mar 18 11:30:25 PDT 2011


Quinn,

I believe that it was not equivalent in my context:

-          I wanted to include _something_ (the value of $y itself or the text  "undef") in my print statement.

-          I wanted to eliminate the "Use of uninitialized value" warning under perl -w.

I'm still a relative perl newbie, so any correction is welcome.

Thanks,
        Andy



From: sanfrancisco-pm-bounces+asigmund=altera.com at pm.org [mailto:sanfrancisco-pm-bounces+asigmund=altera.com at pm.org] On Behalf Of Bill Moseley
Sent: Friday, March 18, 2011 11:18
To: San Francisco Perl Mongers User Group
Subject: Re: [sf-perl] Odd behavior for dot operator?


On Fri, Mar 18, 2011 at 10:50 AM, Quinn Weaver <quinn at fairpath.com<mailto:quinn at fairpath.com>> wrote:
Note also that this code snippet is equivalent to $y:

   (defined $y)? $y :'undef'

If $y is not defined, then it's undef, by (if you'll pardon me) definition.

Isn't is 'undef'?  not undef?




--
Bill Moseley
moseley at hank.org<mailto:moseley at hank.org>

________________________________
Confidentiality Notice.
This message may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution, or copying of this message, or any attachments, is strictly prohibited. If you have received this message in error, please advise the sender by reply e-mail, and delete the message and any attachments. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20110318/e1bf8455/attachment.html>


More information about the SanFrancisco-pm mailing list