M
MattM
This should be fairly straightforward, but I'm having trouble openning
a file. I'm modifying a current perl script that seemed to run fine.
I open a file for input, parse it, make some changes to it, create
another file, and write the changes to the new file. I wanted to open
up another file for input, but when I do, it seems to be adding spaces
between each character in the line as its read in. On of the lines of
the file looks something like:
ZZZ223 FP2115
the columns are seperated by a tab. What I get when I run the simple
file openning code is:
Z Z Z 2 2 3 F P 2 1 1 5
I'm trying to put these into a hash table for quick access later in
the program. The code I'm using is pretty simple. It looks like:
open MYFILE,"myfile.txt" or die "Can't open trigger file: $!\n";
while (<MYFILE>) {
chomp;
print STDOUT $_ . "\n";
$lineIn = $_;
($parm,$trigger) = split /\s+/, $lineIn;
$triggers{$parm} .= $trigger;
}
close MYFILE;
But when I run this I get the strange spacing problem. Any Ideas?
Thanks...
a file. I'm modifying a current perl script that seemed to run fine.
I open a file for input, parse it, make some changes to it, create
another file, and write the changes to the new file. I wanted to open
up another file for input, but when I do, it seems to be adding spaces
between each character in the line as its read in. On of the lines of
the file looks something like:
ZZZ223 FP2115
the columns are seperated by a tab. What I get when I run the simple
file openning code is:
Z Z Z 2 2 3 F P 2 1 1 5
I'm trying to put these into a hash table for quick access later in
the program. The code I'm using is pretty simple. It looks like:
open MYFILE,"myfile.txt" or die "Can't open trigger file: $!\n";
while (<MYFILE>) {
chomp;
print STDOUT $_ . "\n";
$lineIn = $_;
($parm,$trigger) = split /\s+/, $lineIn;
$triggers{$parm} .= $trigger;
}
close MYFILE;
But when I run this I get the strange spacing problem. Any Ideas?
Thanks...