#! /usr/bin/perl # Run: test.pl < test.pl | more use strict; for (<>) { my @a = split(//); my @b = (); push(@b, [splice(@a, 0, 4)]) for (@a); push(@b, [@a]) if (@a); for (@b) { print("@{$_}[0]") if (@{$_}[0]); print("@{$_}[2]") if (@{$_}[2]); print(" as @{$_}[3]") if (@{$_}[3]); } } __END__ "> <!-- page:title !--> / <!-- page:subtitle !-->