in reply to Split file

You can modify $/ ( the Perl new line delimiter ) to ..DN: and then slurp each record in as one thing.

Just a something something...

Replies are listed 'Best First'.
Re^2: Split file
by Anonymous Monk on Nov 09, 2009 at 17:52 UTC
    #!/usr/bin/perl $/ = '..DN'; while(<DATA>){ chomp; if($output =~ m/\.\.DN:(.*)/) { open($fh, '>', "$1.xml") or die "$1.xml: $!"; print $fh, $_; } # End of sub sroutine }