SPUG: newbie question over here

Richard Anderson Richard.Anderson at seaslug.org
Fri Aug 6 15:13:39 CDT 1999


The next statement can only be used inside a loop construct (while, until,
for, foreach).  I don't see any of these in your code.  Maybe you have one
of these statements above the code snippet, but let an extra curly bracket
sneak in that terminated the loop block.

Richard.Anderson at seaslug.org
www.halcyon.com/starfire/home (personal)
www.halcyon.com/starfire/rayco (corporate)
----- Original Message -----
From: Ryan Forsythe <ryan at webrocket.net>
To: <spug-list at pm.org>
Sent: Friday, August 06, 1999 12:08 PM
Subject: SPUG: newbie question over here


> hi there...this is my first post to this list, so be nice...
>
> i've been (trying) to teach myself perl over the last few weeks, and i've
been
> getting somewhere.  however, for the last few days i've been plagued by
this
> problem with the 'next if <statement>' command.  i've pored over the camel
book
> and all the FAQs i can find...i still can't figure out what i'm doing
wrong.
> any help would be greatly appreciated (and contribute postively to my
mental
> health)
>
> here's the chunk of my code that wigs out:
>
> if ($queryLine =~ m/^$/) {
> unless ( !($dbaseLine = <ACCOUNTS>) && ($dbaseLine =~ m/^$/) && ($count >=
$maxRecords) ) {
> $count++;
>
> #i've used the pound sign as comment in the dbase, so if it's the first
char in the record
> #i skip the record line.
> next if $dbaseLine =~ m/^#/;
>
> ....more code....
>
> }
> }
>
> and i get this error from the compiler:
> Can't "next" outside a block at findacct.pl line 34, <ACCOUNTS> chunk 1.
>
> (line 34 is the line beginning with 'next if...')
>
> thanks in advance
> --ryan
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>     POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
>  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
>  SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
>         Email to majordomo at pm.org: ACTION spug-list your_address
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list