in reply to perl and sudo basic question

Based on the output $su->sudo_run is returning a Hash reference and you cannot print the contents of the hash the way you are trying. For debuggin purposes try adding the following:

After use Sudo:

use Data::Dumper;

And then replace your line 15 (print $result) with the following:

print Data::Dumper->Dump([$result],['result']);

That should show you what is in the hash.