in reply to Re: Joining and splitting two dimensional arrays
in thread Joining and splitting two dimensional arrays

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!

  • Comment on Re: Re: Joining and splitting two dimensional arrays

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

    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?

        thaw returns a reference to the data structure it creates (just as freeze takes a reference). Only thing I can think of is that the $Pipe->Read() is returning undef. Unfortunately, I haven't used Win32::Pipe and as such am unable to comment on what should be happening. Perhaps a wiser monk would be able to answer.

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