Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STILL CAN'T DELETE TEMP FILE IN PERL! HELP!! 1

Status
Not open for further replies.

mheilbut

Programmer
Apr 24, 2002
53
BR
Hi! I create a temp file in perl as follows:

$exit = system("/usr/progs/pedrep.pl $repre $data $datb >/tmp/".$repre."pedrep1.html");

Then I send it by e-mail:

$exit = system("metasend -b -t $email -s 'Pedidos' -f /tmp/".$repre."pedrep1.html -m text/html -S 500$

After this statement, I want to put a command to delete my temp file so I don't have to delete it everytime.
People gave me good ideas yesterday but they didn't work.
Any help would be great! Thanks! Michel, São Paulo, Brazil
 
Try defining a variable for the filename you create and unlink this same variable. Like this:

$out = "/tmp/.${repre}.pedrep1.html";
$exit = system("/usr/progs/pedrep.pl $repre $data $datb > $out);
$exit = system("metasend -b -t $email -s 'Pedidos' -f $out -m text/html -S 500");
unlink($out);
 
I do exactly that and it gives me no error message, but it doesn't delete it from the tmp directory. I really don't know what to do.
Any other ideas?
Thanks Michel, São Paulo, Brazil
 
IT WORKED!
I inserted an extra " " on the repres and it worked thanks a bunch!! Michel, São Paulo, Brazil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top