第十五章:Perl模块
上一篇 /
下一篇 2008-11-12 11:42:29
/ 个人分类:《Perl语言入门》-小骆驼书-练习题答案
1)
use warnings;
use Module::CoreList;
my %modules = %{ $Module::CoreList::version{5.006} };
print join "\n", keys %modules;
2)
use warnings;
use Cwd;
use File::Spec;
my $cwd = getcwd();
my @files = glob ".* *";
foreach my $file (@files){
my $path = File::Spec->catfile($cwd, $file);
print "$path\n";
}
3)
use warnings;
use Cwd;
use File::Spec;
use File::Basename;
my $cwd = getcwd;
my @files = glob ".* *";
foreach my $file(@files){
my $path = File::Spec->catfile($cwd, $file);
my $basename = basename $path;
print "$basename\n";
}
收藏
举报
TAG: