- or download this
use strict;
use warnings;
...
next unless ( $i and length $dp[$i] );
print File::Spec->catdir( @dp[0 .. $i ] ), qq{\n};
}
- or download this
/var
/var/www
/var/www/vhosts
/var/www/vhosts/testing.com
/var/www/vhosts/testing.com/httpdocs
- or download this
use strict;
use warnings;
...
map{ if (! defined $dq ) { $dq = q{/}; } $dq .= $_ . q{/}; }
grep{ m/.+/; }
@dp ), qq{\n};
- or download this
use strict;
use warnings;
...
map{ File::Spec->catdir( @dp[0 .. $_] ) }
grep{ length $dp[$_]; }
0 .. $#dp ), qq{\n};