in reply to Re: true from (-e "") on Windoze
in thread true from (-e "") on Windoze

That won't work. Empty double quotes in a string are considered "true" by Perl.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^3: true from (-e "") on Windoze
by frozenwithjoy (Priest) on Jul 02, 2012 at 19:18 UTC
    Works fine for me. Also, here is a handy table for this sort of thing: "Truth tests for different values" on True or False? A Quick Reference Guide. defined $file, however, would be true for an empty string.

    edit: Oops, I didn't catch that there were quotes inside quotes...

      Yep, it's the quotes-within-quotes that is the problem.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics