in reply to size of array from ref

Just use
$size = $#$aref + 1;
Quick, simply, concise, just the way we monks like it.

Tradez
"Never underestimate the predicability of stupidity"
- Bullet Tooth Tony, Snatch (2001)