Subject: | Can't use string ("0") as an ARRAY ref while "strict refs" in use at lib/Text/ProcessMap.pm line 251. |
Date: | Mon, 03 Jun 2013 17:23:11 +0200 |
To: | bug-Text-ProcessMap [...] rt.cpan.org |
From: | Ailin Nemui <ailin.nemui [...] gmail.com> |
Here is a fix that appears to work:
diff -pru Text-ProcessMap-0.01/lib/Text/ProcessMap.pm Text-ProcessMap-0.02/lib/Text/ProcessMap.pm
--- Text-ProcessMap-0.01/lib/Text/ProcessMap.pm 2005-03-02 05:10:35.000000000 +0100
+++ Text-ProcessMap-0.02/lib/Text/ProcessMap.pm 2013-06-03 17:21:11.151683040 +0200
@@ -244,11 +244,11 @@ sub _build_body {
my $numcols = $#{$self->{_mlayout}};
# using stack layout
if ( $self->{_layout} eq 'stack' )
{
for my $col ( 0 .. $numcols )
{
- my $numrows = $#{ @{ $self->{_mlayout}[$col] } };
+ my $numrows = $#{ $self->{_mlayout}[$col] };
for my $row ( 1 .. $numrows )
{
if ( defined @{ $self->{_mlayout}[$col] }[$row] )
@@ -266,7 +267,7 @@ sub _build_body {
# determine row heights and save to mheight array
for my $col ( 0 .. $numcols )
{
- my $numrows = $#{ @{ $self->{_mlayout}[$col] } };
+ my $numrows = $#{ $self->{_mlayout}[$col] };
for my $row ( 1 .. $numrows )
{
if ( !defined @{ $self->{_mheight} }[$row] )
@@ -291,7 +292,7 @@ sub _build_body {
# create blank column objects
for my $col ( 0 .. $numcols )
{
- my $numrows = $#{ @{ $self->{_mlayout}[$col] } };
+ my $numrows = $#{ $self->{_mlayout}[$col] };
for my $row ( 1 .. $numrows )
{
if ( !defined @{ $self->{_mlayout}[$col] }[$row] )
@@ -324,7 +325,7 @@ sub _build_body {
# output column objects
for my $col ( 0 .. $numcols )
{
- my $numrows = $#{ @{ $self->{_mlayout}[$col] } };
+ my $numrows = $#{ $self->{_mlayout}[$col] };
for my $row ( 1 .. $numrows )
{
if ( defined @{ $self->{_mlayout}[$col] }[$row] )
diff -pru Text-ProcessMap-0.01/t/01_test.t Text-ProcessMap-0.02/t/01_test.t
--- Text-ProcessMap-0.01/t/01_test.t 2005-03-01 16:50:50.000000000 +0100
+++ Text-ProcessMap-0.02/t/01_test.t 2013-06-03 17:18:49.836273261 +0200
@@ -39,9 +39,9 @@ sub run_test
# remove platform dependencies
my $tfile = read_file($t . '.txt');
- $tfile =~ s/\n//g;
+ $tfile =~ s/\r?\n?/X/g;
my $bfile = read_file($t . '.base');
- $bfile =~ s/\n//g;
+ $bfile =~ s/\r?\n?/X/g;
my $tsig = md5_hex($tfile); # test file signature
my $bsig = md5_hex($bfile); # base file signature
diff -pru Text-ProcessMap-0.01/t/02_test.t Text-ProcessMap-0.02/t/02_test.t
--- Text-ProcessMap-0.01/t/02_test.t 2005-03-02 02:43:00.000000000 +0100
+++ Text-ProcessMap-0.02/t/02_test.t 2013-06-03 17:17:57.347749486 +0200
@@ -27,9 +27,9 @@ sub run_test
# remove platform dependencies
my $tfile = read_file($t . '.txt');
- $tfile =~ s/\n//g;
+ $tfile =~ s/\r?\n?/X/g;
my $bfile = read_file($t . '.base');
- $bfile =~ s/\n//g;
+ $bfile =~ s/\r?\n?/X/g;
my $tsig = md5_hex($tfile); # test file signature
my $bsig = md5_hex($bfile); # base file signature