in reply to Complex string parsing
What tells you that a line corresponds to a directory? The fact that it has a slash on the end of it? Here's a regular expression that will match such entries:
$line =~m#/$#;
But if you have such a marker of directories already, I'm not sure why you'd need to do what you're doing. If the existence and absence of a trailing slash isn't a reliable indicator of what's a directory (or even if you can't *assume* they are), then you'll have to go to the filesystem and use the -d filetest (see this node for more info on filetest operators).
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Complex string parsing
by Anonymous Monk on Apr 25, 2001 at 05:34 UTC | |
by jeroenes (Priest) on Apr 25, 2001 at 15:59 UTC |