Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Why so strict?

by ww (Archbishop)
on Nov 12, 2014 at 15:40 UTC ( [id://1106986]=note: print w/replies, xml ) Need Help??


in reply to Why so strict?

You say, re your second code block, "Works just fine."

That's interesting. My milage varies:

C:\>perl -E "use 5.018; use strict; my $c; $c = &func() ? say '$c foun +d!' : say 'None!';" Undefined subroutine &main::func called at -e line 1.
... but...
C:\>perl -E "use 5.018; use strict; sub func {say 'in func()';}my $c; +$c = &func() ? say '$c found!' : say 'None!';" in func() $c found!

Aside from returning the declaration of $c to the one liner and the variant quoting, I see no diffs. Can you explain?


++$anecdote ne $data


Replies are listed 'Best First'.
Re^2: Why so strict?
by Laurent_R (Canon) on Nov 12, 2014 at 18:28 UTC
    The original post quite possibly did not contain the full code. Maybe the func subroutine is defined somewhere else.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106986]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found