in reply to Re^5: Use reference for functions in functions
in thread Use reference for functions in functions
What I was doing was:
func.pl
sub adding ($$) { my $first=shift; my $second=shift; my $third=($first + $second); print("$first + $second = $third\n"); } sub adding ($$$) { my $first=shift; my $second=shift; my $third=shift; print("$first + $second = $third\n"); } 1;
#!/usr/bin/perl use strict; require "func.pl"; my $one = 1; my $two = 2; my $answer = ( $one + $two); adding($one,$two);
#!/usr/bin/perl use strict; require "func.pl"; my $one = 1; my $two = 2; my $answer = ( $one + $two); adding($one,$two,$answer);
Seems I have a lot to refresh after 3 years of not coding.
|
|---|