Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Speed of Split

by ysth (Canon)
on Nov 18, 2004 at 10:09 UTC ( [id://408733]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Speed of Split
in thread Speed of Split

Yes, it does.
$ perl -MO=Concise,-exec -e'@NAMESPACE::data = split / /, $x' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v 3 </> pushre(/" "/ => @data) s/64 4 <#> gvsv[*x] s 5 <$> const[IV 0] s 6 <@> split[t4] vK 7 <@> leave[1 ref] vKP/REFC -e syntax OK $ perl -MO=Concise,-exec -e'@data = split / /, $x' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v 3 </> pushre(/" "/ => @data) s/64 4 <#> gvsv[*x] s 5 <$> const[IV 0] s 6 <@> split[t4] vK 7 <@> leave[1 ref] vKP/REFC -e syntax OK $ perl -MO=Concise,-exec -e'my @data; @data = split / /, $x' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v 3 <0> padav[@data:1,2] vM/LVINTRO 4 <;> nextstate(main 2 -e:1) v 5 <0> pushmark s 6 </> pushre(/" "/) s/64 7 <#> gvsv[*x] s 8 <$> const[IV 0] s 9 <@> split[t3] lK a <0> pushmark s b <0> padav[@data:1,2] lRM* c <2> aassign[t4] vKS d <@> leave[1 ref] vKP/REFC -e syntax OK

See above that the array assignment is completely bypassed; instead the array is attached in a funny kind of way to the regex which is then passed to split, and split places the results directly into the array instead of returning them.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-25 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found