Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: How to kill perl?

by robin (Chaplain)
on Nov 04, 2005 at 23:30 UTC ( #505905=note: print w/replies, xml ) Need Help??


in reply to Re: How to kill perl?
in thread How to kill perl?

Any one have any others?

I just fixed a whole bunch of sort-related ones, which is what got me thinking about this. If your perl is less more than a week old, these should kill it:

perl -e'sub f{undef &f} ()=sort f 1,2' perl -e'sub f{goto sub{1}} ()=sort f 1,2' perl -e'@a=(1..10);@a=sort{@a=(1);0}@a'

Replies are listed 'Best First'.
Re^3: How to kill perl?
by sauoq (Abbot) on Nov 04, 2005 at 23:52 UTC
    perl -e'@a=(1..10);@a=sort{@a=(1);0}@a'

    That works fine for me on 5.8.0 buts segfaults on 5.8.7.

    -sauoq
    "My two cents aren't worth a dime.";
    
      Since 5.8.4, @foo = sort @foo is optimised to be an in-place sort of @foo, which is what makes it die so messily.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://505905]
help
Chatterbox?
[Lady_Aleena]: Hello everyone. I'm having a blonde moment. I can push an array to an array, right? push @to_array, @another_array;
[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

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











    Results (503 votes). Check out past polls.