Skip to content

Instantly share code, notes, and snippets.

@tryperl
Created March 6, 2013 13:31
Show Gist options
  • Save tryperl/5099306 to your computer and use it in GitHub Desktop.
Save tryperl/5099306 to your computer and use it in GitHub Desktop.
Created by www.tryperl.com.
#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