SPUG: Two errors I need hashing out
David Dyck
dcd at tc.fluke.com
Tue Jan 15 12:04:06 CST 2002
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,$uid,$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