Re: portable /dev/null ?




"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

.



Relevant Pages

  • Re: portable /dev/null ?
    ... and Windows: ... system 'myCmd> nul'; ... IIRC, the IO::All module has a devnullmethod. ...
    (comp.lang.perl.misc)
  • portable /dev/null ?
    ... I know under *nix I could do: ... and Windows: ... system 'myCmd> nul'; ...
    (comp.lang.perl.misc)
  • Re: portable /dev/null ?
    ... standard output. ... and Windows: ... system 'myCmd> nul'; ...
    (comp.lang.perl.misc)
  • Re: Cant reinstall IE6...
    ... Hi Rob - There is no direct Repair function for IE6 in XP. ... How to Reinstall or Repair Internet Explorer and Outlook Express in Windows ... Error Message When You Try to Install Internet ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Cant reinstall IE6...
    ... IE and XP have a relationship unlike any previous version of Windows. ... By the way, if you have the opportunity to upgrade to XP, I would still ... Rob P ... >> am unwilling to chance overwriting all my data by doing an inplace ...
    (microsoft.public.windows.inetexplorer.ie6.browser)