i was messing around with implementing some security into my program and i noticed some strange thing in one of my foreach loops
if the number of arguments were higher than 50 in @array the foreach skipped all the variables over it. if the $_ argument was very complex then the limit was 20 arguments. so my question now is: is it possible that foreach will loop not waiting for the object (_call()) to finish and just go on. because if it is, then i have a serious problem. my program through time build up to huge number of lines and huge number of number of foreach loops.foreach (@array){ do something $self->_call($_); do something else }
if this is the case then please help me with some quick fix.
thnx
PS
it is interesting that i always stumble over some basic stuff, did anyone noticed the same problem (stumbling over basics while at the same time writing solutions to a really hardcore stuff)?
UPDATE:
ok what happens is this:
sub _do { my ($self,%arg) = @_; unless(%arg){ # some stuff (~200 lines) foreach my $choice (@array_choices){ # + log update my @choice_array = split(",",$print_hash{$choice}); my $pick; ($choice_array[0] eq 'correct') ? ($pick = "$choice_array[1]-$ +choice_array[2]") : ($pick = $choice_array[1]); # pick for correctio +n $self->_do($choice_array[0] => $pick); + # repete undo precedure with defined values ($choice_array[0] eq 'correct') ? (delete $class_log{do}[$hash +_order{$choice_array[0]}]) : (delete $class_log{do}[$hash_order{$prin +t_hash{$choice}}]); # delete do choice push(@return_log,"_do($choice_array[0] => $choice_array[1]);") + unless (ref $pick eq 'ARRAY'); # data for physh push(@return_log,"_do($choice_array[0] => \[$choice_array[1],$ +choice_array[2]\]);") if (ref $pick eq 'ARRAY');# data for physh } } else{ # brute _do } }
so the answer to grizzley's second question is yes
also the sub uses some ~100 other objects in the first part is the sub (it is a final wrapper) so showing you the whole script won't do any good
UPDATE2:
the loop and objects called within the loop are "redo,last" free, no such calls are made
In reply to foreach loop - could it beeeeee!! by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |