Hi,
flotsan <[EMAIL PROTECTED]> asked:
> I am reading the Perl Camel book - Programming Perl 3rd Ed
> and having a bit of trouble to understand some of the ideas
> presented in section 2.11.2.
> Specifically it is told the following two statements are different:
>
> 1) if ($_ = ) { print; }
flotsan wrote:
> Hey guys,
Hello,
> I am reading the Perl Camel book - Programming Perl 3rd Ed and having a bit
> of trouble to understand some of the ideas presented in section 2.11.2.
> Specifically it is told the following two statements are different:
>
> 1) if ($_ = ) { print; }
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
John W. Krahn wrote:
> Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two of those
> are valid input from the readline operator.
>
>
>
> John
Should running the above from the command line make a difference? I ran
them both enter
"flotsan" schreef:
> it is told the following two statements are
> different:
>
> 1) if ($_ = ) { print; } # suboptimal: doesn't test defined
> 2) if (defined($_ = )) { print; } # best
>
> But as I see it, these two do the same thing
perl -le '
print defined($_) ? "\"$_\"" : ""
,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dr.Ruud wrote:
> "flotsan" schreef:
>
>> it is told the following two statements are
>> different:
>>
>> 1) if ($_ = ) { print; } # suboptimal: doesn't test defined
>> 2) if (defined($_ = )) { print; } # best
>>
>> But as I see it, these two do the
Mathew Snyder wrote:
> John W. Krahn wrote:
>>>Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two of those
>>>are valid input from the readline operator.
>
> Should running the above from the command line make a difference? I ran
> them both entering 0 each time and I got 0 back
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
John W. Krahn wrote:
> Mathew Snyder wrote:
>> John W. Krahn wrote:
Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two of
those
are valid input from the readline operator.
>> Should running the above from the command l
Thanks... Now I see the one with "defined" test deals better with those
possible "false" "false" inputs:-)
flotsan
""John W. Krahn"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mathew Snyder wrote:
>> John W. Krahn wrote:
Yes, Perl has five "false" values: undef, (), 0, ''
Mathew Snyder schreef:
> John W. Krahn:
>> Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two
>> of those are valid input from the readline operator.
>
> Should running the above from the command line make a difference? I
> ran them both entering 0 each time and I got 0 back. T
Mathew Snyder schreef:
> Dr.Ruud:
>> flotsan:
>>> it is told the following two statements are
>>> different:
>>>
>>> 1) if ($_ = ) { print; } # suboptimal: doesn't test defined
>>> 2) if (defined($_ = )) { print; } # best
>>>
>>> But as I see it, these two do the same thing
>>
>> perl -le '
>
Dr.Ruud wrote:
> Mathew Snyder schreef:
>>John W. Krahn:
>
>>>Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two
>>>of those are valid input from the readline operator.
>>Should running the above from the command line make a difference? I
>>ran them both entering 0 each time and
"John W. Krahn" schreef:
> Dr.Ruud:
>> Mathew Snyder:
>>> John W. Krahn:
Yes, Perl has five "false" values: undef, (), 0, '' and '0', and
two of those are valid input from the readline operator.
>>>
>>> Should running the above from the command line make a difference? I
>>> ran them bot
Upon reflection -- and I'm surprised Randal hasn't picked this up -- the
"problem" might be more deep-seated than we imagine. With respect to the
good Perl-Meisters who've answered so far, I should like to add this:
Shouldn't it be "Flotsam", and not "flotsan"?
(Hey! After all, somebody'
13 matches
Mail list logo