Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: array pre-allocation trick

by rir (Vicar)
on Oct 31, 2002 at 02:04 UTC ( [id://209310]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {  
     my $initialized;
    ...
          # fill the array
     }
    }
    
  2. or download this
    sub example {
        my @array;
        $#array = $size_needed;
        # fill array -- this is where you may save time
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-25 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found