stoney79
January 13th, 2005, 02:18 PM
Hi guys,
I'm new here so apologies if I've picked the wrong forum. The Programming forum pointed me here, since I've a question about Perl so I hope this is the right spot ;)
Ok... I've received a Perl script that works fine on Win2k running under ActiveState Perl 5.6.1 that I want to run under Linux (again, ActiveState Perl 5.6.1). Except, the script falls over. Here's the chunk of code:
open (PRJLISTFILE,"<$ENV{'_TMROOT'}/project/prjlist.txt")
LOOP: while (defined($PrjListLine=<PRJLISTFILE>)){
chomp $PrjListLine;
next LOOP if ($PrjListLine =~ /^\#/);
next LOOP if ($PrjListLine =~ /^\s*$/);
$PrjListLine =~ s/\#.*//g;
$RootLocations = $RootLocations." ".$PrjListLine;
}
#print STDOUT $RootLocations;
close PRJLISTFILE;
When running on the Windows PC it works fine, with $RootLocations looking something like this:
$ROOT/peripherals $ROOT/audio $ROOT/graphics
while on Linux, all the values are munged to something like this:
$ROOT/graphicsals
So, graphics has overwritten peripherals. Any idea what would be causing this? I've drawn a complete blank other than a bug in Perl. I've also tried it with ActiveState Perl 5.8.1 as well with the same results.
Any help would be really appreciated so thanks in advance guys (and/or girls)!
Tony
I'm new here so apologies if I've picked the wrong forum. The Programming forum pointed me here, since I've a question about Perl so I hope this is the right spot ;)
Ok... I've received a Perl script that works fine on Win2k running under ActiveState Perl 5.6.1 that I want to run under Linux (again, ActiveState Perl 5.6.1). Except, the script falls over. Here's the chunk of code:
open (PRJLISTFILE,"<$ENV{'_TMROOT'}/project/prjlist.txt")
LOOP: while (defined($PrjListLine=<PRJLISTFILE>)){
chomp $PrjListLine;
next LOOP if ($PrjListLine =~ /^\#/);
next LOOP if ($PrjListLine =~ /^\s*$/);
$PrjListLine =~ s/\#.*//g;
$RootLocations = $RootLocations." ".$PrjListLine;
}
#print STDOUT $RootLocations;
close PRJLISTFILE;
When running on the Windows PC it works fine, with $RootLocations looking something like this:
$ROOT/peripherals $ROOT/audio $ROOT/graphics
while on Linux, all the values are munged to something like this:
$ROOT/graphicsals
So, graphics has overwritten peripherals. Any idea what would be causing this? I've drawn a complete blank other than a bug in Perl. I've also tried it with ActiveState Perl 5.8.1 as well with the same results.
Any help would be really appreciated so thanks in advance guys (and/or girls)!
Tony