sub foo { open F, ... or return( [ -1, "error opening file" ] ); return( [ 0, $result ] ); } my( $code, $string ) = foo();