Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: (Golf) Let's go bowling

by abstracts (Hermit)
on Aug 09, 2001 at 18:08 UTC ( #103405=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: (Golf) Let's go bowling
in thread (Golf) Let's go bowling

Hello

I'm using 5.6.2 and got that same error. I fixed it by doing:

@b=@_;@_=@b; # then preceed as usual
I bet the problem is that you are calling the function as
score(qw/X 6 5 7 9 ...../);
instead of:
@arr = qw/X 4 5 6 .../; score(@arr);
Map is modifying the content of the list (using s#...#10#). Passing a list (constant) to the sub makes @_ elements aliases to the values passed. This is just like saying
"helo" =~ s/l/ll/;
which does not make sense.

Did I make myself clear? Does it make sense?

Aziz,,,


Comment on Re: Re: Re: (Golf) Let's go bowling
Re: Re: Re: Re: (Golf) Let's go bowling
by dragonchild (Archbishop) on Aug 09, 2001 at 18:17 UTC
    Yes, you are correct! Wow, I didn't realize that could be an issue, though it makes perfect sense, once it's put into those terms.

    Thanks! :)

    ------
    /me is slowly becoming the brightest bulb in the chandelier! (though others are kW bulbs...)

    Vote paco for President!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-09-02 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (19 votes), past polls