note
beable
Why not just place your subs whereever you like, call them from whereever you like without & and with (), and not use forward declarations either? What am I missing? Perl isn't C. This seems to work for me:
<readmore>
<code>
#!/usr/bin/perl
use strict;
use warnings;
aaa("Hello world");
sub aaa
{
my $arg = shift;
my $quit = shift;
print("I am aaa, arg = $arg\n");
exit 0 if ($quit);
bbb("hello bbb");
}
sub bbb
{
my $arg = shift;
print("I am bbb, arg = $arg\n");
ccc("hello ccc");
}
sub ccc
{
my $arg = shift;
print("I am ccc, arg = $arg\n");
aaa("hello aaa", 42);
}
__END__
</code>
</readmore>
381112
381122