How to return an error message or a value
Courtesy of Michael Mathews
Copy this code and paste it in your HTML
sub one {
my $result = two();
if (ref $result eq 'ERROR') { }
else {
}
}
sub two {
return bless {message
=>"There is a problem here."}, 'ERROR'; }
}
Report this snippet
Comments
Subscribe to comments