Re: portable /dev/null ?
- From: "Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 11:19:38 +1000
"Larry" <larry.grant.dc@xxxxxxxxx> wrote in message news:1183129074.575021.46410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?
You could use File::Spec. Then the code becomes (untested):
my $devnull = File::Spec->devnull();
system("myCmd > $devnull"); # should be portable
Cheers,
Rob
.
- References:
- portable /dev/null ?
- From: Larry
- portable /dev/null ?
- Prev by Date: FAQ 3.13 How can I use curses with Perl?
- Next by Date: Re: Problem with PERL function
- Previous by thread: Re: portable /dev/null ?
- Next by thread: hex to ebcdic
- Index(es):
Relevant Pages
|
|