in reply to Re: How to create array from file
in thread How to create array from file

Assume as

I have two variable and its value changes twice like

$var1 = 1; # next value 2 $var2 = 'Hello'; # next value 'There'

Now I wanted it in a array ref as

$VAR = [ [1,\'Hello\'], [2,\'There\'] ]
How I able to do that? Please tell me.

Replies are listed 'Best First'.
Re^3: How to create array from file
by Corion (Patriarch) on Jan 20, 2017 at 13:11 UTC
Re^3: How to create array from file
by choroba (Cardinal) on Jan 20, 2017 at 13:35 UTC
    Your expected array ref makes no sense:
    Can't find string terminator "'" anywhere before EOF at ...

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re^3: How to create array from file
by AnomalousMonk (Archbishop) on Jan 20, 2017 at 20:02 UTC

    Is this question related to the OPed question? If it is, it's vital for you to recognize that the format of the array elements in the second question
        [1,\'Hello\']
    (a reference to an anonymous array containing two elements: a number and a string) is significantly different from the format of the array elements in the OPed question
        ['1,2,\'hello\',\'aerf\'']
    (a reference to an anonymous array containing one element: a mixed alphanumeric string). Once the structure of the elements of the anonymous array is nailed down (both in our understanding and in your own), useful help can be given.

    Update: Also, you seem to be altering your posts without leaving any note in the altered post that a change has been made (something like this paragraph). Please see How do I change/delete my post? for site etiquette and protocol WRT such changes.

    Update 2 (some days later): Just realized the point choroba was making here, that  [1,\'Hello\'] doesn't even compile! I have to admit I don't really understand what you want (although you seem to have abandoned this thread, so I guess it doesn't matter).


    Give a man a fish:  <%-{-{-{-<