#!/usr/bin/perl use warnings; use strict; open my $fh, '<', 'file.aspx' or die "Can't open the damn file for reading!: $!"; my @file_content; while ( my $line = <$fh> ){ chomp $line; if ( $line =~ /^ <%-- -->