those "." and ".." directories

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Ok, I know most of us have seen them, and a majority of you probably know what they are for. Well I have no idea, and truthfully I don't want to know. I just don't want my script to show them. So kinda of search perimeter can I use to exclude these from from the directory list?

I have tried :

if ($item =~ m/./)

But that don't work, it seems to match every folder in the directory.

Any other ideas would be helpful.

VulKen
Nothing Witty To Say

Pimpin like a pimp with an electrofied pimpin machine!

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Nevermind I figured out a way to accomplish this. I just put all the folders in an array, sorted them and then shifted the first two elements out of it. (. & ..).

But thanks for looking!
VulKen
Balls To The Wall Baby

Pimpin like a pimp with an electrofied pimpin machine!

They have: 568 posts

Joined: Nov 1999

if ($item =~ m/\./)

They have: 62 posts

Joined: May 2000

Hahaha, I bet your pissed to missed that Vulken! Hehehehe...

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Actually I think I tried that too. It excluded all of the folders.

VulKen
But I'm always Pissed

They have: 568 posts

Joined: Nov 1999

try to use eq instead of a regular expression

i tried to do the same thing a while ago and i think that worked.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.