ub del{ my $filename="test.txt"; my $template_data = "new/".$filename; undef $/; # Slurp mode open(DATA_IN, "$template_data") || print "Can't open output file1: + $template_data\n"; #binmode DATA_IN; $_ = <DATA_IN>; while(/<\?--([^-]*)-([^-]*)-->(.*?)<\/\?--([^-]*)-([^-]*)-->/sg){ $a=$1;$b=$2;$c=$3;$d=$4;$e=$5; if ($a eq $location){ if($b eq $obj_name) { #Code should be here, and it's where I a +m having problems... } } $list=$list. "<?--$a-$b-->$c</?--$d-$e-->\n"; } close DATA_IN; open( DATA_OUT, ">test.new" ) or die "$! +\n"; print DATA_OUT "$list\n"; close DATA_OUT;
In reply to Deleting on Text File by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |