mlseim
06-24-2003, 08:24 PM
I have a flat file database with "pipes" as my separaters.
With one script, it will read in my customer name with a space like "Bill Smith". $ccustname="Bill Smith"
With another script and a different file, it cuts off the customer name like "Bill" $ccustname="Bill"
I see nothing different with the two datafiles or the two scripts. Why is one getting cut-off between spaces?
This is driving me nuts!
The "pipe" is specified as the SPLIT in both cases. Why is it splitting at the space in one script, but not the other?
The code used in both scripts:
==========================================
open (ORGDB,"<$address_file");
@ODB=<ORGDB> ;
close (ORGDB);
foreach $rec(@ODB){
...more code
chomp($rec);
($ccustemail,$ccustid,$ccustname)=split(/\|/,$rec);
... more code
=======================================
Example Database used:
billsmith@aol.com|bs1234|Bill Smith|
Note the space between "Bill" and "Smith".
It looks the same in both data files.
With one script, it will read in my customer name with a space like "Bill Smith". $ccustname="Bill Smith"
With another script and a different file, it cuts off the customer name like "Bill" $ccustname="Bill"
I see nothing different with the two datafiles or the two scripts. Why is one getting cut-off between spaces?
This is driving me nuts!
The "pipe" is specified as the SPLIT in both cases. Why is it splitting at the space in one script, but not the other?
The code used in both scripts:
==========================================
open (ORGDB,"<$address_file");
@ODB=<ORGDB> ;
close (ORGDB);
foreach $rec(@ODB){
...more code
chomp($rec);
($ccustemail,$ccustid,$ccustname)=split(/\|/,$rec);
... more code
=======================================
Example Database used:
billsmith@aol.com|bs1234|Bill Smith|
Note the space between "Bill" and "Smith".
It looks the same in both data files.