how can I use a subroutine in a required file, when the subroutien has to get variables:
file.pl:
...
sub func{
my ($var) = @_;
..
}
main.pl:
..
require "file.pl";
func(1);
..
this is not working for me, I'm getting an error says Undefined subroutine &main::func
..