in reply to Re: Re: Re: Re: Intercharacter spacing
in thread Intercharacter spacing
Well, the condition "if($pattern1)" does NOT test for the presence of image tags in the html data. It merely tests that some (non-empty, non-zero) value has been assigned to the scalar $pattern1, and since you have done so a few lines above this, the test will always be true -- it would be true if no data were read in from the html file.# Test for presence of patterns in HTML file if($pattern1) { scrapImageTag(); # calls to remove image tags } else { print "No tags matching this pattern within the HTML document.\n"; }
To test for the presence of image tags in the html data, the condition would have to be:
but there's really no reason to do the test -- just go ahead and call the "scrap" functions. If those regex substitutions apply, fine. If not, no harm done (and not that much cpu work either).if ( grep /$pattern1/i, @htmlLines )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Strangeness with Web browsers...
by Tricky (Sexton) on Aug 16, 2003 at 15:31 UTC | |
by graff (Chancellor) on Aug 16, 2003 at 19:34 UTC |