caciqueman has asked for the wisdom of the Perl Monks concerning the following question:
the script starts like this, after the shebang
Can anyone tell me where I am going wrong ??$datafile = "/web/home/data/userpass.dat"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $FORM{$name} = $value; } $string = $FORM{'mail'}; open(INF,$datafile); @mydata = <INF>; close(INF); $count = 0; foreach $i (@mydata) { chomp($i); ($user,$pass,$email) = split(/\|/,$i); if (uc($email) eq uc($string)) { open (MAIL, "| $sendmail -t") || die "I can't open sendmail\n"; print MAIL "To: $email\n"; print MAIL "From: $myemail\n"; print MAIL "Subject: The passwords\n"; print MAIL "\n"; print MAIL "Here are the passwords you asked for:\n"; print MAIL "\n"; print MAIL "Field 1: $user\n"; print MAIL "Field 2: $pass\n"; print MAIL "Field 3: $email\n"; print MAIL "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Lost acolyte
by Ovid (Cardinal) on Aug 25, 2001 at 03:11 UTC | |
|
Re: Lost acolyte
by Zaxo (Archbishop) on Aug 25, 2001 at 03:20 UTC | |
|
Re: Lost acolyte
by rchiav (Deacon) on Aug 25, 2001 at 03:07 UTC | |
|
Re: Lost acolyte, splitting fields out of flat-file database
by greywolf (Priest) on Aug 25, 2001 at 20:40 UTC |