Perl search and save

Kevin D. Clark kclark at CetaceanNetworks.com
Mon May 12 16:17:43 EDT 2003


Eric Schwartz <schwartz at ll.mit.edu> writes:

> Hello all,
> 	I am new to perl and was wondering if you could help me out.  I need to find out how to search a variable.
> 
> 
> 
> this is an excerpt of the variable:
> 
> <tr>	<td valign=top width=194><font class=s2 face="Arial,Helvetica" size=2>Total Sheets Fed</font></td>
> 
> 	<td valign=top width=130><font class=s2 face="Arial,Helvetica" size=2>59986</font></td>
> 
> 
> 
> I need to sort out the Total sheets fed, and the amount, which will be changing, in this case it is 59986.

I think that sending us a larger excerpt would be more useful.
Nevertheless, does this help?

($totalSheetsFeed) = $ericsVariable
        =~ /Total Sheets Fed\s*(?:<.*?>\s*)(\d+)/s;


(this is a hack; it doesn't handle every possible legal HTML input,
but if you want that, please give us more details)

Regards,

--kevin
-- 
"Then most certainly," I said, "such men would hold that the truth is
nothing other than the shadows of artificial things."
-- Socrates, in Plato's _Republic_




More information about the Discuss mailing list