A nice simple one for budding deconstructors

use strict; sub _{"#".shift(@_)x$#_."#\n"}my @__=('A'..'Z',$",'&') ;sub __ {"#",$"x((@__-@_)/2),@_,$"x((@__-@_)/2),"#\n"} s//#/;print _($_,@__),_($",@__), __(@__[9,20,18,19,26] ), __(@__[0,13,14,19,7,4,17]), __(@__[15,4,17,11,26]), __(@__[7,0,2,10,4,17,26]),_($",@__),_($_,@__); __END__

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
dissection of Re: me & JAPHy
by japhy (Canon) on Jul 06, 2001 at 19:42 UTC
    I'm not "budding", per se...
    use strict; sub _ { "#" . shift(@_) x $#_ . "#\n" } # first argument is copied as many times as there # are OTHER arguments (minus 1 due to $#_ and not @_). # a '#' is put on the front and back of this string. # this gets passed "#" or " ", and @__ and as we see # below, @__ has 28 elements, so this'll print 30 chars. my @__ = ('A'..'Z', $", '&'); # 'A' to 'Z', ' ', and '&' sub __ { "#", # a '#' $" x ((@__-@_)/2), # half the difference, that many spaces @_, # the arguments $" x ((@__-@_)/2), # half the difference, that many spaces "#\n" # a '#' and newline } # the goal of __() is to CENTER the text it's given s//#/; # put a # at the front of $_ print _($_,@__), # '###########' _($",@__), # '# #' __(@__[9,20,18,19,26]), # '# JUST #' __(@__[0,13,14,19,7,4,17]), # '# ANOTHER #' __(@__[15,4,17,11,26]), # '# PERL #' __(@__[7,0,2,10,4,17,26]), # '# HACKER #' _($",@__), # '# #' _($_,@__), # '###########'


    japhy -- Perl and Regex Hacker