in reply to Get file part from the section where the matched pattern is found.
Try changing this part:
if($filecontents =~ /\*\sdisks/){ my @matchsect = /\*\sdisks/; print "@matchsect\n\n"; }
to something like this:
if ($filecontents =~ /\*\sdisks/) { # delete everything up to the first occurrence # of "* disks" $filecontents =~ s/^.*?\*\sdisks//; print "$filecontents\n\n"; }
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|