does it only return one line?
Code:
sub ReadFile {
$inputfilename = "$ENV{'PCRESCRIPT'}/config/effectivedate";
open( INFILE, "< $inputfilename" ) or die "Can't open $inputfilename : $!";
while( <INFILE> )
{
chomp;
$line = $_;
$line=~ s/\///g;
}
close (INFILE);
return "$line\n";
}
}
1;#<-- need this at the end routinefile.pl
this line:
$PCREDATE=ReadFile($datval);
should just be:
$PCREDATE=ReadFile();
because you are not passing $datval to the sub routine, only getting a value back.