Who sold you this junk? The wheels are square and they don't even turn!
Ummm, I mean, you use strict; which is excellent, but there are eight variables used that are not declared. Even if the obvious declarations are made there are three variables that are used without being initialized!
It may be that the following code (completely unrelated to your sample) may illustrate the technique you are asking about:
#!/usr/bin/perl -w
use strict;
my @lines = split "\n", <<"LINES";
12345678901234
123456789012345
1234567890123456
123456789012xxx
LINES
chomp @lines;
my @lines15 = grep {15 == length} @lines;
print join "\n", @lines15;
Prints:
123456789012345
123456789012xxx
Perl is environmentally friendly - it saves trees
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.