Gossamer Forum
Home : General : Perl Programming :

Unable to open error

Quote Reply
Unable to open error
Code:
---------------------------------------------------------------------------

srand(time|$$);

$random_number = int(rand(10000000));

$temp_file = $data_directory . "ureserve" . $random_number . ".tmp";

if (!(open(TEMP_DATA_FILE, ">" . $temp_file)))

{

&return_error("File Error","Unable to open " . $temp_file);

}

--------------------------------------------

getting error on the open statement, not able to understand..pls anyone can help me to resolve it.

Thanks in Advance,

OAUser.
Quote Reply
Re: [oauser] Unable to open error In reply to
Before your &return_error line, add
Code:
print "Error: $!";
to get some information about the error.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [oauser] Unable to open error In reply to
Why not just use something like;

open(TEMP_DATA_FILE, ">$temp_file") || &return_error("File Error","Unable to open " . $temp_file . ". Reason $!");

Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates