Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re (tilly) 6: Golf: Arbitrary Alphabetical Sorting

by tilly (Archbishop)
on May 10, 2001 at 11:26 UTC ( #79341=note: print w/replies, xml ) Need Help??


in reply to Re: Re^4: Golf: Arbitrary Alphabetical Sorting
in thread Golf: Arbitrary Alphabetical Sorting

I find this turn of events absolutely astounding, and I only have one thing to add.

It may not display well, but the two escape sequences can be replaced by the actual characters. This brings it back down to 70. Here is the paste from my system, this may not work on yours:

sub o{ ($c,*w,$")=@_;sub t{eval"y/\Q@$c\E/-/";$_}sort{t($_=$a)cmp t$_=$b}@w }

UPDATE
It definitely won't work on yours. It seems the \0 was trimmed from the output. To get what you need go back to chipmunk's post, download his code to a file, then run this:

perl -pi.bak -e 's/\\(\d+)/chr(oct($1))/e' filename
(Use " instead of ' on Windows.) The resulting file will have the key subroutine reduced to 70 characters, and will still run.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://79341]
help
Chatterbox?
[shmem]: of course
[shmem]: the members of @another_array are conflated to @array
[shmem]: try it out:
[Lady_Aleena]: shmem, thanks. I'm am way out of practice.
[shmem]: perl -lE '@foo = (0..3);@bar = (4..7); push @foo,@bar; say for @foo'
[Lady_Aleena]: shmem, I feel like an idiot for forgetting something so basic.
shmem puts a big cauldron of "silly con charme" on the table in the refectorium
[reisinge]: 'push @foo, @bar' is the same as '@foo = (@foo ,@bar)' ?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-04-27 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (503 votes). Check out past polls.