The full error message I get when running your code is
Useless use of a constant in void context at test.pl line 17. and line 17 is
my $pms = join("\n", @foundfiles), "\n";
which joins together all the values in @foundfiles then throws it away, and assigns the "\n" to $pms.which parses as
(my $pms = join("\n", @foundfiles)), "\n"; as pointed out by
tye below. Assigning the value of join to
$pms and doing nothing with the
"\n", hence the error message. What you probably mean is
my $pms = join("\n", @foundfiles) . "\n";
(Note the period which is the string concatination operator, instead of the comma, which in scalar context evaluates its LHS, throws it away, then evaluates and returns its RHS)
Update: Thanks tye. This will teach me to try and answer a PM post while answering support calls at work. Next time I'll ignore the calls.. must have my priorities straight.
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.