Michael Lamertz:
> BTW: it's 
> 
>     $output = `ps -e`
> 
> You don't need the 'system' inside the backquotes.  Think about using
> qx{} instead of the backquote operator if you need to do more complex
> stuff in the shell.

It would be better to start using qx() now, it is far more readable.
E.g. which is which:

my $cmd = `echo Hello World`;
my $cmd = 'echo Hello World';

The difference is slight, not enough for someone to read the code easily.
Using qx helps, since people generally don't use q/qq - and thus qx
stands out better.

Also, if it's a really long command line, or some flexibility is required
(e.g. you build, or select a command line out of a set) then you are best
doing these seperately.  E.g.

my $cmd = "echo Very very long command"
my $output = qx($cmd);

Although you can get away without using brackets, I suggest you always use
them.  One of few commands that is much easier to read with them.

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to