Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Type Globs

by autark (Friar)
on Jan 04, 2001 at 05:56 UTC ( #49670=note: print w/replies, xml ) Need Help??


in reply to Type Globs

You could try to define your own print function, sub print { ... } and there print to both STDOUT and files.

However, if you are on a unix system you might find the tee utility program usefull

~ 1>whatis tee tee (1) - read from standard input and write to standard output and +files
Autark.

Replies are listed 'Best First'.
Re: Type Globs
by Dominus (Parson) on Jan 04, 2001 at 07:38 UTC
    Says autark:
    You could try to define your own print function, sub print { ... }

    You can't override print.

      I don't see why it has to be called print (this was mentioned as a specific error reporting problem, I believe)...

      sub writeError { print STDERR @_; print FILE @_; # yes I know that should be Mail::Mailer, but I don't know its synta +x open MAIL, '|/usr/sbin/sendmail admin' or die; print MAIL @_; close MAIL; }
      Assuming FILE is already open and is avalible from there.

      This solution also has the advantage of allowing simple and understandable maintainability.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://49670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2020-11-27 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?