Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Benchmark array passing Question

by jwkrahn (Monsignor)
on Jun 04, 2012 at 22:27 UTC ( #974388=note: print w/ replies, xml ) Need Help??


in reply to Benchmark array passing Question

my ($low,$high) = (0,scalar(@$array)); # computes the length of the a +rray and gives it to $high

You have an off-by-one error.    The value scalar(@$array) is not a valid index to any of the values in @$array.

my ($low,$high) = (0,$#$array); # computes the length of the array an +d gives it to $high


Comment on Re: Benchmark array passing Question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-07 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls