use strict; die'TILDE',@~; sub CHECK{@~=$~=~m~(.)~g,unshift@~, splice@~,2,3;unshift@~,pop@~,*{H},; push@~,*{PAR}=>;($~[$#{~}],$~[$#{~} +-1])=($~[$#{~}+-1].$/=>$~[$#{~}]); for(@{~}){s~.*:~~;s~$~ ~ if$?++%2}} #### use strict;no warnings; sub CHECK{ # Who knew? CHECK blocks get called after compilation, # before execution! See perlmod @~ = $~ =~ m~(.)~g; # @~ is a valid but odd array name, eh? # $~ is the default output file handle, "STDOUT" # and so @~ = qw(S T D O U T) unshift @~, splice @~, 2, 3; # rearrange @~ to qw(D O U S T T) unshift @~, pop @~, *{H}; # rearrange further: pop@~ is "T", and *{H} # is "*main::H" (which would yield a warning) # so @~ is now qw(T *main::H D O U S T) push @~, *{PAR}; # now @~ is qw(T *main::H D O U S T *main::PAR); ($~[$#{~}],$~[$#{~}+-1])=($~[$#{~}+-1].$/=>$~[$#{~}]); # that gibberish swaps the last two elements, and # then appends a newline to the (new) last element, # so @~ is qw(T *main::H D O U S *main::PAR T\n); for(@{~}){ s~.*:~~; # delete "*main::", leaving qw(T H D O U S PAR T\n) s~$~ ~ if ($?++%2) # append a space to each odd element, so we have # ("T", "H ", "D", "O ", "U", "S ", "PAR", "T\n ") } } die 'TILDE', @~; # die with @~ in scalar form: # [TILDE][T][H ][D][O ][U][S ][PAR][T\n ]