Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'm trying to upgrade some code to run correctly in Perl 5.14. However, I still need it to work in older version of perl.

I would like to have certain code execute only if Perl 5.14 is detected. Essentially I'm looking for something similar to the #if  MACRO #endif construct in C.

My specific use case is that I need use re '/d'; in order for some existing regular expressions to want with 5.14 but earlier Perl versions will give a compile error if I add this pragma.

I've searched extensively but I haven't found any information for how to do something like this. So any suggestions would be greatly appreciated.

Thanks in advance

In reply to Conditionally executing different code based on Perl Version by dlarochelle

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [LanX]: well ... the traget audiance is 15-25
    [LanX]: spend one weekend in bed and TV showed me 3 remakes of 80s classics
    [Your Mother]: Yep. Publish or die. Content be damned.
    [Your Mother]: Comfort food and diabetes for the soul.
    [LanX]: talking about comic adaptions ... I really liked the Watchmen
    [LanX]: look I can give you a long list of excellent US movies
    [Your Mother]: I adored the comic and the movie was almost a frame for frame remake (excepting the plot liberties to shorten it) but I still didn't quite like it. What's his nose, Jamie Earl whoever was flawless though.
    LanX though probably produced outside Holywood
    [Your Mother]: There are tons of good movies from all over but for every gem there is a pile of dirt 10 meters high burying it.
    [LanX]: well

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (14)
    As of 2018-03-19 15:00 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (240 votes). Check out past polls.