Thread IO::Socket::SSL und require (18 answers)
Opened by bianca at 2015-04-14 17:10

bianca
 2015-04-14 17:10
#180664 #180664
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
Hallöchen!

Ich möchte das Modul CPAN:IO::Socket::SSL nicht per use sondern erst zur Laufzeit per require laden. Gleichzeitig muss ich auch die Konstante SSL_VERIFY_CLIENT_ONCE aus dem Modul importieren.

Der Code, den ich beim Googeln am naheliegendsten fand ist dieser:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;

require IO::Socket::SSL;
IO::Socket::SSL->import(SSL_VERIFY_CLIENT_ONCE);

my $ftp = Net::FTP->new(
    'irgendeinurl',
    SSL_verify_mode => SSL_VERIFY_CLIENT_ONCE,
);

Der wirft aber leider
Quote
Bareword "SSL_VERIFY_CLIENT_ONCE" not allowed while "strict subs" in use at test.pl line 7.
Bareword "SSL_VERIFY_CLIENT_ONCE" not allowed while "strict subs" in use at test.pl line 9.
Execution of test.pl aborted due to compilation errors.

Was mache ich da falsch?
Im Grunde möchte ich use IO::Socket::SSL qw(SSL_VERIFY_CLIENT_ONCE) mit require schreiben. Aber wie?
10 print "Hallo"
20 goto 10

View full thread IO::Socket::SSL und require