[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Deleting a file



Hi all you gurus

I have a small problem. I don't seem to be able to use this to
delete a file:

---------- Code fragment ----------------------
use CGI qw(:all);

$query = new CGI;

$dir = '::blab:foo:bar';
.
.
<SNIP unimportant stuff>
.
.
if($query->param('Slettes') eq ' Ja ')
{
    $filen = $query->param('Filnavn');
    $pic   = $dir.":".$filen; 
    ## if I print $pic it contains the right path and filename

    ## I can't find out if it is the open(), unlink or $pic
    ## that is the problem.
    open(TFH, $pic);
    unlink TFH;
    close(TFH);
.
.
<SNIP unimportant stuff>
.
.
}
---------- Code fragment ----------------------
Can anybody help with this ? - Just a pointer in the right
direction will be very appreciated.

-- 
************************************************************
* Lars G. Skjellerup                                       *
* Web designer/Programmer - Software Tester                * 
*                                                          *
* Silkeborg Bibliotek  Phone:  (+45) 86820233 ext. 380     *
* Hostrupsgade 41 A    Fax:    (+45) 86802679              * 
* DK 8600 Silkeborg    E-mail: stenone@silkeborg.bib.dk    *
* Denmark                      stenone@netscape.net        *
*                              stenone@hotmail.com         *
*                              stenone@yahoo.com           *
*                              stenone@forum.dk            *
*                                                          *
*                      URL:    http://www.silkeborg.bib.dk * 
************************************************************

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org