develooper Front page | perl.perl5.porters | Postings from April 2018

use vs require with version

Thread Next
From:
H.Merijn Brand
Date:
April 8, 2018 09:23
Subject:
use vs require with version
Message ID:
20180328163912.3d497d7d@pc09.procura.nl
Why is «use Module Version;» supported, but «require Module Version;»
not?

$ perl -we'use DBI'
$ perl -we'use DBI 0.3'
$ perl -we'use DBI 3.0'
DBI version 3 required--this is only version 1.641 at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$ perl -we'use DBI 0.3 ()'
$ perl -we'use DBI 3.0 ()'
DBI version 3 required--this is only version 1.641 at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

$ perl -we'require DBI'
$ perl -we'require DBI 0.3'
Number found where operator expected at -e line 1, near "require DBI 0.3"
        (Do you need to predeclare require?)
syntax error at -e line 1, near "require DBI 0.3"


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.27   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About