in reply to Difference between subroutine and functions
The way I always explain it: CODE objects are declared as subroutines, but used either as functions or methods. Or even both, if you want to confuse people (CGI.pm does, apparantly):
sub foo { print @_ } foo "Hello "; # function - prints "Hello " main->foo("!"); # method - prints "main!"
You cannot call a subroutine except as a function or a method.
Nor can you write a function or method, except as a subroutine.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|