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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||