See File::Spec
#!/usr/bin/perl -w use strict; use File::Spec::Win32; use Data::Dumper; my %h_dirs; while (<DATA>){ chomp; my ($vol, $dirs, $file) = File::Spec::Win32->splitpath($_); $h_dirs{ $dirs }++ unless $file ; } print Dumper \%h_dirs; __DATA__ \windows\server\locales\en_US\help\whxdata\whftdata0.xml \windows\server\locales\en_US\help\whxdata\ \windows\server\locales\en_US\help\whxdata\whfwdata0.xml \windows\server\locales\en_US\help\whxdata\whfwdata1.xml \windows\server\locales\en_US\help\whxdata\whfwdata2.xml \windows\server\locales\en_US\help\whxdata2\
Output: $VAR1 = { '\\windows\\server\\locales\\en_US\\help\\whxdata2\\' => 1, '\\windows\\server\\locales\\en_US\\help\\whxdata\\' => 1 };
hth,
PooLpi
In reply to Re: Reg Exp help
by poolpi
in thread Reg Exp help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |