perl学习4--调用子程序

简介: #!/usr/bin/perl -wsub sum_of_fred_and_barney {  print "Hey,you called the sum_of_fred_and_barney subroutine!\n";  $fred+$barney;}$fred=3;$barney=4;$wi...
#!/usr/bin/perl -w
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";
相关文章
|
1月前
|
Perl
|
1月前
|
Perl
|
1月前
|
Perl
|
1月前
|
Perl
|
1月前
|
自然语言处理 Perl
|
1月前
|
Perl
|
1月前
|
自然语言处理 Perl
|
1月前
|
Perl
|
1月前
|
Perl