Permalink
Browse files

Make reference check less strict in _new_from_row_or_cols

This was requested by Mark Jason Dominus.
  • Loading branch information...
1 parent 35227a3 commit 7719048176605564feec19e02f290415b32f8ead @leto committed Apr 6, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Math/MatrixReal.pm
View
@@ -9,6 +9,7 @@ package Math::MatrixReal;
use strict;
use Carp;
use Data::Dumper;
+use Scalar::Util qw/reftype/;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
require Exporter;
@@ -258,7 +259,7 @@ sub _new_from_rows_or_cols {
# step back one frame because this private method is not how the user called it
my $caller_subname = (caller(1))[3];
- croak "$caller_subname: need a reference to an array of ${vector_type}s" unless ref($ref_to_vectors) eq 'ARRAY';
+ croak "$caller_subname: need a reference to an array of ${vector_type}s" unless reftype($ref_to_vectors) eq 'ARRAY';
my @vectors = @{$ref_to_vectors};
my $matrix;

0 comments on commit 7719048

Please sign in to comment.