> > Nifty. One of the goals of a JAPH is to demonstrate one or more of > > Perl's advantages/quirks. > > Fun. New concept for me. Here's a less interesting one I wrote after > reading your emails: > > sub japh { $_ = shift; print $1 while /(.)/gs; } print $/ unless > &japh("Just another Perl hacker,"); >
A more finished version: use strict; use warnings; sub japh { $_ = shift; s/\n/ /gs; chop; print $1 while /(.)/g; } print ',',$/ unless &japh("Just\nanother\nPerl\nhacker\n"); Regards, John