Andrew Savige | 15 Mar 10:26 2013
Picon

FW: 3/15/2013 10:26:49 AM


http://www.occamobile.com/zhvrm/htdza/hsp/gr/vo 

 3/15/2013 10:26:49 AM .

Andrew Savige
Moritz, Georg | 16 May 13:51 2012

AW: seeking golfing advice

> btw here is an example :
> 
> the code, applied on (1, 2, 3, 4) would return (1, 3). Thanks

so you want to check every element for oddity of its value, not its index, right?

 <at> list = grep{$_%2} <at> array;

cheers,
0--gg-

> On 16 May 2012 13:15, damien krotkine <dkrotkine <at> gmail.com> wrote:
> > Hi,
> >
> > I'm using this code to get a list of only the odd elements of an
> > array. The resulting list must have the same order as the array.
> >
> > map { state $f; ($_) x (++$f%2) }   <at> array;
> >
> > I'm looking for advice to make it shorter or nicer. Everything in perl
> > 5.12 is allowed, but must pass use strict. I've failed at using the
> > '..' operator to act as a flip/flop operator...
> >
> > thanks,
> > dams
>

damien krotkine | 16 May 13:15 2012
Picon

seeking golfing advice

Hi,

I'm using this code to get a list of only the odd elements of an
array. The resulting list must have the same order as the array.

map { state $f; ($_) x (++$f%2) }   <at> array;

I'm looking for advice to make it shorter or nicer. Everything in perl
5.12 is allowed, but must pass use strict. I've failed at using the
'..' operator to act as a flip/flop operator...

thanks,
dams

Andrew Savige | 2 May 14:56 2012
Picon

The History of Acme::Bleach and Acme::EyeDrops

The story behind Acme::Bleach and its many cousins:

 http://www.perlmonks.org/?node_id=967004

Feedback and anecdotes welcome.

Thanks,
/-\

Philippe Bruhat (BooK | 16 Mar 12:44 2012
Picon

Secret operators: the documentation

So,

A few years back, I started to write a manual page about Perl secret operators,
with the goal of getting it into the official Perl documentation at some point.

Somehow I got interested in that again, and started to really work on it.
The current work in progress is availabled at: https://github.com/book/perlsecret

I've already included most of the feedback from the discussions on ~~<>.

Patches welcome.

When it's stabilized enough, I'll send a patch to p5p.

--

-- 
 Philippe Bruhat (BooK)

 Too many believe only in the belief.
                                    (Moral from Groo The Wanderer #58 (Epic))

Philippe Bruhat (BooK | 14 Mar 12:36 2012
Picon

The sperm secret operator: is it new?

Hi,

While doing some tests/research on secret operators, I stumbled upon this
one in my one-liners:

    ~~<>

Obviously, this should be named "the sperm operator". It's only useful
in list context. Just like sperm cells work better when there are many
of them. ;-)

Now, if you want to get a number from that line you just read, you
could use this variation:

    ~~<>+0

which we could name the fertilisation, conception, fecundation or
syngamy operator, except the flagella (~~) has become useless, since
the +0 operator (ovum?) already provides scalar context. So it's just
the same as <>+0.

I have no idea if this operator is really new, or if someone else found
and named it already before today. My Google-fu is too weak to make
useful searches on it.

--

-- 
 Philippe Bruhat (BooK)

 No matter who you may be, there is always someone who is a little worse
 because he thinks he is a little better.
(Continue reading)

Father Chrysostomos via RT | 4 Jan 08:40 2012
Picon

[perl #107368] perl -e '#!perl -s' is weird

On Sun Jan 01 13:12:30 2012, sprout wrote:
> I wonder if I could write a quine with this. :-)

perl -le '#!perl -s' -e'$a=1;print+"perl -le \x27#!perl -s\x27
-e\x27\$a=${q\e$a\}\x27"'

--

-- 

Father Chrysostomos

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=107368

Shlomi Fish | 26 Dec 10:16 2011

http://golf.shinh.org/


Begin forwarded message:

Date: Mon, 26 Dec 2011 11:13:48 +0200
From: Shlomi Fish <shlomif <at> shlomifish.org>
To: golf <at> perl.org
Subject: New Golf Server - http://golf.shinh.org/

Hi all,

there's a new Golf server called Anarchy Golf, which supports Perl
(perl-5.12.4) and many other languages:

http://golf.shinh.org/

One feature of it is that the solutions are revealed after a while, whose lack
really bothered me in codegolf.com. Its source code is in a GitHub repository
and it has an IRC channel on Freenode.

Regards,

	Shlomi Fish

--

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://shlom.in/hhfg

<Botje>  Khisanth =~ s/must sleep/must give Botje all my money/ .
    — Freenode’s #perl
(Continue reading)

Peter Makholm | 30 Nov 15:00 2011
Picon

Abuse this!

It is kind of obvious when you unfold the loop, but what is the best
abuse of this very deprecated perl feature?

//Makholm

#!/usr/bin/perl
                $japh = pack "C*", 113, 123, 32 .. 122, 125;
$_ = q(49 6 8 7 91 26 13 12 7 19 22 9 91 43 22 9 15 91 19 26 24 16 22 9 79);
s/ (\d+) \s* /"\x24[=$1; print substr($japh, length($japh), !!$japh)"/eegox;

Sandro CAZZANIGA | 16 Nov 14:26 2011
Picon

decimal -> Binary

hi!

Just a little JAPH for convert decimal to binary.... Feel free to comment
it ;)
----------------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
eval { <at> ARGV} or die("No args") ;
foreach my $arg( <at> ARGV) {
    my $convert = unpack("B*",pack("N", $arg));
    my  <at> convertsp = split("", $convert);
    my $count = 0;
    foreach ( <at> convertsp) {
        unless ($convertsp[$count] == 1) {
            $convertsp[$count] = "" ;
            $count++;
        }
    }
    print("$arg:  <at> convertsp \n");
}
exit 0;
Yitzchak Scott-Thoennes | 15 Nov 20:01 2011
Picon

date validation via regex

This is something people often ask for.  The stock answer is that
regexes aren't the correct solution, but really it's not so hard.

This validates Gregorian MM/DD/CCYY dates, for example:

qr#^
    (?: 0[1-9] | 1[012] )
    /
    (?:
        0[1-9] | 1[0-9] | 2[0-8]
        | (?<! 0[2469]/ | 11/ ) 31
        | (?<! 02/ ) 30
        | (?<! 02/
             (?= ...
                 (?:
                     .. (?: [02468][1235679] | [13579][01345789] )
                     | (?: [02468][1235679] | [13579][01345789] ) 00
                 )
             )
        ) 29
    )
    /
    [0-9]{4}
    \z
#x


Gmane