Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Simplify constant value determination

by ysth (Canon)
on Aug 25, 2006 at 16:37 UTC ( [id://569621]=note: print w/replies, xml ) Need Help??


in reply to Simplify constant value determination

Since you seem to just want the first group of digits:
use constant REVISION => ('$Id: mcdt.pl 2081 2006-08-25 16:16:27Z tomt +e $' =~ /(\d+)/g)[0];
should do it. No need for eval or substitution here.

Update: grr, I don't use g-less m// in list context often enough to remember what it returns.

use constant REVISION => '$Id: mcdt.pl 2081 2006-08-25 16:16:27Z tomte + $' =~ /(\d+)/;

Replies are listed 'Best First'.
Re^2: Simplify constant value determination
by Tomte (Priest) on Aug 25, 2006 at 16:52 UTC

    the last one is what i was looking for - thanks and ++ysth - the wood for the trees etc. :)

    regards,
    tomte


    An intellectual is someone whose mind watches itself.
    -- Albert Camus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://569621]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-25 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found