Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: strange list operator

by xiaoyafeng (Deacon)
on Oct 09, 2015 at 08:41 UTC ( [id://1144278]=note: print w/replies, xml ) Need Help??


in reply to Re: strange list operator
in thread [Resolved] strange list operator

But how explain example 5?




I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re^3: strange list operator
by choroba (Cardinal) on Oct 09, 2015 at 08:43 UTC
    List assignment is not optimized, but for is.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Thanks for your reply, but does perl put all list assignments together? otherwise you can't explain why it still throw out of memory when example 2running




      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

        That's because you used literals, so the range operator is expanded at compile time. If you used
        my $max = 2e7; my @aa = 1 .. $max; my @bb = 1 .. $max;

        You'd get no error, as the lists are expanded at runtime and immediately thrown away.

        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found