Linux server.nvwebsoft.co.in 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Apache
: 162.240.12.249 | : 18.118.128.17
202 Domain
8.1.31
nbspublicschool
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
perl-Readonly-1.03 /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
array.t
2
KB
-rw-r--r--
deepa.t
1.18
KB
-rw-r--r--
deeph.t
1.23
KB
-rw-r--r--
deeps.t
1.72
KB
-rw-r--r--
docs.t
2.2
KB
-rw-r--r--
export.t
186
B
-rw-r--r--
hash.t
1.64
KB
-rw-r--r--
readonly.t
2.19
KB
-rw-r--r--
reassign.t
3.03
KB
-rw-r--r--
scalar.t
1.28
KB
-rw-r--r--
tie.t
603
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : deeps.t
#!/usr/bin/perl -I.. # Test Scalar vs Scalar1 functionality use strict; use Test::More tests => 21; # Find the module (1 test) BEGIN {use_ok('Readonly'); } sub expected { my $line = shift; $@ =~ s/\.$//; # difference between croak and die return "Modification of a read-only value attempted at " . __FILE__ . " line $line\n"; } use vars qw/$s1 $s2 $s3 $s4/; my $m1 = 17; my $m2 = \$m1; # Create (4 tests) eval {Readonly::Scalar1 $s1 => ["this", "is", "a", "test", {x => 5}]}; is $@ => '', 'Create a shallow reference scalar'; eval {Readonly::Scalar $s2 => ["this", "is", "a", "test", {x => 5}]}; is $@ => '', 'Create a deep reference scalar'; eval {Readonly::Scalar1 $s3 => $m2}; is $@ => '', 'Create a shallow scalar ref'; eval {Readonly::Scalar $s4 => $m2}; is $@ => '', 'Create a deep scalar ref'; # Modify (16 tests) eval {$s1 = 7}; is $@ => expected(__LINE__-1), 'Modify s1'; eval {$s2 = 7}; is $@ => expected(__LINE__-1), 'Modify s2'; eval {$s3 = 7}; is $@ => expected(__LINE__-1), 'Modify s3'; eval {$s4 = 7}; is $@ => expected(__LINE__-1), 'Modify s4'; eval {$s1->[2] = "the"}; is $@ => '', 'Deep-modify s1'; is $s1->[2] => 'the', 's1 modification successful'; eval {$s2->[2] = "the"}; is $@ => expected(__LINE__-1), 'Deep-modify s2'; is $s2->[2] => 'a', 's2 modification supposed to fail'; eval {$s1->[4]{z} = 42}; is $@ => '', 'Deep-deep modify s1'; is $s1->[4]{z} => 42, 's1 mod successful'; eval {$s2->[4]{z} = 42}; is $@ => expected(__LINE__-1), 'Deep-deep modify s2'; ok !exists($s2->[4]{z}), 's2 mod supposed to fail'; eval {$$s4 = 21}; is $@ => expected(__LINE__-1), 'Deep-modify s4 should fail'; is $m1 => 17, 's4 mod should fail'; eval {$$s3 = "bah"}; is $@ => '', 'deep s3 mod'; is $m1 => 'bah', 'deep s3 mod';
Close