#!/usr/bin/perl $^I = ".bak" ; open (IN,@ARGV[0]) || die "Can't open @ARGV[0]"; while () { chop ; if (/

/) { print "got H2\n"; s/

// ; s%

%% ; $descr = $_ ; } } $file = $ARGV[0] ; @ARGV = ($file) ; # prime diamond operator for inplace edit while (<>) { chop ; if (//) { print "$_\n"; print "\n" } else { print "$_\n"; } }