mikeh123 has asked for the wisdom of the Perl Monks concerning the following question:
Howdy Monks. I don't often ask, but this one's got me:
Fails with: Global symbol "$c" requires explicit package name. Why doesn't this variable declaration work in this place?my $c = &func() ? say "$c found!" : say "None!";
Yet, of course:
Works just fine. Did some due diligence trying to search, but as you can imagine, this example of failure is hard to find! Thanks!my $c; $c = &func() ? say "$c found!" : say "None!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why so strict?
by Loops (Curate) on Nov 12, 2014 at 03:21 UTC | |
by mikeh123 (Novice) on Nov 12, 2014 at 03:38 UTC | |
|
Re: Why so strict?
by GrandFather (Saint) on Nov 12, 2014 at 03:37 UTC | |
|
Re: Why so strict?
by eyepopslikeamosquito (Archbishop) on Nov 12, 2014 at 05:31 UTC | |
|
Re: Why so strict? (diagnostics)
by Anonymous Monk on Nov 12, 2014 at 03:10 UTC | |
|
Re: Why so strict?
by Laurent_R (Canon) on Nov 12, 2014 at 07:32 UTC | |
|
Re: Why so strict?
by MidLifeXis (Monsignor) on Nov 12, 2014 at 14:20 UTC | |
|
Re: Why so strict?
by ww (Archbishop) on Nov 12, 2014 at 15:40 UTC | |
by Laurent_R (Canon) on Nov 12, 2014 at 18:28 UTC | |
|
Re: Why so strict?
by ikegami (Patriarch) on Nov 13, 2014 at 18:01 UTC | |
|
Re: Why so strict?
by LanX (Saint) on Nov 13, 2014 at 01:03 UTC |