Linux cpanel2.daytoncreative.net 2.6.32-754.29.2.el6.x86_64 #1 SMP Tue May 12 17:39:04 UTC 2020 x86_64
Apache/2.4.43 (cPanel) OpenSSL/1.1.1g mod_bwlimited/1.4
Server IP : 70.62.220.67 & Your IP : 216.73.216.193
Domains :
Cant Read [ /etc/named.conf ]
User : michaelgreg
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
log /
perl-5.20.2 /
ext /
Tie-Memoize /
t /
Delete
Unzip
Name
Size
Permission
Date
Action
Tie-Memoize.t
1.6
KB
-r--r--r--
2014-12-27 11:48
Save
Rename
#!./perl -w use strict; use Tie::Memoize; use Test::More tests => 27; use File::Spec; sub slurp { my ($key, $dir) = @_; open my $h, '<', File::Spec->catfile($dir, $key) or return; local $/; <$h> # slurp it all } sub exists { my ($key, $dir) = @_; return -f File::Spec->catfile($dir, $key) } chdir(File::Spec->updir()) if not -d 't'; my $directory = File::Spec->catdir('lib', 'Tie'); tie my %hash, 'Tie::Memoize', \&slurp, $directory, \&exists, { fake_file1 => 123, fake_file2 => 45678 }, { 'strict.pm' => 0, known_to_exist => 1 }; ok(not exists $hash{'strict.pm'}); ok(exists $hash{known_to_exist}); ok($hash{fake_file2} eq 45678); ok($hash{fake_file1} eq 123); ok(exists $hash{known_to_exist}); ok(not exists $hash{'strict.pm'}); ok(not defined $hash{fake_file3}); ok(not defined $hash{known_to_exist}); ok(not exists $hash{known_to_exist}); ok(not exists $hash{'strict.pm'}); my $c = slurp('Memoize.pm', $directory); ok($c); ok($hash{'Memoize.pm'} eq $c); ok($hash{'Memoize.pm'} eq $c); ok(not exists $hash{'strict.pm'}); ok(exists $hash{'blib.pm'}); untie %hash; tie %hash, 'Tie::Memoize', \&slurp, $directory; ok(exists $hash{'Memoize.pm'}, 'existing file'); ok(not exists $hash{fake_file2}); ok(not exists $hash{fake_file1}); ok(not exists $hash{known_to_exist}); ok(exists $hash{'Memoize.pm'}, 'existing file again'); ok(not defined $hash{fake_file3}); ok(not defined $hash{known_to_exist}); ok(not exists $hash{known_to_exist}); ok(exists $hash{'Memoize.pm'}, 'existing file again'); ok($hash{'Memoize.pm'} eq $c); ok($hash{'Memoize.pm'} eq $c); ok(exists $hash{'Memoize.pm'}, 'existing file again');