Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
There's a bunch of spoilers here so click readmore to read them.
  • 1. I knew it was a trick using @_'s aliasing but I didn't pick up the glob assignment until I saw what BrowserUK did.
  • 2. {foo;redo}
  • 3a. $foo=*foo;$foo->[1]=$foo->{1}=\undef
  • 3b. I started fiddling with $foo=[(\!1)x2];*{"$foo"}=sub{!aye}' but was stopped by perl complaining that $foo was an array reference. I just wanted it to call the function with the name of its strinfied reference but I didn't see an immediate way around it.
  • 4. dump
  • 5. sub foo { my $x if 0 }
  • 6. $x = \1; $y = "$x"; $$y = 2
  • 7. $foo=*STDOUT{IO}
  • 8. I'm not sure how to read this. It is invalid to assume that either post increment would occur before each other - this is one of the cases where "undefined execution order" really comes into play. Now obviously, the actual order is defined by the optree which is defined by the implementation in which the first post increment (lexically) is going to execute first. So in which light am I supposed to solve this? The fiddly bits of the implementation (which in this case I'm not sure anyone is supposed to expect anything in particular) or the implementation's promise which is unspecified?
    Update 1*foo=$|;$foo=1 This answer assumes things about perl that I'm damned if I'll admit that this is a fair question. This particular behaviour is officially undefined (as to much of the rest of perl which is undefined by ommision).
  • 9a. $0=1;$foo=0
  • 9b. I'm stumped.
  • 10. I didn't see how to do this in twenty-six characters but here's a forty-five character solution: $"=::;${"@{[map 56922&2**$_?'y':x,0..15]}"}=1. I went on to start playing with ORing the bittests into the string value 'x' and got bored. print "@{[map(q[x]|q[].!(56922&2**$_),0..15)]}"
  • 11. I got tired and while I'm still probably stumped, I don't have the initiative anymore.

In reply to Re: How's your Perl? by diotalevi
in thread How's your Perl? by xmath

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2023-10-03 20:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found