#!/usr/bin/perl -w # Take the output from our encoder and insert leading tabs for readability. # # This script only works if input is not indented, i.e. this script is # not idempotent. use strict; my $indent = 0; while( my $line = <> ) { if( $line =~ /^#(?:else|elif|endif)/ ) { $indent--; $indent >= 0 or die; } print "\t" x $indent, $line; if( $line =~ /^#(?:if|elif|else)/ ) { $indent++; } }