|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Problem printing return value from a subroutineby chromatic (Archbishop) |
| on Oct 04, 2012 at 03:58 UTC ( #997173=note: print w/ replies, xml ) | Need Help?? |
|
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.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||