|
Re: Subroutine foo redefined a bar: msg#00388perl-beginners
Dermot wrote: Hi, Hello, I noticed this error appearing when I stop/started my httpd server Which error? Copy and paste the error message you are receiving. This offending code reads a like this: Is @items global? Because you are not declaring it in lexical scope. addItemToBasket($bid, $i); That is very confusing. Why do you have two subroutines with almost identical names and almost identical functionality? addItems expects an array ref, addItem expects a scalar. I'm sure it's wantarray() is used for the return value of a subroutine, not for the arguments a subroutine accepts. or `ref` to see what the 2nd argument is. Why not just pass a scalar and a list? sub addItemsToBasket { my ( $bid, @items ) = @_; I'm a bit nervous of doing that Earlier you said it was an error? And what exactly is it? Is it simply the order in which Are you using parentheses every time you use these subroutines? John -- Those people who think they know everything are a great annoyance to those of us who do. -- Isaac Asimov -- To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx For additional commands, e-mail: beginners-help@xxxxxxxx http://learn.perl.org/
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |