Leser: 22
1
2
C:\>perl -e "use Data::Dumper; print Data::Dumper::Dumper( $CGI::VERSION )"
$VAR1 = undef;
1
2
3
4
C:\>perl -e "use Data::Dumper; print Data::Dumper::Dumper( $CGI::VERSION )"
$VAR1 = undef;
C:\>
Guest werWobei ich es so schreiben würde...
1
2
3
4
C:\>perl -MCGI -MData::Dumper -e 'print Dumper( $CGI::VERSION )'
Can't find string terminator "'" anywhere before EOF at -e line 1.
C:\>
perl -MCGI -MData::Dumper -e "print Dumper( $CGI::VERSION )"
1
2
3
4
C:\>perl -MCGI -MData::Dumper -e "print Dumper( $CGI::VERSION )"
$VAR1 = '3.29';
C:\>
perl -MCGI -E 'say CGI->VERSION'
perl -MCGI\ 9999 -e1
1
2
3
4
5
6
7
8
9
10
use Class::Load qw(try_load_class);
for my $module ( @ARGV ) {
if ( try_load_class($module) ) {
say "$module => ", $module->VERSION;
}
else {
say "$module => Does not exists";
}
}
1
2
3
4
5
6
7
8
9
for my $module ( @ARGV ) {
say "try to load $module";
eval{
require $module;
1;
} and do {
say "$module version: " . $module->VERSION;
};
}
require $module
eval "use $module"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl -w use strict; use warnings; use utf8; use open ':encoding(UTF-8)'; use open ':std'; for my $module ( @ARGV ) { eval "use $module"; if ($@) { print "Modul does not exists" } else { print "$module => ". $module->VERSION . "\n"; } }
1
2
3
4
D:\Arbeit\perltest>perl module_inventar.pl Data::Dumper
Data::Dumper => 2.121_04
D:\Arbeit\perltest>
2009-11-06T16:44:26 pq
2009-11-06T16:48:22 biancaWürde gern den Versuch wagen, die Module ohne ein zusätzliches Modul zu inventarisieren.
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl -w use strict; use warnings; use ExtUtils::Installed; my $inst = ExtUtils::Installed -> new (); my @modules = $inst -> modules (); for (@modules) { print $_ . " == >" . $inst -> version ($_) . "<\n"; }
1
2
3
4
5
6
7
8
9
HTML-Tree == ><
HTML::Element::Extended == ><
MIME-Base64-Scripts == ><
MailTools == ><
PPM3 == ><
PodParser == ><
Scalar::List::Utils == ><
libnet == ><
libwww-perl == ><