Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: A little win

by anneli (Pilgrim)
on Oct 19, 2011 at 07:47 UTC ( #932318=note: print w/replies, xml ) Need Help??

in reply to Re: A little win
in thread A little win

Combine that with tye's suggestion and we're down to:

:'<,'>!perl -pe 'tr/<>//d; $_ = pack "C*", split ","'

Replies are listed 'Best First'.
Re^3: A little win (!split)
by tye (Sage) on Oct 19, 2011 at 13:19 UTC

      ... simplicity wins again.

Re^3: A little win
by Tux (Abbot) on Oct 19, 2011 at 07:56 UTC

    Please read perldoc -f split, as the first argument to split is usually a regex, not a string

    :'<,'>!perl -pe 'tr/<>//d;$_=pack"C*",split/,/'

    Enjoy, Have FUN! H.Merijn

      Good point! I'll try to remember this from now on.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932318]
[1nickt]: What do you all think of experimental = refaliasing ? Anyone using it?
[1nickt]: \my %foo = { bar => 1 }; say $foo{bar};
[Corion]: 1nickt: Would be great, especially for naming parameters in @_.
[Corion]: When you pass an arrayref, you get to treat it like a local array. But then, I'm cautious with the experimental features, because just when I thought function signatures were a set thing, there is a proposal to use sub [ $foo, $bar ] { ... } to ...
[Corion]: ... declare the parameters, instead of the more common sub ($foo, $bar) { ... }

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-11-17 20:38 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (272 votes). Check out past polls.