SPUG: newbie question over here

Ryan Forsythe ryan at webrocket.net
Fri Aug 6 14:08:44 CDT 1999


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





More information about the spug-list mailing list