in reply to __FILE__ and __LINE__ for Perl?
If dws's suggestion of warn w/o trailing "\n" isn't good enough, you might want to look into using caller to get more control:
- tyemy $Debugging= ...; sub Trace { return if ! $Debugging; my( $file, $line )= ( caller )[1,2]; warn @_, " at $file:$line\n"; } #... Trace("stupid debug message");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: __FILE__ and __LINE__ for Perl? (caller)
by drewhead (Beadle) on Oct 02, 2003 at 18:54 UTC | |
by Aristotle (Chancellor) on Oct 02, 2003 at 20:47 UTC |