App-Chart

 view release on metacpan or  search on metacpan

misc/t-misc.pl  view on Meta::CPAN

  print "$x $y\n";
  print $x+0," ",$y+0,"\n";
  exit 0;
}

# package ZZ;
# use strict;
# use warnings;
# use Data::Dumper;
# 
# sub new {
#   return bless {}, 'ZZ';
# }
# sub DESTROY {
#   my ($self) = @_;
#   print Dumper ($self);
#   print Dumper (\$main::x);
# }
# 
# package main;
# my $x = ZZ->new;
# Scalar::Util::weaken ($x);
# exit 0;



{
  open (my $fh, "/nosuchfile");
  my $err = "$!";
  print utf8::is_utf8($err)?"yes":"no","\n";
  print $!;
  exit 0;
}
{
  my $x = 'down';
  if (! $x) {
    print "yes\n";
  } else {
    print "no\n";
  }
  exit 0;
}
{
  my $x = '(?:\/|^)(?:CVS|.svn)\/';

  if ('xsvn/foo' =~ /$x/) {
    print "yes\n";
  } else {
    print "no\n";
  }
  exit 0;
}


{
  my $aref = ref (undef);
  print Dumper ($aref);
  exit 0;
}
{
  my $charset = langinfo (CODESET);
  print "charset $charset\n";

  foreach my $name (@Encode::FB_FLAGS) {
    my $value = eval "$name";
    printf "%-20s %#05X\n", $name, $value;
  }
  require PerlIO::encoding;
  local $PerlIO::encoding::fallback = 0; # FB_DEFAULT, substitute quietly
  local $PerlIO::encoding::fallback = Encode::PERLQQ;
  printf "fallback %#x\n",$PerlIO::encoding::fallback;

  binmode (STDOUT, ":encoding(latin-1)");
  my $str = "\b\x{263a}\n";
  print "len ", length($str),"\n";
  $| = 1;
  print $str;

  $str = "\r\r\r\n";
  print "len ", length($str),"\n";
  $| = 1;
  print $str;
  exit 0;
}

{
  my $loc = setlocale (LC_ALL);
  print "loc ", defined $loc ? $loc : 'undef', "\n";
  exit 0;
}



{
  my $x = \0;
  print Dumper ($x);
  exit 0;
}
#noop(1);
{
  my @a = ();
  my $r = \@a;
  print $r+0,"\n";
  push @a, ('x' x 10000);
  print $r+0,"\n";
  bless $r, ('x' x 100000);
  print $r+0,"\n";
  exit 0;
}
{
  my $x = 1;
  my $y = \$x;
  print $y->can('foo') ? 1 : 0;
  exit 0;
}
{
  my $aref = undef;
  print scalar $#$aref,"\n";
  print scalar @{$aref},"\n";
  print Dumper ($aref);
  exit 0;
}



( run in 2.354 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )