Re: [PBML] using BackTicks in perl
>>>>> "Raja" == Raja Rajasekaram <raja_rajasekaram@...> writes:Raja> Hi All,
Raja> Anyone used backticks in Perl? Here is what I am trying to do
Raja> $x = `mkdir /mnt`;
Why are you using external mkdir when Perl has a mkdir already?
Faster, cheaper, more portable. Hard to beat.
Raja> print "$x";
Raja> Is there anyway to catch the output? Or does backticks return anything?
That's catching stdout. Maybe the external command is generating stderr.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
- On Dec 12, 2006, at 11:15 AM, Raja Rajasekaram wrote:
> Hi All,What else have you tried?
> Anyone used backticks in Perl? Here is what I am trying to do
> $x = `mkdir /mnt`;
> print "$x";
> Is there anyway to catch the output? Or does backticks return
What does this give you:
$x = `pwd`;
What did you expect to find in $x after $x=`mkdir /mnt`; ?
Rob Biedenharn http://agileconsultingllc.com