Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script fail - I think it is the @ in the email address.

Status
Not open for further replies.

cxw

Programmer
Joined
Aug 17, 2007
Messages
20
Location
US
OK I forgot to say that the email address comes in a CVS file and so i get it in a var.
It would look somthing like this:
# open file
open (TXTFILE, "c:/SOARimports/NU_AD2032_ILINC_EXTRACT_stf.csv") or die("Unable to open file");;
@lines = <TXTFILE>;

# read file into an array
foreach $data(@lines) {
#print "$data <BR>";
#loop through file putting users in array here
# split the line of text by comma
my @values = split(',', $data);

# put the line into an array
my($NUuserID,$Lname,$Fname,$Email) = @values;
chomp($NUUserName);
chomp($NUuserID);
chomp($Email);

#Then here I will need to find the user by email address:
my @rs = &getSQL("LMS_USER","USER_NAME,EMAIL,USER_ID","EMAIL='$Email'");

Only I get an script will not run error.
I think it is the @ in the email address.



 
Sorry, started new thread by mistake.
 
what was the error you were getting; also are you using strict and warnings pargmas? @ might very well be the culprit here.
 
There is no way to tell since we can't see the data, have no idea whee the error is being generated from and you posted only a small portion of the code. There is no perl error: "script will not run error" that I am aware of. What is the real error?

In general, an @ or $ symbol imported from a text file is treated lke single-quoted string and would be no problem in a perl script unless being run through a regexp.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top