in reply to Re: Re: Happy fun regexping
in thread Help needed with reducing function to a single regex
Do not attempt to remove the . and .. entries with a regexp, because you will no doubt get it wrong, and cheaper alternatives exist. A reasonable way to get rid of them is:
next if $_ eq '.' or $_ eq '..'An even more reasonable way is to isolate yourself from cross-platform diffences by using File::Spec.
next if $_ eq File::Spec::curdir or $_ eq File::Spec::updirSee Re: Is readdir ever deterministic? for the canonical question and answer on the subject.
|
|---|