#!/usr/bin/perl -w # encode_template.pl - Don Yang (uguu.org) # # 12/26/08 use strict; my $input = join "", <>; while( $input ne "" ) { if( $input =~ s/^\n(.*)$/$1/s ) { print "!"; } elsif( $input =~ s/^( {1,34})(.*?)$/$2/s ) { print chr(ord("]") + length($1) - 1); } elsif( $input =~ s/^(\S{1,52})(.*?)$/$2/s ) { print chr(ord("(") + length($1) - 1); } else { die; } } print "\n";