in reply to Re^3: sub that sets $_
in thread sub that sets $_
Meanwhile in a moduleuse FTest; my $test = new FTest (); print foreach $test->foo; print for $test->foo;
That code prints "11". I you were correct that would be an endless loop.package FTest; sub new { return bless {}, shift; } sub foo { return 1; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: sub that sets $_
by anonymized user 468275 (Curate) on Jun 28, 2005 at 13:52 UTC | |
by holli (Abbot) on Jun 28, 2005 at 14:08 UTC |