Cymen Vig

Software Craftsman

Shooting Yourself in the Foot with Perl

Returning Multiple Values

1
2
$error, $hash = function_a( ... );
if ( $error ) { error(); }    // never runs

Correction:

1
2
($error, $hash) = function_a( ... );
if ( $error ) { error(); }    // runs on error