anniyan has asked for the wisdom of the Perl Monks concerning the following question:
I have a question in assigning value to the array elements which inturn a scalar variable.
my $first = ''; my $second = ''; my $third = ''; my $fourth = ''; my $ +fifth = ''; my $sixth = ''; my @vars = ('$first', '$second', '$third', '$fourth', '$fifth', '$sixt +h'); my @aarr = ('<chap', '<book', '<isb'); for (@aarr) { $vars[$i] = $_; $i++; } print "$first\t$second\t$third\n";
Whether it is possible or not?
updated
Expected output: <chap <book <isb
Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Assigning value to the array elements
by no_slogan (Deacon) on Oct 28, 2005 at 14:50 UTC | |
Re: Assigning value to the array elements
by Fletch (Bishop) on Oct 28, 2005 at 14:15 UTC | |
Re: Assigning value to the array elements
by ioannis (Abbot) on Oct 28, 2005 at 14:31 UTC | |
by anniyan (Monk) on Oct 28, 2005 at 14:55 UTC | |
by no_slogan (Deacon) on Oct 28, 2005 at 15:08 UTC | |
Re: Assigning value to the array elements
by wfsp (Abbot) on Oct 28, 2005 at 14:13 UTC | |
Re: Assigning value to the array elements
by wfsp (Abbot) on Oct 28, 2005 at 13:49 UTC |
Back to
Seekers of Perl Wisdom