I was trying to delete a particular pattern say something like <HTML> from a text file.
How would I do that in perl?

The following reads each line from an input file, removes the specified pattern from each line, if found, and prints each line to standard output, which could easily be redirected to a file.

use strict;
use warnings;

*ARGV = *DATA if scalar(@ARGV) == 0;

while (<>) {

Hello there.
The words here at the end of the script
supply default testing data in case there
is no input file named on the command line.
If you want to delete all occcurences of <HTML> and <HTML> and <HTML>
then this should do it, but what about the </HTML> tag?
The </HTML> won't get deleted but the <HTML> tag will.
Is that what you want?