Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Windows specific shell command calls

by crabbdean (Pilgrim)
on Mar 26, 2004 at 06:50 UTC ( #339957=note: print w/replies, xml ) Need Help??

in reply to Windows specific shell command calls

This comes from the Perl Cookbook:

The system function is the simplest and most generic way to run another program in Perl. It doesn't gather the program's STDOUT like backticks or open. Instead, its return value is (essentially) that program's exit status. While the new program is running, your main program is suspended, so the new program can read from your STDIN and write to your STDOUT so users can interact with it. Like open, exec, and backticks, system uses the shell to start the program whenever it's called with one argument. This is convenient when you want to do redirection or other tricks

The Funkster of Mirth
Programming these days takes more than a lone avenger with a compiler. - sam
RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers
  • Comment on Re: Windows specific shell command calls

Replies are listed 'Best First'.
Re: Re: Windows specific shell command calls
by Caron (Friar) on Mar 26, 2004 at 11:57 UTC

    isn't this stuff copyrighted?

    Perhaps the info on perlop should be enough.

    On some platforms (notably DOS-like ones), the shell may not be capable of dealing with multiline commands, so putting newlines in the string may not get you what you want. You may be able to evaluate multiple commands in a single line by separating them with the command separator character, if your shell supports that (e.g. ; on many Unix shells; & on the Windows NT cmd shell).


    Beware that some command shells may place restrictions on the length of the command line. You must ensure your strings don't exceed this limit after any necessary interpolations. See the platform-specific release notes for more details about your particular environment.

Re: Re: Windows specific shell command calls
by Anonymous Monk on Mar 27, 2004 at 10:41 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://339957]
and a kettle whistles...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (13)
As of 2018-05-23 15:07 GMT
Find Nodes?
    Voting Booth?