in reply to HTML image tag stripping

You have a problem with the undeclared $i in the while($htmlLines[$i] line. Also, you do not use the index of the array in the loop, so consider using a for(each) loop.
Then, your substitution is wrong, it should be ...//ig instead of /ig//ig. And you don't have to look for a match, just do a global replace; that is going to save you a little time on large files.
And one more thing: You seem to be using a Windows environment (the "Documents and Settings" line). In this case you can make the first line just #!perl, because /usr/bin won't exist anyways.

Hope I helped.

P.S.: Here is your (hopefully) fixed code:
#!/usr/bin/perl #htmltest2.plx # Program will read in an html file, remove the img tag and print out # no need for file variable yet: open (INFILE, "<".$htmlFile) or die(" +Can't read source file!\n"); use warnings; use diagnostics; use strict; my @htmlLines; open INFILE, "t.htm" or die ("Sod! Can't open this file.\n"); @htmlLines = <INFILE>; @htmlLines = scrapTag(@htmlLines); # calls method to remove image tags sub scrapTag # removes image tags from HTML document { my @htmlLines = @_; for (@htmlLines) { $_ =~ s/<IMG\s+([^>]+)>//ig # replaces each instance of image tag + with nothing! } return @htmlLines; } for (@htmlLines) { print; } print "\n\n"; sleep 2; print "Success?!\n"