Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: How to burn 100 megabytes in one line and still get the wrong answer

by zude (Scribe)
on May 14, 2004 at 15:47 UTC ( [id://353402]=note: print w/replies, xml ) Need Help??


in reply to Re: How to burn 100 megabytes in one line and still get the wrong answer
in thread How to burn 100 megabytes in one line and still get the wrong answer

Urk. How to (try to) burn 4 gigabytes:
$number &= 0x0xFFFFFFFF;
Candidate for Most Lethal Typo award. Note: untested

Update: OK so I tested it and it doesn't compile. Award rescinded.

  • Comment on Re: Re: How to burn 100 megabytes in one line and still get the wrong answer
  • Download Code

Replies are listed 'Best First'.
Re: How to burn 100 megabytes in one line and still get the wrong answer
by Abigail-II (Bishop) on May 14, 2004 at 16:36 UTC
    Even if it did compile, it isn't that lethal. In fact, even if you type:
    $_ = 0x0x0xFFFFFFFF
    perl will try to allocate a large piece of memory, and unless you have the memory for it, the malloc will fail, causing Perl to quickly segfault. And even if you do have the memory, at worst you have a temporary slowdown of your system. Big deal. Far more lethal are mistypings in open:
    open my $fh => ">" => "/etc/passwd" or die; # Oops, mistyped '<'
    (assuming you're running this as root).

    Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-25 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found