Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: AI Overlords

by morgon (Curate)
on Mar 10, 2016 at 00:08 UTC ( #1157236=note: print w/replies, xml ) Need Help??


in reply to AI Overlords

My perl tells me:
No such class new at poem line 20, near "To our new" syntax error at poem line 20, near "To our new" Execution of poem aborted due to compilation errors.
So amazingly only the last line actually produces an error, but nevertheless I'd say that is enough to disqualify it as Perl poetry (even though I also welcome Alphago's first win today).

Replies are listed 'Best First'.
Re^2: AI Overlords
by hippo (Abbot) on Mar 10, 2016 at 00:17 UTC
    So amazingly only the last line actually produces an error

    Without semicolons this is all just one statement. The single statement has a lot of commas which IIRC are evaluated from right to left and therefore the last line of the prose is the first phrase that perl will actually try to parse in any detail.

      I was surprised that it would not bail out at the full-stops.

      Is there any way to see how perl attempts to parse a script that eventually turns out not to be valid (B::Deparse will not help then I suppose...)

        I was surprised that it would not bail out at the full-stops.

        The full stop is the concatenation operator. This is valid perl:

        $ perl -ce 'a . b;' -e syntax OK

        If your only punctuation is the full stop and the comma you can get away with most things. Just avoid reserved words near punctuation.

        $ perl -ce 'Twas brillig, and the slithy toves Did gyre and gimble in +the wabe; All mimsy were the borogoves, And the mome raths outgrabe' -e syntax OK

        Of course, you couldn't end that with a full stop because it's a binary operator. HTH

Re^2: AI Overlords
by Anonymous Monk on Mar 10, 2016 at 01:05 UTC

    enough to disqualify it as Perl poetry

    Just imagine an __END__ at the top of the poem, and its valid perl --- now imagine having to actually write the __END__ as part of the poem is silly

      Ah right.

      Implicitly assuming an __END__ at the beginning of a poem creates a whole new world of poetry.

      So eg the whole quran is in reality just one big perl poem.

        Oh yes! But then imagine all the poems with an implicit __DATA__ at the beginning.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1157236]
help
Chatterbox?
[M4ver1k]: pass*

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-11-20 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (283 votes). Check out past polls.

    Notices?