On 18/09/2014 00:34, SSC_perl wrote:
On Sep 17, 2014, at 3:32 PM, Rob Dixon wrote:
As you have presented them, those code fragments are identical in meaning.
That was my understanding as well, but the inline 'if' gave an error
while the block didn't. Running the code by itself in TextWrangler
On Sep 17, 2014, at 3:32 PM, Rob Dixon wrote:
> As you have presented them, those code fragments are identical in meaning.
That was my understanding as well, but the inline 'if' gave an error
while the block didn't. Running the code by itself in TextWrangler does not
produce the warning
On 17/09/2014 01:37, SSC_perl wrote:
I just ran across something puzzling. Why are these two statements
not equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item->{'unitprice'} += $item->{'optionprice'}
On 09/17/2014 12:46 PM, SSC_perl wrote:
> On Sep 16, 2014, at 6:58 PM,
> wrote:
>> Are you sure you've quoted the code (that's producing the warning) correctly?
>
> Yes, I did. I double-checked it just to be certain. However, I ran
> the code by itself and it doesn't produce that warni
On Sep 16, 2014, at 6:58 PM,
wrote:
> Are you sure you've quoted the code (that's producing the warning) correctly?
Yes, I did. I double-checked it just to be certain. However, I ran
the code by itself and it doesn't produce that warning, so it must be something
upstream that's caus
-Original Message-
From: SSC_perl
Sent: Wednesday, September 17, 2014 10:37 AM
To: Perl Beginners
Subject: Argument isn't numeric warning in if statement
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if (
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item->{'unitprice'} += $item->{'optionprice'} if ($item->{'optionprice'});