Not really the same thing. The Perl version is generally used as an early abort either from a subroutine or a loop.
return if($number > 2);
Is equivalent to: if($number > 2){
return;
}