On Jan 5, 2005, at 4:14 PM, Albert Kaltenbaeck wrote:
I am having problems with the substr command.
No you're not. :-)
You're barking in the wrong forest here - both the offset and length values you passed to substr() are being used just fine. You're getting exactly what you asked for from substr() - the contents of $line, starting at offset 35 and omitting the last three characters.
The difference is that, on MacOS, $line had just that, one line from the input file. It appears here to have the whole file in it. I suspect a line ending problem - verify that the input file has UNIX line endings.
PS: Now you've found out why most of us use and recommend HTML::Parser - it's much less pain than trying to parse HTML by hand.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org