You probably figured out the syntax error by now, but in case you didn't: the first "foreach" loop (over "my @dir (@directories)") does not have an open curly brace. Fix that, and make sure the other braces are all properly balanced. This is a lot easier if you use a text editor that knows about programming languages (C-style indentation is good enough, but the really good programming editors, which provide syntax highlighting as well as automatic indentation, have a mode for editing Perl.)
So long as you understand and trust the editor's automatic suggestions about how far indentation should go for a given line, it'll help you to know when and where to look for various brackets, braces, parens and quotes that happen to be missing or misplaced.
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.