Unfortunately, small is not what this is about.
The two input files: 'tmp/datatest.txt' 1|112|3|21|newtest|1|1296499858|0,10,15,20,25,30,35,40,45,|5,10,15,10,15,25,20,30,20,|
and 'tmp/test.txt'
And the not exactly a small piece of code:
As you can see, it's not exactly straight forward. Line '$y' is read from the tied file @aod, and the $x letter determines the behavior of sub popnum1 which uses the tied array @aob.
But when @aob is tied, I get the error 'Can't use string ("28426980") as an ARRAY ref while in "strict refs" in use at C:\testing\test2.pl line 125 <$fh> line 1.'
But, if I forgo tying @aob, then everything's fine.
| [reply] [d/l] [select] |
Can you please try reducing your code until it becomes small and all the bits unrelated to the problem at hand have been removed?
At first glance at least some of these lines are not related to the problem:
use strict;
#use warnings;
use CGI::Carp; # can go
use List::Util qw(sum); # can go
use Math::Random::MT qw(rand); # can go
#use Math::Random::MT::Auto qw(rand);
use Tie::Array::Packed;
use Tie::File;
Please do invest the effort of reducing your script to a small, self-contained script that still exhibits the problem. | [reply] [d/l] |
I am unable to reproduce the error in my computer. When I run your script I get a DONE!! message.
Which perl version and OS are you using?
Also, could you follow Corion advice trying to reduce the script to something minimal?
| [reply] [d/l] |
| [reply] |