[EMAIL PROTECTED] wrote:
> Hi All
>
>Prob: I want to convert all the elememts of an array to ascalor variable that
>I can use latter on in my code
>e.g.
>
>my @array=qw/balli johney bobby/;
>now here i need 3 different variable with the above values i.e.
>my $name1=balli ;
>my $name2=johney ;
>my $name3=bobby ;
>
>Soln so far:
>
>my ($i) ;
>for ($i=0; $i<@array;$i++)
>{
>$name=$array[$i] ; # lost here is to how to have different $name each time
>also how can make these
>
my $i;
for ($i=0; $i<@arrayl $i++) {
$name$i=$array[$i];
}
That way you don't need to know in advance how many $name variables you
need.
>$names available out side the block as iam using strict. I am sure there is
>acleaver way of doing this. need help!!!!!
>}
>
>-Bobby
>
>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>