Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: using perl 6 book trying first example

by snoopy (Deacon)
on Sep 08, 2010 at 05:58 UTC ( #859265=note: print w/ replies, xml ) Need Help??


in reply to using perl 6 book trying first example

Hi Dana,

I've managed to run your example script on both the latest rakudo built from git, plus rakudo star 2010.07.

I do notice however, that as soon as I put a blank line anywhere in the input file, I get the same error message as you:

Beth Ana Charlie Dave Ana vs Dave | 3:0 Charlie vs Beth | 3:1 Ana vs Beth | 2:3 Dave vs Charlie | 3:0 Ana vs Charlie | 3:1 Beth vs Dave | 0:3
Produces:
snoopy@snoopy-laptop:~/git/rakudo$ ./perl6 /tmp/score.p6 Method 'split' not found for invocant of class '' in <anon> at line 12:/tmp/score.p6 in main program body at line 1
So I think it's got something to do with the input data or the line separators. Maybe the cut-and-paste introduced something?


Comment on Re: using perl 6 book trying first example
Select or Download Code
Replies are listed 'Best First'.
Re^2: using perl 6 book trying first example
by reedx032 (Acolyte) on Sep 08, 2010 at 06:18 UTC
    Thank you! There was a blank line at the end of my input file. I guess when the program tries to split the blank line, it leaves $result with no value. (undef?) That non-existent object has no split method I guess. Back to learning stuff...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (16)
As of 2015-07-07 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (92 votes), past polls