Shlomi Fish <shlo...@shlomifish.org> writes:

Accidentally left out of my previous resonse.

> In addition to what Ken said:
>
>> cat tst:
>> 
>> #!/usr/local/bin/perl
>> 
>> use strict;
>> use warnings;
>> 
>> my $cmd = 'ls /';
>> 
>> open my $ch, '-|', "$cmd" or die "Can't open $cmd: $!";
>> 
>
> 1. No need to wrap «$cmd» in double quotes here:
>
> http://perl-begin.org/tutorials/bad-elements/#vars_in_quotes
>
> 2. You should use the list form:
>
> my @cmd = qw(ls /);
>
> open my $ch, '-|', @cmd
>       or die "Can't open <<@cmd>>: $!";
>
> (Untested!).

Ok, not so hard to do I guess.  But why is this important?


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to