[Pdx-pm] Noob...

James marks jamarks at jamarks.com
Thu Mar 18 01:48:13 CST 2004


I'm wondering if you can give me some  help. I'm trying to learn Perl 
but could use some advice as I go about trying to solve a practice 
project (I'm just getting started at learning Perl):

I want to parse an HTML file that exists on the web.

I know I can  have Perl retrieve the file but, to make things simpler, 
I've downloaded it to my hard drive.

My attempts so far have involved reading the entire file into a 
variable (I'm using a demo version of Late Night Software's Affrus, by 
the way) then trying to parse the string contained by the variable.

Is it "better" Perl programming to have the Perl script read the file 
in one line at a time or is reading the entire file into a variable ok?

How do I have the script jump from the first regex match the the next? 
I've tried several loops but none have worked so far. Should I be 
trying to work with the string contained in the $' ($POSTMATCH) 

Are Perl scripts normally invoked in the Terminal? I don't see how, 
other than making an executable, a script would be launched from the 

Again, I'm just starting out in Perl so I'm sure some of these 
questions seem pretty elementary. I'm coming to Perl from about 3 years 
using AppleScript so I think I have a handle on the concepts of 
variables, globals, loops, branching, libraries, etc... but I haven't 
really worked with the UNIX command line before this.

Thanks for any help you can provide!


More information about the Pdx-pm-list mailing list