... 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
In reply to Re^3: Read bzip2 directly into array
by Happy-the-monk
in thread Read bzip2 directly into array
by prescott2006
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |