On Mon, Mar 17, 2008 at 7:12 AM, <[EMAIL PROTECTED]> wrote:
> Are subs always return references or only for anonymous lists/hashes?
perldoc perlsub
"The Perl model for function call and return values is simple: all
functions are passed as parameters one single flat list of scalars,
and all funct
On 16 Mar, 18:30, [EMAIL PROTECTED] (Yitzle) wrote:
> On Sun, Mar 16, 2008 at 12:54 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> > >> push @records, %record
> > > I think you want an array of references, not of hashed themselves.
>
> > Actually, the hash is converted to a list and that list
On Sun, Mar 16, 2008 at 12:54 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
> >> push @records, %record
> > I think you want an array of references, not of hashed themselves.
>
> Actually, the hash is converted to a list and that list is pushed onto
> the array.
>
>
> John
Darn! I tested it us
yitzle wrote:
Always start your code with:
use warnings;
use strict;
my %record = r();
This line won't work. r() returns a reference (think pointer if you
used C) to a hash. You need a scalar to store it.
$record = r();
Or dereference the reference returned from the sub:
my %record = %{ r()
Always start your code with:
use warnings;
use strict;
> my %record = r();
This line won't work. r() returns a reference (think pointer if you
used C) to a hash. You need a scalar to store it.
$record = r();
> $record{fieldA}{fieldB} = value...
This requires a hash, unlike the above line that use