in reply to Re: Re: Golf: overtone calculator
in thread Golf: overtone calculator
Putting in scalars (i.e. ($$)) is asking for trouble since it converts any arrays to scalars automatically. I found this really quite worrying, and you can see my brief rant in Function Prototypes and Array vs. List (Pt. 2).sub my_grep(&) { ... } sub my_pop(\@) { ... }
Now, if you've prototyped your function, you're going to get the number 3 every time. This is put in to the 'id' field, so you might actually think it's valid data, too.my $sth = $dbh->prepare("SELECT id,name,age FROM foo"); $sth->execute(); while (my $row = $sth->fetchrow()) { $self->some_function(@$row); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re^3: Golf: overtone calculator
by theorbtwo (Prior) on Sep 02, 2002 at 23:55 UTC | |
by BrowserUk (Patriarch) on Sep 03, 2002 at 00:17 UTC | |
by tadman (Prior) on Sep 03, 2002 at 05:35 UTC |