smartnezz has asked for the wisdom of the Perl Monks concerning the following question:
Here now the function with function call and the two parameters the operator -e,-w and the filename. Basically this should work, but somehow when i try to compare this two arguments the interpreter reports a error. I tried to use eval to evaluate the variable $_[0] firs befor I using this in the if condition. Any ideas?if(-e,-w "c:\\myfile.txt") { print"File exists"; }
Any help is greatly appreciated Thank you Petercheckit("-e,-w", "c:\\myfile.txt"); checkit { if($_[0] && $_[1]) { if($_[0] $_[1]) { #Here exists the Problem the interpreter alw +ays displays me an error message print"File exists"; } else { print"File doesnt exist"; } } }
2005-09-09 Retitled by Arunbear, as per Monastery guidelines
Original title: 'Filecheck'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing file check operators to a function
by sk (Curate) on Sep 08, 2005 at 00:16 UTC | |
|
Re: Passing file check operators to a function
by GrandFather (Saint) on Sep 08, 2005 at 00:52 UTC | |
by NetWallah (Canon) on Sep 08, 2005 at 05:10 UTC | |
|
Re: Passing file check operators to a function
by polettix (Vicar) on Sep 08, 2005 at 01:59 UTC | |
|
Re: Passing file check operators to a function
by smartnezz (Initiate) on Sep 08, 2005 at 02:47 UTC | |
by Zaxo (Archbishop) on Sep 08, 2005 at 03:32 UTC | |
by sk (Curate) on Sep 08, 2005 at 04:11 UTC |