tmaly has asked for the wisdom of the Perl Monks concerning the following question:

Monks, is there a way to set Smart::Comments to direct output to a file/handle instead of STDERR without redirecting STDERR?

Replies are listed 'Best First'.
Re: Smart Comments Question
by Anonymous Monk on Jun 22, 2009 at 22:58 UTC
    Try
    sub Smart::Comments::warn { print FOOOO @_; if($_[-1] !~ /\n$/){ printf "at %s line %l ", (caller)[1,2]; } }

      Of course, the printf also needs the filehandle argument, or you'll end up writing one part to the file handle and the other one to STDOUT (or whatever you select()ed lastly).

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)