[singapore-pm] Perl Meet up at Singapore

Gaurav Vaidya gaurav at ggvaidya.com
Sat Sep 21 01:38:28 PDT 2013


Hi everybody!

On 20 Sep, 2013, at 12:19 AM, Saravanan T <talk2saravanan at yahoo.co.in> wrote:
> Cool Info Patrick!
> 
> Gaurav is doing good!
Well, I'm sick. But I think I'm getting better! Also Boulder, Colorado is the beautifulest beautiful imaginable, so I am very happy, even if sick :)

> Yes..Gaurav also suggested to host in hackerspace.sg.
> Can we use it at free of cost?
The last time we had a meeting there, we had to get one of the Hackerspace members to host the event for us. But you can also e-mail events(at)hackerspace(dot)sg, see http://hackerspace.sg/about-us/

> From: Patrick Haller <singapore-pm at haller.ws>
> To: Saravanan T <talk2saravanan at yahoo.co.in> 
> Cc: "singapore-pm at pm.org" <singapore-pm at pm.org> 
> Sent: Friday, September 20, 2013 8:12 AM
> Subject: Re: [singapore-pm] Perl Meet up at Singapore
> 
> Here's a quick perl golf question for the list, what's the shortest way
> to write a rot13 function without mangling the variable passed in?
> 
> Here's my attempt:
> 
> sub rot13($) {
>     $a if (my $a = $_[0]) =~ tr/a-mn-z/n-za-m/
> }
I tried to make it wordier, but this won't translate punctuation correctly for some reason :-/

sub rot13 {
    return join "", map { $_ = ord; chr ($_ > 109 ? $_ - 13 : $_ + 13) } split //, lc shift;
}

cheers,
Gaurav


More information about the Singapore-pm mailing list