]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - lib/Sub/Nary.pm
Allow returning from a scalar assignment
[perl/modules/Sub-Nary.git] / lib / Sub / Nary.pm
index ee5fb6491ca60410c857f3f0d546b35ba0f9a54d..2b9b6719ebbf6c79fef5f7370e0da270166a2a43 100644 (file)
@@ -15,13 +15,13 @@ Sub::Nary - Try to count how many elements a subroutine can return in list conte
 
 =head1 VERSION
 
-Version 0.02
+Version 0.03
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION  = '0.02';
+ $VERSION  = '0.03';
 }
 
 =head1 SYNOPSIS
@@ -448,6 +448,15 @@ sub pp_rv2av {
  $self->inspect($op);
 }
 
+sub pp_sassign {
+ my ($self, $op) = @_;
+
+ my $r = ($self->inspect($op->first))[0];
+
+ my $c = 1 - count $r;
+ return $r, $c ? { 1 => $c } : undef
+}
+
 sub pp_aassign {
  my ($self, $op) = @_;