sub flatten {
my $proto = shift;
return @_ unless defined $proto;
- my @args;
+ my @args;
while ($proto =~ /(\\?)(\[[^\]]+\]|[^\];])/g) {
my $p = $2;
if ($1) {
Specifies the function used in the generated code to test the reference type of scalars.
Defaults to C<'ref'>.
-You may also want to use C<Scalar::Util::reftype>.
+You may also want to use L<Scalar::Util/reftype>.
=item C<< wrong_ref => $code >>
my $cur = '$_[' . $i . ']';
if ($ref) {
if (length $p > 1) {
- return 'my $r = ' . $opts->{ref} . '(' . $cur . '); '
+ return 'my $r = ' . $opts->{ref} . '(' . $cur . '); '
. join ' els',
map( {
"if (\$r eq '" . $reftypes{$_} ."') { "
=head1 COPYRIGHT & LICENSE
-Copyright 2008-2009 Vincent Pit, all rights reserved.
+Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.