Hi All,

Following is the code which I am executing.

 my $fname3 = "/tmp/vob_repl_list_test1";
  open(FILE2, $fname3);
my @vob_repl_list = <FILE2>;
close(FILE2);
foreach my $a(@vob_repl_list)
 {
`$MT chreplica -host puvob02 $a`;
}

I am not getting the proper value of $a in the command `$MT chreplica
-host puvob02 $a`;

I know that array @vob_repl_list is not empty. 

plz help

regards
irfan.




-----Original Message-----
From: Stephen Kratzer [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 21, 2006 6:46 PM
To: beginners@perl.org
Subject: Re: foreach loop

On Friday 21 July 2006 08:59, Sayed, Irfan (Irfan) wrote:
> Hi,
>
> I am executing following code.
>
> foreach (@vob_repl_list)
>
> {
>
> print $_;
>
> `$MT chreplica -host puvob02 $_`;
>
> }
>
> but I am not getting the value of $_ in the command `$MT chreplica 
> -host
> puvob02 $_`; if I print the value of $_ then it's printing fine.
>
> but in command it's not taking that value. so my execution of command 
> is failing.
>
> can u plz help.
>
> regards
>
> irfan.

$_ is being interpolated, but if you don't do anything with the returned
output (like print it), you won't see any results. If that isn't the
case, it's possible that @vob_repl_list is empty.

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>
<http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to