⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 problem.pm

📁 source of perl for linux application,
💻 PM
字号:
package MakeMaker::Test::Setup::Problem;@ISA = qw(Exporter);require Exporter;@EXPORT = qw(setup_recurs teardown_recurs);use strict;use File::Path;use File::Basename;my %Files = (             'Problem-Module/Makefile.PL'   => <<'END',use ExtUtils::MakeMaker;WriteMakefile(    NAME    => 'Problem::Module',);END             'Problem-Module/subdir/Makefile.PL'    => <<'END',printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";warn "I think I'm going to be sick\n";die "YYYAaaaakkk\n";END);sub setup_recurs {    while(my($file, $text) = each %Files) {        # Convert to a relative, native file path.        $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);        my $dir = dirname($file);        mkpath $dir;        open(FILE, ">$file") || die "Can't create $file: $!";        print FILE $text;        close FILE;    }    return 1;}sub teardown_recurs {     foreach my $file (keys %Files) {        my $dir = dirname($file);        if( -e $dir ) {            rmtree($dir) || return;        }    }    return 1;}1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -