Re: problem using -f file operator
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 27 Dec 2005 13:25:27 -0800
HL wrote:
> Hello,
>
> I am trying to use the -f operator in the following manner:
>
> # some $item manipulation here
That's rather vague. Why not simply tell us what $item contains?
> ....
> 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.
That's not the whole message, though. Your carp'ed message above
includes the value of $item. Please copy and paste the entire error
message. Does that value of $item correspond to what you think it
should be?
>
> 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!
You have a file in your root directory whose name begins with 6
periods? I find that just a bit unlikely.
> can anybody see what's wrong here ?
No, because you haven't shown us everything we should see.
Paul Lalli
.
- Follow-Ups:
- Re: problem using -f file operator
- From: HL
- Re: problem using -f file operator
- References:
- problem using -f file operator
- From: HL
- problem using -f file operator
- Prev by Date: Re: [PATCH] Test that constant overloading is propagated into eval
- Next by Date: Digest::MD5 issues
- Previous by thread: problem using -f file operator
- Next by thread: Re: problem using -f file operator
- Index(es):
Relevant Pages
|