develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [PATCH] Fcntl constants speedup

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
December 17, 2000 09:53
Subject:
Re: [PATCH] Fcntl constants speedup
Message ID:
20001217175319.H97668@plum.flirble.org
On Sun, Dec 17, 2000 at 11:27:32AM -0600, Jarkko Hietaniemi wrote:
> Thanks, I need all the possible speedups I can find to pay for my
> regex polymorphism patch :-)

Does this mean that the utf leakage detector might soon report OK on
test 1? And that PerlIO will fix test 3?

#!/usr/bin/perl -w
use strict;

my $input = chr 340;
printf "# Input has length %d \n", length $input;

my $output = $input;
$output =~ s/././;
if (length ($output) == 1) {
  print "ok 1\n";
} else {
  printf "not ok 1 # length is %d\n", length $output;
}

my $key = $input;
my %hash = ($key, 1);

($key) = keys %hash;

if (length ($key) == 1) {
  print "ok 2\n";
} else {
  printf "not ok 2 # length is %d\n", length $key;
}

my $pid = open SPROG, "|-";
die $! unless defined $pid;
if ($pid) {
  # Parent
  print SPROG $input;
} else {
  # Child
  undef $/;
  $input = <STDIN>;
  if (length ($input) == 1) {
    print "ok 3\n";
  } else {
    printf "not ok 3 # length is %d\n", length $input;
  }
  exit 0; # really should be _exit
}


/usr/bin/perl5.004 ~/test/spot_utf.pl 
# Input has length 1 
ok 1
ok 2
ok 3

/usr/bin/perl5.6.0 ~/test/spot_utf.pl 
# Input has length 1 
not ok 1 # length is 2
not ok 2 # length is 2
not ok 3 # length is 2

/usr/local/bin/perl5.7.0 ~/test/spot_utf.pl 
# Input has length 1 
not ok 1 # length is 2
not ok 2 # length is 2
not ok 3 # length is 2

./perl ~/test/spot_utf.pl 
# Input has length 1 
not ok 1 # length is 2
ok 2
Wide character in print at /home/nick/test/spot_utf.pl line 28.
not ok 3 # length is 0


Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About