if (defined $paths){ ###do something; print "paths defined"; } else{ #do something else; print "paths not defined"; }