For Windows in my mind comes a quick trick - command "dir"

A little example:
Code:
use strict;
#define variables
my ($path) = @ARGV;
my $absolutePath; 

#open virtual file -> see dir /?
open(DIR, "dir $path /A:D /S /B|");

#until end of file do something
while(<DIR>){
 if(/STAGING/){
 $absolutePath = $_; #set your needed
...