|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: Comparing two directories and then exiting from the scriptby biohisham (Priest) |
| on Nov 20, 2010 at 03:22 UTC ( #872624=note: print w/ replies, xml ) | Need Help?? |
|
Argument "E:/perl/scripts" isn't numeric in numeric ne (!=) at orphan_check.pl line 26Of course this argument is not numeric because "E:/perl/scripts" is not a number, hence you were offered the operator 'ne' instead of the one you tried to use '!='. You have to decide whether your operand(s) is in numeric context or a string context. In Perl it makes a difference and using an operator in a context that is it not applicable could give out such warnings. 'lt, gt, le, ge, eq, ne, cmp' perform on strings similar operations performed by '<, >, <=, >=, ==, !=, <=>' respectively on numbers On a further note, be careful with treating strings as numbers because perl can force into a number any string that has been treated that way, an example will include using the arithmetic operators on strings, they will be reinitialized to zero..'$string' was reinitialized to 0... These are some errors that may just be hard to detect if you chose to ignore warnings given to you.. Excellence is an Endeavor of Persistence. A Year-Old Monk :D .
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||