in reply to Saving Standard Output (overloading print())

The easy commandline solution in unix is
command > file
or to see it and write to a file...
command | tee file
that the really simple way... (in unix, I think the > works in windows too, not sure)

of course, this is a shell solution, not a perl one...

Update OOPS! thanks trantor for pointing out I had > instead of | for tee command

                - Ant
                - Some of my best work - Fish Dinner

  • Comment on Re: Saving Standard Output (overloading print())

Replies are listed 'Best First'.
Re: Re: Saving Standard Output (overloading print())
by mugwumpjism (Hermit) on Aug 10, 2001 at 00:46 UTC

    Er, dude ... typo... Your second example is equivalent to "command file > tee" and will produce a file called "tee".

    Redirection and piping works in windows (kind of - it uses temporary files rather than real pipes), although I've no experience is using that from perl. Plus, you won't have "tee" unless you have the cygwin kit installed.

    Corrected, his answer is "command | tee file", which will write output to file and also standard output.

      Actually you also get "tee" with the djgpp-set of gnu programs. SO you won't actually need cygwin as they are ported to windows.