Re: stuck in a while loop



Nospam <nospam@xxxxxxxx> wrote:

Can anyone identify what is wrong with code,


What does it do? What do you want it to do instead?


or worse how to fix it?,
^^^^^

Knowing how to fix it would be *better* than just pointing
out what was wrong.


it
worked one time, but not anymore, I have hardly made any changes


Then what is wrong is where you made the changes.

Where did you make the changes?


use constant START => "<FILE2>";


Your program never uses this constant, so why is it there?


my $START = <FILE2>;

(my $varia1 = $START) =~ s/\@.*//;


$varia1 has a newline at the end. Is that what you want it to have?


$mech->field('login',"$varia1");
^ ^
^ ^

perldoc -q vars

What's wrong with always quoting "$vars"?


my @content1 = $content3;


How many elements are in the @content1 array?


foreach my $content2 (@content1) {


A loop that iterates one time is not much of a loop.


open (FILE, ">> hm5.txt");


You should always, yes *always*, check the return value from open().


last;
}


There is no need to exit "early" from a loop that only iterates
one time anyway...


--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.



Relevant Pages

  • Re: shrinker->nr = LONG_MAX means deadlock for icache
    ... If breaking the loop despite we made progress doesn't risk to make us go ... an huge nr value would over-shrink the caches. ... proposed fix was ok. ... status of the kernel that they used has all nr_unused and other icache ...
    (Linux-Kernel)
  • Re: How do you forth experts drop a break_point ?
    ... Say that I believe the problem is at step 2417 of a do loop. ... rummage through it enough to find this error and fix it, chances are ... There's a strong temptation not to do that for commercial code because ... Much more pleasant to think that one last patch will fix ...
    (comp.lang.forth)
  • Re: recording with a click (or thumper) track...
    ... Lori Dovi came up with a quick fix on the indie film "Groove", ... The on camera dancers would glance at them once in awhile ... try an induction loop (either ... have to deal with all those dancing feet making noise. ...
    (rec.arts.movies.production.sound)
  • Re: Xnews: Smart decoding doesnot work too well
    ... I think there's mention of the 'loop' syndrome somewhere in the manual ... So, if you've been plagued by this bug, ... Hope the above fix works for you. ... my Xnews.ini misc is here ...
    (news.software.readers)
  • Re: scoping problem
    ... "my $r;" will do the same thing, but I don't mind explicit ... initialization very much. ... $i anywhere else in the loop, just don't use that style of loop. ... Fix all these as above. ...
    (comp.lang.perl.misc)