hello again,
all my c instincts tell me i shouldn't write a function like this:
sub myfunc()    {
        my $aref = [];
        if ( some_cond )        {
                return undef;
        }
        else    {
                #populate @{$aref}
                return $aref;
        }
}
but its cool, right?

i know what i really should do is this:
sub myfunc()    {
        my @array;
        if ( some_cond )        {
                return undef;
        }
        else    {
                #populate @array
                return [ @array ];
        }
}

anyways, second question:  how do i create/invoke a function ref?

i wanna do something like this:
sub myfunc()    {
        #blah blah
}
my $fref = \&myfunc();  # is this right?
&{$fref}($arg1, $arg2);  #is this right?  are there any shortcuts like 
$fref->($arg1, $arg2)?  i know this is the syntax for invoking a method, but 
i don't wanna go thru the hassle of making a class

thanks for the tips,
christopher


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to