while () { next unless /^~/;# Skip line unless it starts with ~ tr/_/+/; } continue { print; }