As you do not specify at which line the error occurs, I have to guess. There are two places where you deref a hashref (and thus two hasrefs that could actually be arrayrefs): in the second and third line of your script. The culprits are either $$tmp_string[$SAR_DATA_START] or $rec.$ perl -e '$aryref= [ qw(one two) ];$aryref->{'camel'}='flea-ridden';' Can't coerce array into hash at -e line 1.
As to why this should work on one OS, and not on another - I would have a long hard look at your input data: you are appear to be using sar output, which tends to be OS specific.
As an aside, you might consider refactoring your data structure. It is quite complicated at the moment (I had to use some paper & pencil drawings to figure it out) and you are appear to be using symbolic references, which is usually not a good sign.
Update: Stopped pretending I have psychic powers.
CU
Robartes-
In reply to Re: Can't coerce array into hash at
by robartes
in thread Can't coerce array into hash at
by gspot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |