in reply to array inside a hash

$java{"aaa"}=@output;
No, I think you want:
$java{"aaa"} = [@output];
Unless you're already running Perl 6. {grin}

-- Randal L. Schwartz, Perl hacker