Commits

Toby Inkster committed 43cf722

Perl < 5.14 fix

  • Participants
  • Parent commits 00f58c4
  • Tags 0.002

Comments (0)

Files changed (3)

File lib/List/AssignRef.pm

 
 BEGIN {
 	$List::AssignRef::AUTHORITY = 'cpan:TOBYINK';
-	$List::AssignRef::VERSION   = '0.001';
+	$List::AssignRef::VERSION   = '0.002';
 }
 
 use Sub::Exporter -setup => {
 
 	use List::AssignRef deref => { -as => 'dereference' };
 
+=head1 LEGACY PERL SUPPORT
+
+The examples above rely on a parsing improvement in Perl 5.14. Although this
+module does support earlier versions of Perl (5.6 and above), prior to 5.14
+you may need to add additional parentheses:
+
+	(deref(my @staff), deref(my @managers))
+		= part { $_->title =~ /Manager/ } @employees;
+
 =head1 BUGS
 
 Please report any bugs to

File meta/changes.pret

 	issued  2012-11-01;
 	label   "Initial release".
 
+`List-AssignRef 0.002 cpan:TOBYINK`
+	issued  2012-11-05;
+	label   "threescore barrels of powder below";
+	changeset [
+		item "Note extra parentheses required in legacy Perl."^^Documentation;
+		item "Parenthetical test suite fixes for legacy Perl."^^Packaging;
+	].
 use List::AssignRef;
 use List::MoreUtils qw( part );
 
-deref my @input = [qw(
+deref(my @input) = [qw(
 	Ape
 	Bear
 	Bunny
 	Badger
 )];
 
-(deref my @A, deref my @B) = part { !!/^B/ } sort @input;
+(deref(my @A), deref(my @B)) = part { !!/^B/ } sort @input;
 
 is_deeply(
 	\@A,
 	[qw( Badger Bear Bison Bunny )],
 );
 
-deref my %H = +{ foo => 1, bar => 2 };
+deref(my %H) = +{ foo => 1, bar => 2 };
 is_deeply(
 	\%H,
 	+{ foo => 1, bar => 2 },
 );
 
 
-deref my $S = \"Hello World";
+deref(my $S) = \"Hello World";
 is(
 	$S,
 	"Hello World",
 );
 
 ok not eval {
-	deref my %H2 = [];
+	deref(my %H2) = [];
 };