Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: array pre-allocation trick

by sauoq (Abbot)
on Oct 31, 2002 at 02:43 UTC ( [id://209316]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -le '$#{\my @array}=100;print scalar @array'
    0
    $ perl -le 'my @array;$#array=100;print scalar @array'
    101
    
  2. or download this
    $ perl -le 'use strict;$#{\my @array}=100;print scalar @array'
    Global symbol "@array" requires explicit package name at -e line 1.
    Execution of -e aborted due to compilation errors.
    

Log In?
Username:
Password:

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

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

    No recent polls found