Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: another elegance contest

by salva (Canon)
on Nov 16, 2005 at 13:00 UTC ( #509016=note: print w/replies, xml ) Need Help??

in reply to another elegance contest

my $x = qr(klops); my @a = qw(apfel klops klops börne joghurt klops nüß) my @e; @a = grep { $_ !~ $x or not push @e, $_ } @a;

Replies are listed 'Best First'.
Re^2: another elegance contest
by tos (Deacon) on Nov 16, 2005 at 15:42 UTC
    Salve SALVA, :-)

    that's a really fabulous solution. It's just the kind of consise perl-semantics i like so much. Unfortunatly i'm only rarly able to create such pretty code-jewels by myself.

    I also tried approaches with 'grep' but the 'not'-trick would never have occurred to me.

    Thank you brother, ;-)

    regards, tos

    Is simplicity best or simply the easiest Martin L. Gore

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://509016]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-02-25 07:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found