eval is dangerous; Never use it with user input!
Don't panic!

It is true that eval can be dangerous. When used with untrusted user input. So can all sorts of functions (open, exec/system, syscall, etc.) There is no need to be so melodramatic when mentioning the issue.

Also, parsing XML with regexes is bad,
That is entirely dependent on the problem. For long-lasting tools and/or tools that have to parse XML from a variety of sources, that is true. For one-offs or scripts dealing with generated XML (where the generator is well understood and unlikely to change) it probably is not.

.* is bad,
That is ridiculous. (Regardless of Death to Dot Star!) It is another tool in the toolbox. Is .+ bad? Why doesn't anyone complain about it? I know .* is often used in places where it should not be, but that doesn't make it bad. People often use map in places where they shouldn't. That doesn't make it bad. People just need to be educated about when to use it and when to avoid it.

and $ doesn't do what you think,
How do you know what he thinks?

Absolutism and assumptions, all of this. You are providing what amounts to cargo-cult advice. Some cargo-cult advice is mostly harmless (e.g. use strict;) but, in most cases, like code, advice should be tailored to the situation

Perl 6 changes:
More like Perl 6 spam... Who asked? There will be plenty of opportunity for everyone to learn about Perl 6 when they need to. Eventually, this site will be filled with P6 questions. Would you please curb your enthusiasm and answer those questions only after someone asks them? Or perhaps just write a series of meditations; I'm sure they would be well-received.


In reply to Re^2: s/// in a sub : passing expressions by Anonymous Monk
in thread s/// in a sub : passing expressions by ady

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.