Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting on Text File
by Chady (Priest) on Oct 22, 2002 at 18:34 UTC | |
by Anonymous Monk on Oct 22, 2002 at 18:53 UTC | |
|
Re: Deleting on Text File
by admiraln (Acolyte) on Oct 22, 2002 at 19:16 UTC | |
by Anonymous Monk on Oct 22, 2002 at 19:28 UTC | |
by admiraln (Acolyte) on Oct 23, 2002 at 16:22 UTC | |
|
Re: Deleting on Text File
by Gordy (Scribe) on Oct 22, 2002 at 23:55 UTC | |
by Chady (Priest) on Oct 23, 2002 at 10:18 UTC |