Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Beatnik (493)

  (email not shown publicly)

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Thursday July 14, 2005
09:44 AM

Perl booboo of the day

[ #25705 ]
Moments before I left for home yesterday, I spotted a bug in one of my scripts.. It was stuck in an infinite loop. This morning I found what it was (after merely a minute of looking at my code)...Behold my stupidity:

while (@foo) {..

The thing is that I updated this code from a filehandle read to an array loop.. but in my autopilot mode probably just changed the filehandle (+ diamond operator) with the array.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I guess you could use the while( @apples ) { ... } construct if you were popping stuff off of @apples in the block. But maybe foreach my $apple (@apples) { ... } is the better way to go unless you want to actually eat all the apples from the array :)
    • Well yes... I usually would go about it like that.. if I have my head on straight :) However, if I've been surviving the day on hourly caffeine injections, there aren't much perl minded brain cells awake and I make booboos like that :)