in reply to Re: overloading ">>" generates warning?
in thread overloading ">>" generates warning?

what I'm trying to do is a file IO similar to IO::All' s, but only for files. It also uses this syntax, but don't generate any warnings. I didn't get how Ingy did that thing without a warning :(
  • Comment on Re^2: overloading ">>" generates warning?

Replies are listed 'Best First'.
Re^3: overloading ">>" generates warning?
by tlm (Prior) on Aug 08, 2005 at 12:07 UTC

    Use the source, Luke! Have you looked at the source code? :-)

    my $old_warn_handler = $SIG{__WARN__}; $SIG{__WARN__} = sub { if ($_[0] !~ /^Useless use of .+ \(.+\) in void context/) { goto &$old_warn_handler if $old_warn_handler; warn(@_); } };

    It looks like he basically turned off that warning globally.

    the lowliest monk

      ah... you're right :p funny thing is I did read the overload part, but didn't see the signal part :)