There's a "return" statement in nearly every procedural programming language supporting subroutines. It causes a subroutine to be stopped and to return a certain value to the caller.
sub foo { return 1 };
$var = foo(); #$var is 1
sub bar {
print "AAA";
return 1;
print "BBB"; #will never happen, for 'return' has
# stopped this sub
}
$var = bar();
The breaking character of return is not present in all languages, i know ugly Pascal doesn't have a return statement and you cannot exit a sub from the middle.
These are the very basics, try a good book to start!
--
http://
fruiture.de