Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: use Ispecific/I version

by Malkavian (Friar)
on Jul 09, 2001 at 19:19 UTC ( [id://95001]=note: print w/replies, xml ) Need Help??


in reply to use _specific_ version

I believe you're looking for 'require'.
At the top of your code put a line 'require 5.006;' or similar.
As far as I'm aware, it just forces the compliance with a particular, known and tested version of Perl.
Is it a requisite that it needs to check for more than one version of Perl, or just require the one?
You could use the $] (perl version variable) as a trap, but, on the whole, I think requiring a particular version is cleaner.

Malk

Replies are listed 'Best First'.
Re: Re: use Ispecific/I version
by particle (Vicar) on Jul 09, 2001 at 19:26 UTC
    no, no.

    require and use both specify this version or higher. the difference between require and use is that require is executed at runtime, and use is executed at compile time. therefore, if i require 5.6.0, any BEGIN blocks will execute before the version of perl is checked.

    that would be a Bad Thing.

    ~Particle

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found