Re: [Openledger-developer] Perl Question
Brought to you by:
klavs
From: Tony F. <to...@sy...> - 2005-07-29 16:37:56
|
On Fri, 2005-07-29 at 04:21, Ang Tun CHek wrote: > To all > i have some problem with the perl code below: > > @items = $invoice->get_items(); This looks like the get_items() method returns a LIST. > foreach $iv (@items){ > map {print "$_ = $iv->{$_} \n"; } keys %$iv; > print "\n\n"; > } > > > when i simplified the above code to: > > foreach $iv (@{$invoice->get_items()}){ Here your treating the return of get_items() as an ARRAYREF. > map {print "$_ = $iv->{$_} \n"; } keys %$iv; > print "\n\n"; > } > try: foreach $iv ($invoice->get_items()) { map { print "$_ = $iv->{$_} \n" } keys %$iv; print "\n\n"; } -- Tony Fraser to...@sy... Sybaspace Internet Solutions System Administrator phone: (250) 246-5368 fax: (250) 246-5398 |