tadman has asked for the wisdom of the Perl Monks concerning the following question:
It would seem that any code inside of PutFoo() would have access to variables such as "$foo", but that does not seem to be the case. Perl skips over the definition of $foo, and runs PutFoo the first time without benefit of the initialization.#!/usr/bin/perl -w use strict; PutFoo(); my ($foo) = "Goo"; PutFoo(); sub PutFoo { print "Boo hoo, foo is $foo\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Perl Turning a Blind Eye
by tye (Sage) on Jan 30, 2001 at 02:50 UTC | |
by tilly (Archbishop) on Jan 30, 2001 at 02:53 UTC | |
by tye (Sage) on Jan 30, 2001 at 03:18 UTC | |
by tilly (Archbishop) on Jan 30, 2001 at 04:18 UTC | |
|
Re: Perl Turning a Blind Eye
by ichimunki (Priest) on Jan 30, 2001 at 03:06 UTC | |
by tadman (Prior) on Jan 30, 2001 at 03:27 UTC | |
by tilly (Archbishop) on Jan 30, 2001 at 04:38 UTC | |
by ichimunki (Priest) on Jan 30, 2001 at 03:35 UTC | |
by tye (Sage) on Jan 30, 2001 at 03:42 UTC |