in reply to Checking for Directories

One can use the -d "dirname" test. from the command line:
perl -e "-d (\"/tmp\") and print \"aack\n\"";
in a script:
#!/usr/local/bin/perl -d "/tmp" and print "/tmp is a directory\n";

Replies are listed 'Best First'.
RE: RE: Checking for Directories
by Fastolfe (Vicar) on Jul 29, 2000 at 01:07 UTC
    Just for future reference, you can mix quotation mark styles on the command line, eliminating the escapes.
    $ perl -e "-d (\"/tmp\") and print \"aack\n\""
    becomes
    $ perl -e '-d ("/tmp") and print "aack\n"'