Chien-Lung Wu wrote: > Hi, > > In the bash, I can test a file or a directory by following: > > if [ ! (-f a_filename)]; then > do_something_for_this_file > fi > > if [ ! (-d a_dirname)]; then > do_something_for_this_dir > fi > > How can I do the same functions in perl?
Actaully you have a negation operator in there that shouldn't be there and Perl syntax is different: if (-d $path_to_file) { # dir logic goes here } > Another question: > > In the unix/linux system, we have the path, for instance, > > /usr/local/bin/perl > > However, in the Window/NT system, I have installed > perl in g:\perl\bin\perl.exe > > How can I reference the path for perl.exe? > > Is it "g:\perl\bin\perl.exe" or something else? If you're speaking of the shebang line, I use #!perl -w -- If not, please explain further and remember to double your \s when inside "s and `s. -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs