in reply to Re: s/// in a sub : passing expressions
in thread s/// in a sub : passing expressions

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.

Replies are listed 'Best First'.
Re^3: s/// in a sub : passing expressions
by Juerd (Abbot) on Oct 30, 2005 at 00:32 UTC

    There is no need to be so melodramatic when mentioning the issue.

    This site has many newbies. It is only fair to warn them: even if the OP probably knows it, then there are still many lurkers who may not. They can find out details themselves, so I don't feel a need to further describe when and how it is dangerous.

    How do you know what he thinks? Absolutism and assumptions, all of this.

    Apparently not your style. It is mine, though. Please stfu and let me express myself the way I prefer.

    The absolutism and assumptions are obvious and not to be taken too literally.

    Who asked?

    For the record, would you please specify who asked for your whining?

    If all information were in Q&A form, life would seem even more complex than it actually is.

    More like Perl 6 spam...

    I'm glad to see you get the point! Good!

    Would you please curb your enthusiasm and answer those questions only after someone asks them?

    No way.

    Or perhaps just write a series of meditations;

    "Or"?

    And. I've done one already, and had another planned (mostly written, see scratchpad), but I'm holding it off while I further investigate whether what I have written is actually correct. There will probably be more. Together, you might call this a series.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      It is only fair to warn them: even if the OP probably knows it, then there are still many lurkers who may not.

      It is fair to give them a measured warning. That does not include attempting scare them away from perfectly useful tools with your histrionics. That is neither fair to them nor is it fair to the Perl community which continually goes to lengths trying to show the usefulness of Perl and expand its acceptance.

      Please stfu and let me express myself the way I prefer.

      Please gtfu (g for "grow") and show some maturity. This isn't a playground. You are a smart kid, Juerd but if you want to stand out in a good way, you will realize you are around professionals here and try to conduct yourself accordingly.

      More like Perl 6 spam...
      I'm glad to see you get the point! Good!

      OK. I see. You are an admitted spammer who refuses to change his ways. So be it.