in reply to i don't know rather take a look below
Not sure if I'm getting you correctly ... I think you should write your subroutine like this
The shift takes the first argument out of @_ and puts it into $aa, the rest of the arguments are passed to MethodCall (and they are still an alias to the original variables, not a copy like in the call $aa->MethodCall(@bb)). I suppose there's a typo in your codesub way { my $aa = shift; $aa->MethodCall(@_); }
#$aa->MethodCall($main::a,$main::c); # should be #$aa->MethodCall($main::b,$main::c); # ^^^
As a side remark, don't use the variables $a and $b as normal variables in a program, they are special to perl (see sort).
-- Hofmator
|
|---|