Hi all
Try this out whether this help
@CityA=("Suburb1"," Suburb2"," Suburb3");
@CityB="Suburb1, Suburb4, Suburb5";
$Var="CityB";
$NewVar="$$Var[0]";
print "VALUE is $NewVar \n";
----- Original Message -----
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: "Luinrandir Hernsen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 15, 2004 6:40 AM
Subject: Re: Array Question
> Luinrandir Hernsen wrote:
>
> > Can I do something like this?
> >
>
> perldoc -q quoting
>
> >
> > @CityA="Suburb1, Suburb2, Suburb3";
> > @CityB="Suburb1, Suburb4, Suburb5";
> >
>
> I don't think the above is doing what you think it is. It is assigning
> one element (the first) of the array to a string. If you are trying to
> assign the array 3 elements, you need to quote it differently,
>
> my @CityA = ('Suburb1','Suburb2','Suburb3');
> my @CityB = ('Suburb1','Suburb4','Suburb5');
>
> > $Var="TownCurrent";
> >
>
> $Var isn't used again in your example, what is its intended use?
>
> > $NewVar="$($TownCurrent)[1]";
>
> The above is non-sensical...
>
> >
> > I am trying to construct a sting from a variable.
> >
>
> Construct a string from a variable, or choose a variable using a string?
>
> > make sence?
> >
>
> Not really. Try to explain better what you are doing... Since this has
> nothing to do with CGI your question is better asked on
> [EMAIL PROTECTED] ....
>
> http://danconia.org
>
> --
> 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>