SPUG: Two errors I need hashing out

Susanne Bullo sweetsue at sweethomes.com
Tue Jan 15 12:26:56 CST 2002


Yes, actually I do intend that - the username to log in is just for the
database.  Then there are several users within that database so $username
would have to be overwritten for each one.

How do I go about checking the return result on my open()?

Thanks for helping me out!

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>


-----Original Message-----
From: David Dyck [mailto:dcd at tc.fluke.com]
Sent: Tuesday, January 15, 2002 10:04 AM
To: Susanne Bullo
Cc: Seattle Perl User's Group
Subject: Re: SPUG: Two errors I need hashing out


On Tue, 15 Jan 2002 at 09:25 -0800, Susanne Bullo
<sweetsue at sweethomes.com>...:

> print on closed filehandle main::FILE at sunday line 61.

> my $username = 'admin';

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

> my $sec_file_path = "members/data/$username";
> my $outfile = "index.html";
> my $filename = "$sec_file_path/$outfile";
> open (FILE,">>$filename");
> Line 61 -->{ print FILE "<a href=$sec_file_path>Problem on $date3</a>"; }

First, did you intend to erase $username = 'admin'
with the username you get from fetchrow_array?

next, you should always check the return result from open()

most likely the relative directory path does not
exist in the drectory your are currently running in,
so the open fails...


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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