[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] JAPH made up entirely of double-chars?



On Fri, Mar 30, 2001 at 07:09:32PM -0800, Sean McAfee wrote:
> Recently I began toying with the idea of writing a JAPH composed entirely
> of double-characters; that is, a program for which the i-th character
> is the same as the (i+1)-th character, for all even i.  I worked on it
> for less than an hour before concluding that such a program is probably
> impossible, mainly because no Perl built-in is made of double-characters,
> nor is any operator (except qq).  But I figured I would turn the challenge
> over to the FWP crowd and see if anyone can surprise me.
> 
> An additional hindrance is that the $= variable seems to implicitly
> convert to a number any scalar assigned to it.  Observe:
> 
> perl -le '$= = "testing"; print $=; $= = \5; print $='
> 
> On my machine this prints:
> 
> 0
> 135059684
> 
> Is this behavior documented anywhere?


Here's a JAPH that uses double characters most of the time. (I didn't
double whitespace outside of strings, such trivialities can be easily
added). Perhaps someone can improve it.


$$aa =
  qq ((pprriinntt  qq  ""JJuusstt  aannootthheerr  PPeerrll  HHaacckkeerr""));;
$$aa =~ s((((((((((((.)))))))))))((\11)))($11)gg;;
$$aa =~ s((((((((((((....................................))))))))))))(($11))ee;;



Here's another way to assign a string to a variable, using (mostly)
double chars:

$$xx = <<EE;;
FFoooo!!
EE

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe