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

Re: Re: How's your Perl?

by xmath (Hermit)
on Oct 27, 2003 at 19:48 UTC ( [id://302597]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: How's your Perl?
in thread How's your Perl?

I had been thinking about 10, but because nobody else bothers to hide their answers, I saw mtye's version already

Note that his version doesn't work under strict, while a strict solution is possible. (the 'official' solution is very different from mtye's), so the exercise isn't spoiled just yet ;-)

Replies are listed 'Best First'.
Re: Re: Re: How's your Perl?
by tilly (Archbishop) on Oct 28, 2003 at 10:36 UTC
    How about an answer for #10 at 24 characters that passes strict?
    use strict; #23456789_123456789_1234 BEGIN{$'y=*x::=*y::=*::} print "Yes\n" if $x::y::x::y::y::x::y::x::x::y::y::y::y::x::y::y;
      bingo :-)

      (it's (a slight variation of) the official solution)

        I don't know about anyone else, but I am stopping here. Problem 1 I know can be done, I have seen the solution, but I remember at the time thinking that I didn't care to know typeglobs well enough to figure that out. Problem 3b I ran afoul of Perl's "return by value" semantics, and I don't know any tricks offhand for that.

        Problem 9 I might be able to do, but I won't. I am guessing is done by something like finding internal variables used for caller, causing the variables to change from eval to eval and between being in an eval and not being in an eval. I don't have enough interest to look up the implementation to find that. (If that approach even works.)

        The bonus question looks like something where I either would need to know the internals better or monitor p5p. Since I do neither, I don't know that.

        Let this be a lesson for those who mistakenly thought that I was some form of a perl deity. As I have said all along, I am far from it. Go bug TimToady, TheDamian, chip, etc if you want to see true Perl mastery.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://302597]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.