Gurus,
Is it possible for a subroutine to return both a scalar (an integer,
specifically) *and* a reference to an array of arrays?
Current code returns just the array ref, with the scalar push-ed onto the
end of the referenced array. I'm hoping to get rid of the kludge, and I've
not found much help in the camel (LITWP, maybe?). Here's sample code:
# sub adds a row to the passed array (of arrays) and returns it, along
with incremented counter
sub add_row {
my ($counter, @ary) = @_;
# do stuff to @ary...
# add scalar to @ary:
push( @ary, ++$counter );
return( [EMAIL PROTECTED] );
}
# sample call:
@added_stuff = @{ add_row( $out_count, @added_stuff) };
$out_count = pop( @added_stuff );
I know there's gotta be a cleaner way to do this, but my brain's frozen on
this one.
TIA!
Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
847-914-5150
Adversity is the trial of principle. Without it a man hardly knows whether
he is honest or not. -- Henry Fielding
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs