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");
In reply to Re: __FILE__ and __LINE__ for Perl? (caller)
by tye
in thread __FILE__ and __LINE__ for Perl?
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |