Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Strange crash - any ideas?

by AssFace (Pilgrim)
on Oct 20, 2003 at 02:40 UTC ( [id://300461]=note: print w/replies, xml ) Need Help??


in reply to Re: Strange crash - any ideas?
in thread Strange crash - any ideas?

This seems to have resolved the problem. Changing the for loop so that it had:
for $ticker (@algTickers){ #use $ticker for anything for this spot in the array }
instead of
for(@algTickers){ #use $_ into a var and then use that var for this spot in the array }
This must have been something I missed as I was learning about "$_" out of a for loop - I must have only used it in straight loops and not nested loops up until now. Checked the camel book and in the foreach section it does say that each $_ is a reference, which I knew, but I don't see any code there that is clearing out that spot in the array... not sure why it was doing it, but this seems to have resolved the issue and then the ensuing side effects.

Now I need to uncomment a lot of lines now to confirm that this fixes the issue.


-------------------------------------------------------------------
There are some odd things afoot now, in the Villa Straylight.

Replies are listed 'Best First'.
Re: Re: Re: Strange crash - any ideas?
by Roger (Parson) on Oct 20, 2003 at 03:08 UTC
    Add the following to the top of your perl script:
    use strict; use Data::Dumper;
    And then add print Dumper(\@algTickers); before and after your for loop, as this will inspect your array and see what has been changed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found