Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Odd

by Zaxo (Archbishop)
on Feb 23, 2002 at 01:47 UTC ( [id://147017]=note: print w/replies, xml ) Need Help??


in reply to Odd: Out of memory! error

$records is an array reference, you dereference it as a hash. The result is that you try to assign 1 to a very large index, autovivifying everything below that. I get the message:

Out of memory during "large" request for 1073745920 bytes, total sbrk( +) is 1616744 bytes at oop.pl line 6 (#1)

Update: This is right as far as it goes, but ++wog nailed this question and settled BlueLines's objection at the same time.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Odd
by BlueLines (Hermit) on Feb 23, 2002 at 02:05 UTC
    Nope. Perl throws an exception when you try to dereference an array ref as a hash. Try it:
    [jon@devotchka jon]$ perl my $a = []; $a->{z} = 1; Can't coerce array into hash at - line 2.


    BlueLines

    Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Log In?
Username:
Password:

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

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

    No recent polls found