Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

(tye)Re4: one-liner hogs

by tye (Cardinal)
on Feb 01, 2001 at 22:30 UTC ( #55771=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: one-liner hogs
in thread one-liner hogs

Ah, I think you've accidentally stumbled upon an obfuscated hog of a different kind. Consider:

open(ZERO,"</dev/zero") or die $!; my $x= <ZERO>;
I think I'll let someone else explain what that does so people have a little time to think about it. (:

        - tye (but my friends call me "Tye")


Comment on (tye)Re4: one-liner hogs
Download Code
Re x 5: one-liner hogs
by baku (Scribe) on Feb 05, 2001 at 20:23 UTC

    Serves me right for working on a machine with no /dev/zero.... argh.

    The <> operator will seek $/, never find it, and just fill memory to the rlimit. Not great for a disc test.

    That makes the 'line' read:

    perl -e 'open M,"/sbin/mount|grep -v':'";while(<M>){($m)=split($_); if(fork){open Z,"</dev/zero";open F,">$m/.#overflow#";while(read(Z, $x,4096)){print F $x}}};

    Bleh.

    cat /dev/zero > /tmp/kill.system

    Less effective, but easier to type. And probably a good way to muck up 90% of systems :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-04 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls