in reply to Joining and splitting two dimensional arrays

What about a serializer such as Storable or YAML?

  • Comment on Re: Joining and splitting two dimensional arrays

Replies are listed 'Best First'.
Re: Re: Joining and splitting two dimensional arrays
by bfish (Novice) on Aug 06, 2003 at 18:23 UTC

    Storable seems to just put things into a disk file, or am I missing something? I don't want to use disk if I can avoid it.

    I'm not sure how I could use YAML. I looked at the link, but it isn't clear to me exactly how it works. Is there a way to convert a standard array into YAML and then send it through the pipe? Would the pipe see the YAML type as a string type? If so, how?

    Thanks!

      From the Storable documentation:

      use Storable qw(freeze thaw); # Serializing to memory $serialized = freeze \%table; %table_clone = %{ thaw($serialized) };

      Hope this helps.

      antirice    
      The first rule of Perl club is - use Perl
      The
      ith rule of Perl club is - follow rule i - 1 for i > 1

        Thank you! This worked when I resized the Pipe buffer large enough to contain the array!!!

        Thanks!--Problems remain.

        I tried the freeze/thaw cycle, but I got the error "Can't use an undefined value as an ARRAY reference" when trying to thaw. The code is below:

        use Storable qw(freeze thaw); my @Array={}; @Array = @{ thaw( $Pipe->Read() ) );

        Any further ideas?