Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to check if a directory "$options{data}\\files\\data" existed or not using the below condition?Even if the directory existed,the loop is not entered?where am I going wrong?

if ( -e '$options{data}\\files\\data' ) { #code }

Replies are listed 'Best First'.
Re: Directory check fails
by toolic (Bishop) on Apr 25, 2011 at 03:35 UTC
    Single quotes do not interpolate variable values. Try double quotes instead:
    if ( -e "$options{data}\\files\\data" ) { #code }