Hi there,
I've been having problems with a Perl script I've been given. It falls over at the following segment:
Code:
open (PRJLISTFILE, "<$ENV{'_TMROOT'}/project/prjlist.txt");
LOOP: while (defined($PrjListLine=<PRJLISTFILE>)){
chomp $PrjListLine;
print STDOUT "$PrjListLine\n";
next LOOP if ($PrjListLine =~ /^\#/);
next LOOP if ($PrjListLine =~ /^\s*$/);
$PrjListLine =~ s/\#.*//g;
$RootLocations = $RootLocations." ".$PrjListLine;
print STDOUT "Current RL: [$RootLocations]\n";
}
print STDOUT $RootLocations;
close PRJLISTFILE;
This should read a list of directory locations and create a list of them in the variable $RootLocations, each delimited by a space. This works fine on Windows, but under Linux it overwrites the first one each time, resulting in a rather munged variable. Any thoughts as to the difference?
I've checked and the textfile looks fine on both, so it's not a CRLF prob. All suggestions gratefully received!
Using ActiveState Perl v5.6.1 on both (originally using 5.8.1 in Linux, so have reverted back to 5.6.1)
Thanks,
Tony