I assume that $1 and $2 in this case are meant for awk, not for perl.
Because they start with $, perl tries to interpolate them. You should use
\$1 and \$2 instead so that perl will not interpolate them to undef.
----- Original Message -----
From: "Bhanu Prakash" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 2:05 AM
Subject: [Q] How can I pass Perl variables into shell?
> Hi,
> Can I not do something like...
>
> #!/usr/local/bin/perl
> use strict;
> my $myname='hi There';
> system "ls","-la";
> system "echo","$myname";
> qx{awk '{ if ($myname==$1) { do something } else print
> $2,$1 }'};
>
> My script is complaining about uninitialized
> variables..
> I suspect it is talking about $1 and $2s .Can I not
> place them here?
> Can I pass $myname to awk?
> Thanks
> Bhanu
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]