diff options
Diffstat (limited to 'Bugs')
-rwxr-xr-x | Bugs/arraynotok | 72 | ||||
-rw-r--r-- | Bugs/clearmyarray | 4 | ||||
-rw-r--r-- | Bugs/clobberref | 1 | ||||
-rw-r--r-- | Bugs/delete_env | 2 | ||||
-rwxr-xr-x | Bugs/formatsub | 7 | ||||
-rw-r--r-- | Bugs/lcsort | 37 | ||||
-rw-r--r-- | Bugs/lcsortdump | 6 | ||||
-rwxr-xr-x | Bugs/mig | 17 | ||||
-rw-r--r-- | Bugs/myforeach | 1 | ||||
-rw-r--r-- | Bugs/numkey | 12 | ||||
-rw-r--r-- | Bugs/signedbits | 2 | ||||
-rw-r--r-- | Bugs/splitdump | 1 | ||||
-rw-r--r-- | Bugs/splitscalar | 1 | ||||
-rw-r--r-- | Bugs/subform | 107 | ||||
-rw-r--r-- | Bugs/substrdump | 2 | ||||
-rw-r--r-- | Bugs/zeroanonref | 1 |
16 files changed, 273 insertions, 0 deletions
diff --git a/Bugs/arraynotok b/Bugs/arraynotok new file mode 100755 index 0000000000..dd1b05383d --- /dev/null +++ b/Bugs/arraynotok @@ -0,0 +1,72 @@ +#!/usr/bin/perl + +# +# I thought that I would try out some perl 5 features for the first time. +# So I wrote a small program, included below. It died, and the partial +# output looks very much like what I wanted to accompish. Even if the program +# had not died, there is still the problem that no output was given under the +# label "sonia:". +# +# Since the output is close, perhaps a bug lurks within...(?) I'm using the +# compiled binary provided in the perl5a6 tar file. I tried to write this +# post so it could be given to perl with the -x flag. You should get the +# output I describe here -- +# James Bence +# jbence@math.ucla.edu +# +# Output: +# +# Pushed ege into @sonia +# Pushed caflisch into @joshua +# Pushed catalina into @julia +# Pushed lunnon into @sonia +# Pushed m270alg into @redwood +# Pushed harten into @joshua +# Pushed ycc into @joshua +# Pushed m270wsc into @redwood +# +# +# joshua: +# caflisch harten ycc +# +# sonia: +# +# +# redwood: +# m270alg m270wsc +# +# julia: +# Segmentation fault +# +# + +require 5.000; + +while (<DATA>) { + ($login,$host) = split; + push(@{$hostref{$host}},$login); # t/op/ref.t (22) suggests this is ok. + print "Pushed $login into \@$host\n"; +} + +print"\n\n"; + +while ( ($host,$ref) = each(%hostref)) { + print "$host:\n "; + $count = 0; + foreach $person (@{$ref}) { + print $person, " "; + $count++; + if ($count % 5 == 0) { print "\n "; } + } + print "\n\n"; +} + +__END__ +ege sonia +caflisch joshua +catalina julia +lunnon sonia +m270alg redwood +harten joshua +ycc joshua +m270wsc redwood diff --git a/Bugs/clearmyarray b/Bugs/clearmyarray new file mode 100644 index 0000000000..e4aecb32ab --- /dev/null +++ b/Bugs/clearmyarray @@ -0,0 +1,4 @@ +@a = ( 5, 6, 7, 8); +&foo(1, 2, @a); + +sub foo { my($a, $b, @c) = @_; print scalar(@c), "\n"; } diff --git a/Bugs/clobberref b/Bugs/clobberref new file mode 100644 index 0000000000..4cba683bdd --- /dev/null +++ b/Bugs/clobberref @@ -0,0 +1 @@ +$B = [X, Y]; $B = 1; print $B diff --git a/Bugs/delete_env b/Bugs/delete_env new file mode 100644 index 0000000000..a4bf8eff3c --- /dev/null +++ b/Bugs/delete_env @@ -0,0 +1,2 @@ +delete $ENV{TERM}; +system "env"; diff --git a/Bugs/formatsub b/Bugs/formatsub new file mode 100755 index 0000000000..e995846baf --- /dev/null +++ b/Bugs/formatsub @@ -0,0 +1,7 @@ +#!./perl + +format STDOUT { + formline "@<<<<<<<<<<<<< @>>>>>>>>>>>\n", "foo", "bar"; +} + +write; diff --git a/Bugs/lcsort b/Bugs/lcsort new file mode 100644 index 0000000000..2cbe8613ad --- /dev/null +++ b/Bugs/lcsort @@ -0,0 +1,37 @@ +Article 20341 of comp.lang.perl: +Path: netlabs!news.cerf.net!mvb.saic.com!MathWorks.Com!news.kei.com!hookup!swrinde!gatech!taco.cc.ncsu.edu!taco.cc.ncsu.edu!setzer +From: setzer@math.ncsu.edu (William Setzer) +Newsgroups: comp.lang.perl +Subject: perl5a6 bug: sort sub @ary +Date: 30 Mar 94 13:49:20 +Organization: The Chebychev Church of Probability +Lines: 23 +Distribution: world +Message-ID: <SETZER.94Mar30134920@math.math.ncsu.edu> +NNTP-Posting-Host: math.ncsu.edu + +Ok, here's a weird one. Using the precompiled perl5a6 binary for the +sun, the following dumps core: +---- +@S = (0, 1, 2, 3); +for ("A", "D", "b", "c") { $foo{$i++} = $_; } +# for (sort { lc($foo{$a}) cmp lc($foo{$b}) } @S) { print $foo{$_}, "\n"; } +for (sort Alpha @S) { print $foo{$_}, "\n"; } + +sub Alpha { lc($foo{$a}) cmp lc($foo{$b}); } +---- +[Output] +Segmentation fault (core dumped) +---- +However, if you comment out the "sort Alpha" and uncomment the "sort +{lc(...) cmp lc(...) }" line, everything works as expected. Also note +that if you uncomment both "sort"s, everything also works as expected. +Do-do-do-do [twilight zone music :-]. + +William + +PS: Does anyone actually care about these bug reports? I thought I + remember Larry saying that he preferred them in c.l.p., but it + wouldn't be the first time my memory has fritzed. + + diff --git a/Bugs/lcsortdump b/Bugs/lcsortdump new file mode 100644 index 0000000000..4254305b4f --- /dev/null +++ b/Bugs/lcsortdump @@ -0,0 +1,6 @@ +@S = (0, 1, 2, 3); +for ("A", "D", "b", "c") { $foo{$i++} = $_; } +# for (sort { lc($foo{$a}) cmp lc($foo{$b}) } @S) { print $foo{$_}, "\n"; } +for (sort Alpha @S) { print $foo{$_}, "\n"; } + +sub Alpha { lc($foo{$a}) cmp lc($foo{$b}); } diff --git a/Bugs/mig b/Bugs/mig new file mode 100755 index 0000000000..a00a8e8b8a --- /dev/null +++ b/Bugs/mig @@ -0,0 +1,17 @@ +#!./perl + +$foo = <<EOF; +Subject: foobar +From: baz +EOF + +$* = 1; + +$pat = '^([*+&!]*)(Subject:)'; +#$pat =~ s/([a-zA-Z])/[\u$1\l$1]/g; +#print $pat; + +$foo =~ /$pat/g; + +print $', "\n"; + diff --git a/Bugs/myforeach b/Bugs/myforeach new file mode 100644 index 0000000000..2ebb663e59 --- /dev/null +++ b/Bugs/myforeach @@ -0,0 +1 @@ +sub foo { my $i; for $i (@bar) { } } diff --git a/Bugs/numkey b/Bugs/numkey new file mode 100644 index 0000000000..8d94cba91d --- /dev/null +++ b/Bugs/numkey @@ -0,0 +1,12 @@ +$zz = { 1, 9 }; +print %$zz; # wrong; outputs 9 + +print "\n"; + +$zz = { "1", 9 }; +print %$zz; # ok; outputs 19 + +print "\n"; + +%xx = ( 1, 9 ); +print %xx; # ok; outputs 19 diff --git a/Bugs/signedbits b/Bugs/signedbits new file mode 100644 index 0000000000..21412491b2 --- /dev/null +++ b/Bugs/signedbits @@ -0,0 +1,2 @@ +printf "%x\n", 0x40000000 | 0x00000010; +printf "%x\n", 0x80000000 | 0x00000010; diff --git a/Bugs/splitdump b/Bugs/splitdump new file mode 100644 index 0000000000..36d5c9dea0 --- /dev/null +++ b/Bugs/splitdump @@ -0,0 +1 @@ +0 + split diff --git a/Bugs/splitscalar b/Bugs/splitscalar new file mode 100644 index 0000000000..6da6d41209 --- /dev/null +++ b/Bugs/splitscalar @@ -0,0 +1 @@ +$_ = "a b c" ; $a = ( @b = split ) ; print "$a\n@b\n" diff --git a/Bugs/subform b/Bugs/subform new file mode 100644 index 0000000000..b27b8adb57 --- /dev/null +++ b/Bugs/subform @@ -0,0 +1,107 @@ +Replied: Wed, 02 Mar 94 09:29:46 -0800 +Replied: brad_figg@rainbow.mentorg.com ("Brad Figg") +Return-Path: brad_figg@rainbow.mentorg.com +Return-Path: <brad_figg@rainbow.mentorg.com> +Received: from mgc.mentorg.com by netlabs.com (4.1/SMI-4.1) + id AA15524; Wed, 2 Mar 94 09:17:50 PST +Received: from rainbow.mentorg.com by mgc.mentorg.com with SMTP + (16.6/15.5+MGC-TD 2.20) id AA04359; Wed, 2 Mar 94 09:16:55 -0800 +Received: from wv.mentorg.com by rainbow.mentorg.com with SMTP + (15.11.1.6/15.5+MGC-TD 2.08) id AA22830; Wed, 2 Mar 94 09:16:53 -0800 +Received: from em-wv02.MENTORG.COM by wv.mentorg.com (8.6.4/CF5.11R) + id JAA18865; Wed, 2 Mar 1994 09:16:51 -0800 +Received: from cynic.MENTORG.COM by em-wv02.MENTORG.COM (4.1/CF3.4) + id AA23300; Wed, 2 Mar 94 09:16:50 PST +Received: by cynic.MENTORG.COM (4.1/CF3.4) + id AA24503; Wed, 2 Mar 94 09:16:50 PST +From: brad_figg@rainbow.mentorg.com ("Brad Figg") +Message-Id: <9403020916.ZM24501@cynic> +Date: Wed, 2 Mar 1994 09:16:50 -0800 +X-Mailer: Z-Mail (3.0.0 15dec93) +To: lwall@netlabs.com +Subject: Perl5 Alpha 6 bug (subs & formats) +Content-Type: text/plain; charset=us-ascii +Mime-Version: 1.0 + + +The following works just fine as is with Perl 4 but doesn't work with +Perl5 Alpha 6 unless the format lines are moved outside the sub block. + + +Brad + +p.s. I'm not currently at a point where I can make the actual offer + but I'm just asking if you have any interest. I have access to + 'Purify' and 'Quantify' from Pure Software. I was thinking of + building Perl5 with these just to see what I'd get. Would you + be interested in the results? + + +-----------------------Error.pl--------------------------------- +###################################################################### +## Package Variables +## + +package Error; + +push( @main'Versions, '$Id: Error.pl,v 1.3 1994/02/13 00:26:00 bradf Exp $' ); + +$Strings[ ($None = 0) ] = + "Everythings OK"; +$Strings[ ($BadFileOpen = 0) ] = + "I was unable to open the file \'%s\' due to:\n$!"; +$Strings[ ($NoVersion = 0) ] = + "Unable to read the first four bytes from the file." . + " This probably means it is an empty file."; + +###################################################################### +## +## Emsg +## +## Print a formatted error message to STDERR. +## +## Args: 2 +## 1. An error message that may contain printf formatting strings. +## 2. A list of arguments to be used for the format string +## expansions. +## +## Returns: +## +## if successful: none +## if unsuccessful: none +## +## Calls: +## +## Requires: +## +## Notes: +## + +sub Emsg + { + local( $String, @Args ) = @_; + local( $Err ); + +format EFIRSTLINE = + *** Error: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +$_ + ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ +$_ +. + +format EBODY = + ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ +$_ +. + + + $~ = 'EFIRSTLINE'; + $Err = sprintf( $String, @Args ); + foreach (split( "\n", $Err )) { + if ( $_ eq '' ) { print( "\n" ); } + write; + $~ = 'EBODY'; + } + } +[Acked] + diff --git a/Bugs/substrdump b/Bugs/substrdump new file mode 100644 index 0000000000..aef3fe55ec --- /dev/null +++ b/Bugs/substrdump @@ -0,0 +1,2 @@ + $a="abc"; + substr(\$a,1,0)='a'; diff --git a/Bugs/zeroanonref b/Bugs/zeroanonref new file mode 100644 index 0000000000..fd6def99c1 --- /dev/null +++ b/Bugs/zeroanonref @@ -0,0 +1 @@ +$z = \'23' |