http://www.perlmonks.org?node_id=503672


in reply to Re: Assigning value to the array elements
in thread Assigning value to the array elements

Thanks that works perfectly for my use. Also thanks for Fletch, wfsp and no_slogan.

The reason i am using this is, i dont know exactly how many values will be in @aarr. But i want to assign those values to some scalar variables which i will use in my program later for another use. If there is any alternative please suggest

Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)

  • Comment on Re^2: Assigning value to the array elements

Replies are listed 'Best First'.
Re^3: Assigning value to the array elements
by no_slogan (Deacon) on Oct 28, 2005 at 15:08 UTC
    But i want to assign those values to some scalar variables which i will use in my program later for another use. If there is any alternative please suggest
    Change the rest of the program so it doesn't expect the values to appear in scalar variables. Really. Your code will be much easier to understand if it says this:
    my $first = $config_values{first}; open my $file, $first;
    rather than just blithely saying the second line and leaving the poor reader to figure out how $first got its value.