problem using -f file operator
- From: "HL" <oded.haim.langford@xxxxxxxxx>
- Date: 27 Dec 2005 01:33:47 -0800
Hello,
I am trying to use the -f operator in the following manner:
# some $item manipulation here
.....
if ( -f $item )
{
unlink($item) || carp "Warning: couldn't remove file:
'$item'\n$!";
carp "Remove File: $item \n" if $debug;
}
elsif ( -d $item )
{
rmtree($item) || carp "Warning: couldn't remove dir:
'$item'\n$!";
carp "Remove Dir: $item \n" if $debug;
}
elsif ( -e $item )
{
unlink($item) || carp "Warning: couldn't remove item:
'$item'\n$!";
carp "Remove Item: $item \n" if $debug;
}
else
{
carp "Ignore Item: $item\n" if $debug;
}
the problem is that for a valid file, full path in $item perl doesn't
enter the: if (-f $item)
and I get the: "Ignore Item" message.
I run perl 5.005_03 on unix,
as I mentioned the file exists, using unix file command on it issues:
commands text
The directory is readable & writable to me.
moreover using: perl -e '$item = "/.....Eth_Stum.eu"; unlink($item);'
works!
can anybody see what's wrong here ?
many thanks,
Oded Haim-Langford
.
- Follow-Ups:
- Re: problem using -f file operator
- From: Paul Lalli
- Re: problem using -f file operator
- Prev by Date: Re: Problem while connecting with Mysql
- Next by Date: read column into array
- Previous by thread: Problem while connecting with Mysql
- Next by thread: Re: problem using -f file operator
- Index(es):
Relevant Pages
|
|