in reply to Problem printing return value from a subroutine
induced() returns a list flattened from an array. my $qw=induced(@{ $subgraphs[$d-1] }); evaluates that return value in scalar context. If you want to return a scalar, you should join the elements of the array. If you want to return a list, you need to capture it as an array or something which provides list context.
Improve your skills with Modern Perl: the free book.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Problem printing return value from a subroutine
by zing (Beadle) on Oct 04, 2012 at 08:10 UTC |
In Section
Seekers of Perl Wisdom