On Wed, Jul 15, 2009 at 19:19, Steve Bertrand wrote:
> Hi all,
>
> While writing some tests, I ran into something that took me quite a
> while to troubleshoot. Although I figured out the problem, I don't
> understand why the problem is occurring.
>
> Can someone point out the importance of the brac
Uri Guttman wrote:
"JWK" == John W Krahn writes:
>>> Can someone point out the importance of the brackets in which '2'
>>> prints, but '1' does not? I've always thought that the brackets could be
>>> omitted:
>>>
>>> print "1" if ref $href =~ /HASH/;
>>> print "2" if ref($href)
Uri Guttman wrote:
> you need to wrap the call in block eval and check for die
> afterwards. see perldoc -f eval and perlvar for $...@. note that this is
> BLOCK eval which is fine to use anywhere you want to trap dies and not
> string eval which is evil unless absolutely necessary.
>
> SB> is
Uri Guttman wrote:
>> "SB" == Steve Bertrand writes:
>
> SB> I thought afterword that it had to do with precedence. I'll stick to
> SB> using brackets when I know I need the left side evaluated before moving
> SB> forward.
>
> you don't need parens (those aren't brackets, [] are bracke
> "SB" == Steve Bertrand writes:
SB> I thought afterword that it had to do with precedence. I'll stick to
SB> using brackets when I know I need the left side evaluated before moving
SB> forward.
you don't need parens (those aren't brackets, [] are brackets, {} are
braces) for that, jus
> "JWK" == John W Krahn writes:
>>> Can someone point out the importance of the brackets in which '2'
>>> prints, but '1' does not? I've always thought that the brackets could be
>>> omitted:
>>>
>>> print "1" if ref $href =~ /HASH/;
>>> print "2" if ref($href) =~ /HASH/;
>>
John W. Krahn wrote:
> Steve Bertrand wrote:
>>> Can someone point out the importance of the brackets in which '2'
>>> prints, but '1' does not? I've always thought that the brackets could be
>>> omitted:
>>>
>>> print "1" if ref $href =~ /HASH/;
>>> print "2" if ref($href) =~ /HASH/;
>>
>> ... i
Steve Bertrand wrote:
Steve Bertrand wrote:
Hi all,
While writing some tests, I ran into something that took me quite a
while to troubleshoot. Although I figured out the problem, I don't
understand why the problem is occurring.
Can someone point out the importance of the brackets in which '2'
Steve Bertrand wrote:
> Hi all,
>
> While writing some tests, I ran into something that took me quite a
> while to troubleshoot. Although I figured out the problem, I don't
> understand why the problem is occurring.
>
> Can someone point out the importance of the brackets in which '2'
> prints, b