drix has asked for the wisdom of the Perl Monks concerning the following question:
If it's second argument is an array ref, td is supposed to iterate over it. So there should be four <td>blah</td>'s here as I'm trying to slice the first four elements of the anonymous array that's being extracted out of the selectall_arrayref statement. So basically this is saving me the trouble of writing print Tr( td({'-align' => 'left'}, [ $_->[0],$_->[1],$_->[2],$_->[3] ] ) ); Lazy, am I? Yes. But there error I'm getting is most frustrating; this bit of code causes Perl to segfault every time. Is slicing a referent list verboten? What's the correct way to do this.foreach (@{$dbh->selectall_arrayref("SELECT * FROM search_atoms WHERE +occurences >= 5 ORDER BY occurences DESC")}) { print Tr( td({'-align' => 'left'}, [ $_->[0 .. 3] ] ) ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Slicing a reference?
by Kanji (Parson) on Apr 05, 2002 at 03:31 UTC | |
|
(crazyinsomniac) Re: Slicing a reference?
by crazyinsomniac (Prior) on Apr 05, 2002 at 03:27 UTC | |
|
Re: Slicing a reference?
by shotgunefx (Parson) on Apr 05, 2002 at 03:35 UTC | |
|
(tye)Re: Slicing a reference?
by tye (Sage) on Apr 05, 2002 at 23:38 UTC |