Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: qw() and lists of lists (literals)

by ikegami (Pope)
on Mar 14, 2013 at 23:20 UTC ( #1023577=note: print w/ replies, xml ) Need Help??


in reply to Re^2: qw() and lists of lists (literals)
in thread qw() and lists of lists

List literals can be nested:

(1,(2,3,(4,5)),6,7)

List operators can be nested:

>perl -MO=Concise -e"@a=(1,(2,3,(4,5)),6,7)" j <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 i <2> aassign[t3] vKS ->j - <1> ex-list lKP ->f 3 <0> pushmark s ->4 4 <$> const[IV 1] s ->5 c <@> list lKP ->d <-- This list... 5 <0> pushmark s ->6 6 <$> const[IV 2] s ->7 7 <$> const[IV 3] s ->8 b <@> list lKP ->c <-- ...has a list for operand 8 <0> pushmark s ->9 9 <$> const[IV 4] s ->a a <$> const[IV 5] s ->b d <$> const[IV 6] s ->e e <$> const[IV 7] s ->f - <1> ex-list lK ->i f <0> pushmark s ->g h <1> rv2av[t2] lKRM*/1 ->i g <#> gv[*a] s ->h -e syntax OK

List values can't be nested:

>perl -E"say for (1,(2,3,(4,5)),6,7)" 1 2 3 4 5 6 7


Comment on Re^3: qw() and lists of lists (literals)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2014-09-22 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (189 votes), past polls