develooper Front page | perl.beginners | Postings from February 2002

RE: help to delete a line

Thread Previous | Thread Next
From:
John Edwards
Date:
February 27, 2002 09:28
Subject:
RE: help to delete a line
Message ID:
2FB59B145095D511A7C90050BAC349F31732DA@MAIL
You need to increment the counter *inside* that block as well. Otherwise,
$counter will remain 12 and you will go into an infinite loop.

if ($counter == 12) {
	$counter++
	next;
}
$counter++;

HTH

John

-----Original Message-----
From: Joanne Fearon [mailto:fearonj@maths.tcd.ie]
Sent: 27 February 2002 17:20
To: beginners@perl.org
Subject: help to delete a line


Hi,
I have a file that I am chopping and changing. I want to delete line 12
each time. I have a counter to tell the line number. Ive tried


if ($counter == 12)
	{
	next;
	}
$counter++


this doesn't give an error but doesnt move on to the next line either.

thanks in advance for any help
Jo.


-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About