[Israel.pm] find line in page

Itzik Lerner - Orpak itzik at orpak.co.il
Mon Jul 19 06:23:50 PDT 2004


	my $i;
	$i++ && /word/ && last for $page->as_string;

--Itzik Lerner

-----Original Message-----
From: Ernst, Yehuda [mailto:yernst at ndsisrael.com] 
Sent: Sunday, July 18, 2004 2:39 PM
To: perl at perl.org.il
Subject: [Israel.pm] find line in page

I tried the starter list no success so i am trying here


I have a html page and i would like to find a line number inside that
contains a unique word

i know how to find the line i took the page and put it into array

$page = get(http://)
@lines = $page->as_string;

now i want to look for a word in the page but i need the line number as the

i did it with while loop and    @lines[$i] =~ /word/ 

is there a fast way to do it?


Yehuda .

Information contained in this email message is intended only for use of the
individual or entity named above. If the reader of this message is not the
intended recipient, or the employee or agent responsible to deliver it to
the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please immediately notify the
postmaster at nds.com and destroy the original message.

Perl mailing list
Perl at perl.org.il

More information about the Perl mailing list