SPUG:Best One-Liners and Scripts for UNIX
Yitzchak Scott-Thoennes
sthoenna at efn.org
Fri Apr 25 16:36:06 CDT 2003
On Wed, 16 Apr 2003 19:10:16 -0700, richard at richard-anderson.org wrote:
>#! /usr/bin/perl
>while (<>) {
> eval;
> if ($@) { print $@ }
>}
I used to do that all the time manually, as: perl -wlne'eval;print$@if$@'
Then I made a script that did:
perl -MDevel::Peek -MData::Dumper -MScalar::Util=/./ -wlne'eval;print$@if$@'
to provide some useful debugging tools by default. The // tells an
Exporter-based module to import all symbols matching a pattern.
Unfortunately, I upgraded Scalar::Util and started getting an error because
the new isvstring only works with 5.8.1 and above.
Now I have:
perl -MDevel::Peek -MData::Dumper '-MScalar::Util=/^(?!isvstring)/' -wlne'eval;print$@if$@'
More information about the spug-list
mailing list