my $str = <<'EOB'; start hehu7 gjwsdh hsjdhj remove hjhsj jdkwj hwjdhjwh end start crgr hjdhwjd wjdkwj wkjw g hjhd end EOB while ($str =~ /(\bstart\b.*?\bend\b\s*)/gs) { my $block = $1; if ($block =~ /\bremove\b/) { $str =~ s/\Q$block\E//; } } print $str; __END__ start crgr hjdhwjd wjdkwj wkjw g hjhd end
In reply to Re^3: how to remove block of data from file based on string
by Anonymous Monk
in thread how to remove block of data from file based on string
by royalreddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |