in reply to Tie::File and Tie::Array::Packed;

Could you post some code showing the problem?

(BTW, I am the author of Tie::Array::Packed)

Replies are listed 'Best First'.
Re^2: Tie::File and Tie::Array::Packed;
by Dandello (Monk) on Feb 01, 2011 at 16:42 UTC

    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.

      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.

      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?

        Win XP, ActivePerl 5.8.9 (I should probably upgrade that.) The Tie::File and Tie::Array::Packed modules are from that distribution.