Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Is there any way to override "file test operator"?

by Tux (Canon)
on Aug 09, 2011 at 08:04 UTC ( [id://919410]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Is there any way to override "file test operator"?
in thread Is there any way to override "file test operator"?

I said that this was how I read that, and parens do matter here:

$ cat test.pl #!/pro/bin/perl use strict; use warnings; my $file = "/tmp/test20.pl"; -e $file and print "$file EXISTS!\n"; print "$0 \n"; - e $file and print "$file WILD!\n"; $ perl test.pl test.pl Can't call method "e" without a package or object reference at test.pl + line 10. $

versus

$ cat test.pl #!/pro/bin/perl use strict; use warnings; my $file = "/tmp/test20.pl"; -e $file and print "$file EXISTS!\n"; print "$0 \n"; - e ($file) and print "$file WILD!\n"; $ perl test.pl test.pl Undefined subroutine &main::e called at test.pl line 10.

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://919410]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-16 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found