Perhaps using paragraph mode. Something like this:
#!/usr/bin/perl #<"SplitFile.pl"> Split File use warnings; use strict; my ( $OPTION, $SEARCH, $FLNAME ) = @ARGV; open XFILE, '<', $FLNAME or die "Couldn't open '$FLNAME': $!\n"; local $/ = ''; # Set paragraph mode while ( <XFILE> ) { if ( $OPTION eq 'with' && /$SEARCH/i ) { print; } elsif ( $OPTION ne 'with' && !/$SEARCH/i ) { print; } }
In reply to Re: Include Delimiter in Split Output
by jwkrahn
in thread Include Delimiter in Split Output
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |