#!/usr/bin/perl use strict; require 'include.pl'; sub localAdd($$); #sub remoteAdd($$); # Is this required? my $i; $i = localAdd 1, 2; #$i = localAdd 1, 2, 3; # error: "Too many arguments for main:localAdd at test.pl line 9, near "3;" print "i = $i\n"; #$i = remoteAdd 1, 2; # error: "Number found where operator expected at test.pl line 15, near "remoteAdd 1" (Do you need to predeclare remoteAdd?) #$i = remoteAdd 1, 2, 3; #print "i = $i\n"; $i = remoteAdd(1, 2); $i = remoteAdd(1, 2, 3); # prototype in include.pl is not honored print "i = $i\n"; sub localAdd($$) { my ($i, $j) = @_; return $i + $j; } #### sub remoteAdd($$); # This appears to have no effect across files... sub remoteAdd($$) { # die "incorrect #arguments in remoteAdd" unless @_ == 2; my ($i, $j) = @_; return $i + $j; } 1;