> > On 1/10/07, Peter Scott <[EMAIL PROTECTED]> wrote: > > > On Wed, 10 Jan 2007 07:37:24 -0500, Muttley Meen wrote: > > > > I have the code: > > > > > > > > $SIG{__WARN__} = sub { print $_[0]; } ; > > > > > > > > > > perldoc -f die > > > > > > (perldoc -f warn should probably be clearer on this.) > > > > > Already did that :) > > > > > > > > $SIG{__WARN__} = sub { my $msg = shift; chomp $msg; print > > "$msg\n"; } ; > > > > How is this different from what I wrote above ? > > The extra "\n"? > > [EMAIL PROTECTED]:~ 04:28 PM]$ perl -e 'use warnings; use strict; > $SIG{__WARN__} = sub { print $_[0]; } ; warn "OH NO!";' > OH NO! at -e line 1. > [EMAIL PROTECTED]:~ 04:28 PM]$ perl -e 'use warnings; use strict; > $SIG{__WARN__} = sub { print $_[0]; } ; warn "OH NO!\n";' > OH NO!
Bah, I shouldn't post this late in the afternoon, it seems, as my example doesn't address the issue at all: [EMAIL PROTECTED]:~ 04:28 PM]$ perl -e 'use warnings; use strict; $SIG{__WARN__} = sub { print $_[0],"\n"; } ; warn "OH NO!";' OH NO! at -e line 1. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/