Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Read bzip2 directly into array

by Happy-the-monk (Monsignor)
on Apr 03, 2012 at 11:45 UTC ( #963221=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Read bzip2 directly into array
in thread Read bzip2 directly into array

... if (/good(.*)/)

This is much better.
Although $buffer now contains:

$VAR1 = \[ \'goodmorning goodbye goodafternoon ' ];

So although there's your array, it only contains scalar value referenced inside. I think that's not the behaviour you expected from the IO::Uncompress::Bunzip2 documentation talking about arrays.
There it says:

If $output is an array reference, the uncompressed data will be pushed onto the array.

That is, all of the bunzipped data is pushed onto the array, so you can fill your array with data from several bunzipped files.

Change the matching to if ($$_ =~ /good(.*)/) to make your code output the value.

If you also want to break the result into a list, use split to do that.

Cheers, Sören


Comment on Re^3: Read bzip2 directly into array
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-08-29 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls