[Israel.pm] find line in page

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


Try:
	my $i;
	$i++ while <@{\$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

hello!

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
output.

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

is there a fast way to do it?

thanks 

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
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list