标签:
sub sum_of_fred_and_barney{ print "Hey,you called the sum_of_fred_and_barney subroutine!\n"; $fred+$barney; } $fred =3; $barney=4; $wilma =&sum_of_fred_and_barney; print "\$wilma is $wilma.\n"; $betty =3*sum_of_fred_and_barney; print"\$betty is $betty.\n";
结果:
Hey,you called the sum_of_fred_and_barney subroutine!
$wilma is 7.
Hey,you called the sum_of_fred_and_barney subroutine!
$betty is 21.
标签:
原文地址:http://www.cnblogs.com/daimakun/p/4698893.html