#!/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 ( ) { if ( $OPTION eq 'with' && /$SEARCH/i ) { print; } elsif ( $OPTION ne 'with' && !/$SEARCH/i ) { print; } }