SPUG: Two errors I need hashing out

Parr, Ryan Ryan.Parr at wwireless.com
Tue Jan 15 14:10:33 CST 2002


Since you enclosed the variable $username in doublequotes Perl will properly
expand it to it's value, so it's not literally looking for the '$username'
directory. Try doing the following:

use CWD;
my $dir = getcwd();
open (FILE,">>$filename") or die "Error opening $dir/$filename: $!";


Ryan Parr



-----Original Message-----
From: Susanne Bullo [mailto:sweetsue at sweethomes.com] 
Sent: Tuesday, January 15, 2002 11:23 AM
To: Seattle Perl User's Group
Subject: RE: SPUG: Two errors I need hashing out


Ok, did the change in the reports mysql insert and changed the open file so
it would indicate if it dies - and it does.  Now I get an error that says
"No such file or directory at sunday line 61".  Here is the part in question
again:

my $query = "SELECT safelists.email_to, safelists.username,
safelists.password, email_txt.email_subject, email_txt.email_text,
safelists.uid, members.email from safelists, schedule, email_txt, members
where email_txt.id = schedule.SUN and schedule.system_name =
safelists.system_name and members.id = safelists.uid and
email_txt.email_subject != ''";

$buffer .= "===> Executing Query: $query\n\n";
my $sth = $dbh->prepare($query);
my $rc  = $sth->execute();

while
(my($email_to,$username,$password,$email_subject,$email_text,$system_name,$u
id,$email) = $sth->fetchrow_array) {

my $url = "http://$email_to?action=Send This
Message&username=$username&password=$password&subject=$email_subject&message
=$email_text";
$email_text =~ s/\\//g;
my $req = HTTP::Request->new(GET=>$url);
my $file_path = "members/data/$username/$system_name/$date3.txt";
my $resp = $ua->request($req, $file_path);
my $sec_file_path = "members/data/$username";
my $outfile = "index.html";
my $filename = "$sec_file_path/$outfile";
open (FILE,">>$filename") or die $!;
{ print FILE "<a href=$sec_file_path>Report on $date3</a><br>"; }

}

Does $sec_file_path need to have a full path?  Or could it be that it's
literally looking for the folder of $username instead of placing the
variable there?

You guys are great and I appreciate the help!

Susanne Bullo - Sweet Homes
<http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=903921&PA=227740>
DirectTV DSL <http://www.ezinfocenter.com/4216180/dsl>
Get Paid to Read Email! <http://www.ezinfocenter.com/4216180/mm>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list