kos has asked for the wisdom of the Perl Monks concerning the following question:
I have a subroutine that I call several times in my program. For some reason, when I call it with no arguments at one point @_ is set to ('main'). What's going on? This occures from the initiation of the subroutine. it's driving me insane..
I haven't been able to reproduce the results with test programs, but here's the line from which the subroutine is called, with a surrogate subroutine for all it's worth...
much thanks.(( &token( "next", "marker" ))[0] eq ';') && &token; sub token{ print "args: @_\n"; return 1; } sub error{ return; }
20040105 Edit by ysth: p, br, and code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Has Perl gone completely insane on me?
by ikegami (Patriarch) on Jan 06, 2005 at 06:40 UTC | |
by ysth (Canon) on Jan 06, 2005 at 07:24 UTC | |
by Joost (Canon) on Jan 06, 2005 at 20:18 UTC |