#!/usr/local/bin/perl -s # Breaks lines with \n after each ">" closing tag (except ">\n") # So you can read the source of the html file if someone produced it with cgi # which spit all in one line $0 =~ s/^.*\///; # cut the basename of the command # Diagnostic part... if ($#ARGV<0 || $h) { die "\nUsage: \t $0 [-options] original_file(s) options: -h You read me now -no_bak Don't backup the original file \n" } # Real program... while (<>){ if ($ARGV ne $oldargv){ if (!$no_bak) {rename($ARGV, $ARGV . '.bak');} open (ARGVOUT, ">$ARGV") || die "Can't open $ARGV[0]: $!\n"; select(ARGVOUT); $oldargv= $ARGV; } s/>([^\n])/>\n$1/g; } continue { print; # this prints to the original filename } close(ARGVOUT); select(STDOUT);