Re: portable /dev/null ?
- From: Andreas Pürzer <pue@xxxxxxx>
- Date: Fri, 29 Jun 2007 20:04:59 +0200
Larry schrieb:
On Jun 29, 11:03 am, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
Larry wrote:
I want to run an external command using "system" but discard its
standard output. I know under *nix I could do:
system 'myCmd > /dev/null';
and Windows:
system 'myCmd > nul';
but is there a more portable way to do that?
Maybe you're looking for File::Spec->devnull() ?
If you would drop your requirement of using system(), then you could use
backticks and capture (and then discard) the output in your Perl program.
jue
I thought of the backticks method, but I remember that being a problem
in Windows the last time i tried it.
perl -e "print `echo foo > nul`"
works fine here.
HTH,
Andreas Pürzer
--
Have Fun,
and if you can't have fun,
have someone else's fun.
The Beautiful South
.
- References:
- portable /dev/null ?
- From: Larry
- Re: portable /dev/null ?
- From: Jürgen Exner
- Re: portable /dev/null ?
- From: Larry
- portable /dev/null ?
- Prev by Date: Re: best Excel module
- Next by Date: Re: portable /dev/null ?
- Previous by thread: Re: portable /dev/null ?
- Next by thread: Re: portable /dev/null ?
- Index(es):