Created
March 6, 2013 13:31
-
-
Save tryperl/5099306 to your computer and use it in GitHub Desktop.
Created by www.tryperl.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created by tryperl.com | |
use strict; | |
use warnings; | |
use Carp qw(croak); | |
use Data::Dumper; | |
my $data = {}; | |
#croak '111'.Dumper $data; | |
print length keys %$data; # length keys is the number of characters in "0"... you want scalar keys %$... | |
die; | |
unless ($data) { # references are always true | |
croak "1"; | |
} else { | |
croak "2"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment