Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: $#="%c"; possible bug

by ambrus (Abbot)
on Feb 21, 2004 at 18:20 UTC ( #330838=note: print w/replies, xml ) Need Help??

in reply to $#="%c"; possible bug

After abigail's post, it's clear how $# works. Perl calls the builtin sprintf with a single floating point argument, and the resulting text is the string representation of the number (if $# is set). You can even decompose a double to two ints by setting $# to "%x/%x". This explains the strange strange phenomena that setting $# to a stupid value causes.

However, as an interesting consequence you can still segfault perl with some code like perl -we '$#="%s\n"; print exp 1;' or perl -we '$#="%n\n"; print exp 1;'

Replies are listed 'Best First'.
Re^2: $#="%c"; possible bug
by ambrus (Abbot) on Jul 20, 2004 at 00:24 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://330838]
[Discipulus]: figuring.. i'm still just use the side pm chat..
[erix]: (all this while karls guitar gently weeps...)
[planetscape]: (invade Hungary)++ #I'm hungry
[stonecolddevin]: i went too far down the irc rabbithole to hook this back up there
[Discipulus]: .. yes erix until NodeReaper put jhon coltrane again
[erix]: nice cover with the spitting image of George (and a great solo by Prince at the end )
[Discipulus]: good night monks! i feel fresh as the turkey in the hoven but i need to sleep
[planetscape]: gobble, gobble, Discipulus!
[erix]: Discipulus: buonanotte! :)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-06-22 21:16 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (531 votes). Check out past polls.