When I run the following code:
#!d:/perl/bin -w
use strict;
use diagnostics;
use File::Find;
@ARGV = ();
find sub {
push @ARGV, $File::Find::name if (/\.pl$/ and (-M < 1.0));
}, "d:/perl";
$,="\n";
print @ARGV;
I get this:
Warning: Use of "-M" without parens is ambiguous at ft.pl line 11.
Unterminated <> operator at ft.pl line 9 (#1)
(F) The lexer saw a left angle bracket in a place where it was expecting
a term, so it's looking for the corresponding right angle bracket, and not
finding it. Chances are you left some needed parentheses out earlier in
the line, and you really meant a "less than".
Uncaught exception from user code:
Unterminated <> operator at ft.pl line 9.
After a lot of trial and error, I found that the only way I could get it to work was by changing the file test part to
(1.0 > -M).
Is there a way to write the above code so that I can keep the
(-m < 1.0) part?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.