#!/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, "E:\\Documents and Settings\\Richard Lamb\\My Documents\\HTMLworkspace\\HTML practice\\My First Page!\\firsttest\.html" or die ("Sod! Can't open this file.\n"); @htmlLines = ; scrapTag(); # calls method to remove image tags sub scrapTag # removes image tags from HTML document { while($htmlLines[$i] =~ m/]+)>/ig) # finds each instance of image tag in the input file { s/]+)>/ig//ig # replaces each instance of image tag with nothing! } } for my $i (0..@htmlLines-1) { print $htmlLines[$i]; } print "\n\n"; sleep 2; print "Success?!\n";