package compute; use strict; use warnings; use MCE::Shared; use base 'Exporter'; our @EXPORT_OK = qw/process $progress/; our $progress = MCE::Shared->scalar( 0 ); my @ARGV = @_; # I know this is dirty but that helps reducing the amount of modifications in compute.pl that uses @ARGV a lot sub process { open INPUT, '<', "@ARGV[9]" or die $!; #here I open the input file open OUTPUT, '>', "@ARGV[10]" or die $!; #here I open the output file STDIN->fdopen( \*INPUT, 'r' ) or die $!; #here I set the input file STDOUT->fdopen( \*OUTPUT, 'w' ) or die $!; #here I set the output file ...do all sort of computation... $progress->set("value_I_need"); } 1; }