in reply to (jeffa) Re: Vanishing Data
in thread Vanishing Data

It's a really minor point, but this statement is not strictly true:
print "'$_' is empty string" if $_ =~ /^$/;
What you want is /^\z/, since /^$/ will also match a single newline, as evidenced by the following test:
print "Empty matches ^\$ --> ", ("" =~ /^$/ ? 'yes' : 'no'), "\n"; print "Newline matches ^\$ --> ", ("\n" =~ /^$/ ? 'yes' : 'no'), "\n" +; print "Empty matches ^\\z --> ", ("" =~ /^\z/ ? 'yes' : 'no'), "\n"; print "Newline matches ^\\z --> ", ("\n" =~ /^\z/ ? 'yes' : 'no'), "\n +";