in reply to Here there be cammels!
You want to throw warnings, but with different line number and file reported?
I think there should be more straight forward methods, but neither warn nor Carp mention "line".
So, here a hack, till someone comes with something cleaner.
-->sub warn_from { my ($line,$file,$text) =@_; eval <<"__CODE__"; #line $line $file; warn \$text; __CODE__ } warn_from(42,'captain.pl', "I say what!");
/usr/bin/perl -w /home/lanx/warn_new.pl I say what! at captain.pl; line 42.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Here there be cammels!
by hildred (Initiate) on Feb 28, 2015 at 22:21 UTC | |
by LanX (Saint) on Feb 28, 2015 at 22:27 UTC | |
by hildred (Initiate) on Feb 28, 2015 at 22:31 UTC | |
by LanX (Saint) on Feb 28, 2015 at 22:40 UTC |