[perl #36967] Pod/Perldoc.pm bug with -m switch

2005-08-21 Thread Steve Peters via RT
> [bepi - Sat Aug 20 15:45:51 2005]:
> 
> This is a bug report for perl from [EMAIL PROTECTED],
> generated with the help of perlbug 1.35 running under perl v5.8.7.
> 
> Pod/Perldoc.pm adds also .pod extension (to perldoc argument) only if:
> 
> 1) -m switch hasn't been specified
> 
> or
> 
> 2) for 'pod/' or 'pods/' subdirectories (even if -m switch has been
> specified).
> 
> Sincerely, I don't know if there's a directive and/or specification
> and/or a
> reason that suggests to put *.pod files (shipped in a distribution)
> into a pod/
> or pods/ subdirectory, but there are many CPAN modules that don't do
> it! :-)
> 
> So for example:
> 
>   %> perldoc -m perlboot
> 
> works well (in general with all core pods, since them lives under
> pods/
> directory), but:
> 
>   %> perldoc -m lwpcook
> 
> doesn't work (with the last you must have LWP installed in your
> system).
> 
> IMHO, 1) and 2) conditions are a nonsense together.
> 
> I've included a simple patch over Pod/Perldoc.pm 3.14 for checking
> also .pod (indipendently from -m switch presence).
> 
> Regards
> 
>   - Enrico
> 

I'm not sure that this is a problem.  Looking at perldoc -h, 

-m   Display module's file in its entirety

A POD file, is not, however, a module.  So, when I try "perldoc -m
lwpcook" it fails since no lwpcook.pm file exists.  When I try "perldoc
-m lwpcook.pm", the file is found right away and displayed.  


Re: [perl #36960] B::Deparse and constant folding

2005-08-21 Thread Rick Delaney
On Fri, Aug 19, 2005 at 02:06:25PM -0700, Colin Meyer wrote:
> While playing with constant folding and compiler optimizations, I
> noticed something funny about B::Deparse.
> 
> It seems to strip the conditionals off of some statements, implying
> that they will always be run. However, they do not get run.
> 
> 
> Here's my test files:
> 
> A.pm:
>   package A;
>   use constant DEBUG => 1;
>   1;
> 
> B.pm:
>   package B;
>   use constant DEBUG => 0;
>   1;

This is the problem here.  When you run it with -MO=Deparse, Deparse
loads the core B.pm so your B.pm is never loaded.  If you change the
package name to "J", everything works fine.


> test.pl:
>   #!/usr/local/bin/perl
>   
>   $\="\n"; 
>   use lib '.';
>   use A; # DEBUG == 1
>   use B; # DEBUG == 0

Try both ways with this addition:

BEGIN { warn "B loaded from $INC{'B.pm'}" }

>   use constant AorB  => A::DEBUG | B::DEBUG; # 1
>   use constant AandB => A::DEBUG & B::DEBUG; # 0
>   
>   print "A" if A::DEBUG;
>   print "B" if B::DEBUG;
>   if ( B::DEBUG ) { print "B" }
>   
>   print "AorB"  if AorB;
>   print "AandB" if AandB;
> 
> perl test.pl:
>   A
>   AorB
> 
> perl -MO=Deparse test.pl:
> 
>   test syntax OK
>   $\ = "\n";
>   use lib ('.');
>   use A;
>   use B;
>   use constant ('AorB', 1 | 0);
>   use constant ('AandB', 1 & 0);
>   print 'A';
>   print 'B';
>   do {
>   print 'B'
>   };
>   print 'AorB';
>   '???';
> 

-- 
Rick Delaney
[EMAIL PROTECTED]


Term::ANSIColor 1.10

2005-08-21 Thread Russ Allbery
The URL

ftp://ftp.eyrie.org/pub/software/modules/ANSIColor-1.10.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/R/RR/RRA/ANSIColor-1.10.tar.gz
  size: 11798 bytes
   md5: e71f4780026cd93c6a01b32ce98b541c

Changes from the previous release:

2005-08-21  Russ Allbery  <[EMAIL PROTECTED]>

* ANSIColor.pm: Version 1.10 released.

* ANSIColor.pm (colored): Fix the $EACHLINE support to work
properly with a line consisting solely of "0".  Remove Zenin's
now-defunct e-mail address from the documentation.
* test.pl: Test 0 and the empty string in combination with
$EACHLINE.

* tests/ansicolor: Add terminal test file from Joe Smith.
* tests/vt100-torture: Likewise.
* tests/README: Add an explanation of the test files.

-- 
Russ Allbery ([EMAIL PROTECTED]) 


[PATCH blead] Re: [perl #36959] List Constructor Operator - Undefined Values

2005-08-21 Thread Rick Delaney
On Sun, Aug 21, 2005 at 01:00:07AM -0700, Yitzchak Scott-Thoennes wrote:
> 
> IIRC (don't have time to check the code now), magic only results in
> the private flags being set (e.g. SvIOKp), so it all Just Works (TM).

Ah, thanks.  I could have sworn that I saw IOK with Devel::Peek in my
preliminary tests but I must have been seeing things since I can't
reproduce now.  The problem is, as you stated, a missing mg_get.  Patch
included.

-- 
Rick Delaney
[EMAIL PROTECTED]


diff -rpuN perl-current/pp_ctl.c perl-current-dev/pp_ctl.c
--- perl-current/pp_ctl.c   2005-08-07 06:39:09.0 -0400
+++ perl-current-dev/pp_ctl.c   2005-08-21 14:52:48.145320881 -0400
@@ -1843,6 +1843,8 @@ PP(pp_enteriter)
if (SvTYPE(cx->blk_loop.iterary) != SVt_PVAV) {
dPOPss;
SV *right = (SV*)cx->blk_loop.iterary;
+   SvGETMAGIC(sv);
+   SvGETMAGIC(right);
if (RANGE_IS_NUMERIC(sv,right)) {
if ((SvOK(sv) && SvNV(sv) < IV_MIN) ||
(SvOK(right) && SvNV(right) >= IV_MAX))
diff -rpuN perl-current/t/op/range.t perl-current-dev/t/op/range.t
--- perl-current/t/op/range.t   2004-03-18 15:53:32.0 -0500
+++ perl-current-dev/t/op/range.t   2005-08-21 14:21:37.127953275 -0400
@@ -7,7 +7,7 @@ BEGIN {
 
 use Config;
 
-print "1..37\n";
+print "1..45\n";
 
 print join(':',1..5) eq '1:2:3:4:5' ? "ok 1\n" : "not ok 1\n";
 
@@ -140,3 +140,51 @@ print join(":", map "[$_]", @foo) eq '' 
 
 @foo=(); push @foo, $_ for undef..undef;
 print join(":", map "[$_]", @foo) eq '[]' ? "ok 37\n" : "not ok 37\n";
+
+# again with magic
+{
+my @a = (1..3);
+@foo=(); push @foo, $_ for undef..$#a;
+print join(":", @foo) eq '0:1:2' ? "ok 38\n" : "not ok 38\n";
+}
+{
+my @a = ();
+@foo=(); push @foo, $_ for $#a..undef;
+print join(":", @foo) eq '-1:0' ? "ok 39\n" : "not ok 39\n";
+}
+{
+local $1;
+"2" =~ /(.+)/;
+@foo=(); push @foo, $_ for undef..$1;
+print join(":", @foo) eq '0:1:2' ? "ok 40\n" : "not ok 40\n";
+}
+{
+local $1;
+"-2" =~ /(.+)/;
+@foo=(); push @foo, $_ for $1..undef;
+print join(":", @foo) eq '-2:-1:0' ? "ok 41\n" : "not ok 41\n";
+}
+{
+local $1;
+"B" =~ /(.+)/;
+@foo=(); push @foo, $_ for undef..$1;
+print join(":", map "[$_]", @foo) eq '[]' ? "ok 42\n" : "not ok 42\n";
+}
+{
+local $1;
+"B" =~ /(.+)/;
+@foo=(); push @foo, $_ for ""..$1;
+print join(":", map "[$_]", @foo) eq '[]' ? "ok 43\n" : "not ok 43\n";
+}
+{
+local $1;
+"B" =~ /(.+)/;
+@foo=(); push @foo, $_ for $1..undef;
+print join(":", map "[$_]", @foo) eq '' ? "ok 44\n" : "not ok 44\n";
+}
+{
+local $1;
+"B" =~ /(.+)/;
+@foo=(); push @foo, $_ for $1.."";
+print join(":", map "[$_]", @foo) eq '' ? "ok 45\n" : "not ok 45\n";
+}


Re: 25309 does not compile

2005-08-21 Thread Andreas J. Koenig
> On Sat, 20 Aug 2005 22:14:28 +0200, [EMAIL PROTECTED] (Andreas J. Koenig) 
> said:

  > 25308 was compiling OK, but 509 says:
  > [...]
  > /home/src/perl/repoperls/[EMAIL PROTECTED]/sv.c:3277: undefined reference 
to `svWupgrade'

Please ignore this mail. There was some local issue that I could not
yet determine. The word sv_upgrade somehow became svWupgrade in my
copy. After re-syncing everything's fine.

Sorry for the noise,
-- 
andreas


Re: [EMAIL PROTECTED] t/op/arith.t fix for VMS with IEEE float

2005-08-21 Thread Nicholas Clark
On Sat, Aug 20, 2005 at 11:21:44PM -0400, John E. Malmberg wrote:
> If VMS is configured to use IEEE float, test 145 was not run.

Thanks, applied (25311)

Nicholas Clark


Re: [EMAIL PROTECTED] lib/ExtUtils/t/Constant.t VMS fixes

2005-08-21 Thread Nicholas Clark
On Sun, Aug 21, 2005 at 12:31:17AM -0400, John E. Malmberg wrote:
> Fix for correct names for the descrip.mms file used with MMS/MMK on VMS.
> 
> Per review of Andy Lester, also fixed the error message from failed renames.
> 
> Also preparation for use of other make programs on VMS with the 
> assumption that no there will be no port of MMK to other platforms even 
> though it is open source.

Seems a reasonable assumption.

Thanks, applied (25310)

Nicholas Clark


Re: Building 25309 on VAX (OpenVMS 7.2) not ok

2005-08-21 Thread Abe Timmerman
Op een zonnige zomerdag (Sunday 21 August 2005 15:39), schreef Abe Timmerman:

> Hi all,
>
> I still cannot build bleadperl on the VAX:
>
> CC/DECC/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=GLOBALS.obj/NoList/
>FLOAT=G_FLOAT/Define=PERL_CORE GLOBALS.C
> EXTCONST char* const PL_sig_name[] = { SIG_NAME };
> ...^
> %CC-E-UNDECLARED, In the initializer for PL_sig_name[0], "$sig_name_init"
> is not declared.
> At line number 3640 in
[snip]
> This bit in the @configure output might be related:
>
> Good, found drand48().
> %DCL-W-UNDSYM, undefined symbol - check validity and spelling
>  \PSNWRT\

It did, patch fixes it:

--- configure.com.orig  Sun Aug 21 16:26:55 2005
+++ configure.com   Sun Aug 21 16:27:26 2005
@@ -4926,7 +4926,7 @@
 $  sig_size="37"
 $   else
 $  sig_name = sig_name1 + sig_name2 + sig_name3 + sig_namert
-$   sig_name_init = psnwc1 + psnwc2 + psnwc3 + psnwrt
+$   sig_name_init = psnwc1 + psnwc2 + psnwc3 + psnwcrt
 $  sig_num = sig_num1 + sig_numrt
 $  sig_num_init = sig_num_init1 + sig_num_initrt
 $  sig_size="36"

Good luck,

Abe
-- 
Well, dereferencing that (as CvGV() would do) leads nowhere.  Or, as
the Ten Commandments for C Programmers quoth, "Thou shalt not follow
the NULL pointer, for chaos and madness await thee at its end."
   -- Jarkko Hietaniemi on p5p @ 2002-05-14



Building 25309 on VAX (OpenVMS 7.2) not ok

2005-08-21 Thread Abe Timmerman
Hi all,

I still cannot build bleadperl on the VAX:

CC/DECC/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=GLOBALS.obj/NoList/FLOAT=G_FLOAT/Define=PERL_CORE
 
GLOBALS.C
EXTCONST char* const PL_sig_name[] = { SIG_NAME };
...^
%CC-E-UNDECLARED, In the initializer for PL_sig_name[0], "$sig_name_init" is
 not declared.
At line number 3640 in 
DISK$USER_2:[TIMMERMAN.KLAD.PERL-CURRENT]
PERL.H;1.

 */
%VCG-I-NOBJECT, No object file produced.
At line number 65 in 
DISK$USER_2:[TIMMERMAN.KLAD.PERL-CURRENT]GL
OBALS.C;1.

%VCG-I-SUMMARY, Completed with 1 error(s), 0 warning(s), and
1 informational messages.
At line number 65 in 
DISK$USER_2:[TIMMERMAN.KLAD.PERL-CURRENT]GL
OBALS.C;1.

%MMK-F-ERRUPD, error status %X102A occurred when updating target 
GLOBALS.OBJ


This bit in the @configure output might be related:

Good, found drand48().
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
 \PSNWRT\
tzname[] found.
Checking whether your NVs can preserve your UVs...
Checking if kill() uses SYS$FORCEX or can't be called from a signal handler...
Nope, it doesn't.
Creating CONFIG.SH...
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
 \SIG_NAME_INIT\
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
 \TMP\
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
Adding VMS specific preprocessor commands.

HTH +
Good luck,

Abe
-- 
[ About the taint pragma proposal ]
"Mommy, mommy, look!  I'm driving my bicycle without my hands!"

"Mommah, mommah, mook! I'm mrivin my micicl mimof my meemh!""

   -- Jarkko Hietaniemi on p5p @ 2001-12-13



Re: 25309 does not compile

2005-08-21 Thread Philip M. Gollucci

Nicholas Clark wrote:

I don't see this when I try a clean build of blead from rsync.

Despite my recent other problems, 25309 compiles for me.

--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: 25309 does not compile

2005-08-21 Thread Nicholas Clark
On Sat, Aug 20, 2005 at 10:14:28PM +0200, Andreas J. Koenig wrote:
> 25308 was compiling OK, but 509 says:
> 
> `sh  cflags "optimize='-g'" pp_sort.o`  pp_sort.c
>   CCCMD =  cc -DPERL_CORE -c -DDEBUGGING -fno-strict-aliasing -pipe 
> -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE 
> -D_FILE_OFFSET_BITS=64 -g  -Wall
> rm -f libperl.a
> /usr/bin/ar rcu libperl.a perl.o  gv.o toke.o perly.o op.o pad.o regcomp.o 
> dump.o util.o mg.o reentr.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o 
> pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o 
> xsutils.o globals.o perlio.o perlapi.o numeric.o locale.o pp_pack.o pp_sort.o 
> `sh  cflags "optimize='-g'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
>   CCCMD =  cc -DPERL_CORE -c -DDEBUGGING -fno-strict-aliasing -pipe 
> -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE 
> -D_FILE_OFFSET_BITS=64 -g  -Wall
> opmini.c: In function 'Perl_newCONSTSUB':
> opmini.c:4611: warning: null argument where non-null required (argument 1)
> cc -L/usr/local/lib -o miniperl \
> miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc 
> libperl.a(sv.o): In function `Perl_sv_2pv_flags':
> /home/src/perl/repoperls/[EMAIL PROTECTED]/sv.c:3277: undefined reference to 
> `svWupgrade'
> collect2: ld returned 1 exit status
> make: *** [miniperl] Error 1

I don't see this when I try a clean build of blead from rsync.

Moreover, I'm not sure how sv.c got changed, given that patch 25309 is solely
whitespace and solely in POSIX.xs:

Change 25309 by [EMAIL PROTECTED] on 2005/08/19 21:19:37

Subject: [PATCH ext/POSIX/POSIX.xs] Whitespace
From: Abigail <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 23 Jul 2005 02:32:35 +0200

Affected files ...

... //depot/perl/ext/POSIX/POSIX.xs#139 edit

Differences ...

 //depot/perl/ext/POSIX/POSIX.xs#139 (text) 

@@ -1408,8 +1408,8 @@
 * essentially meaningless anyway.
 */
RETVAL = sigaction(sig, & act, (struct sigaction *)0);
-   if(RETVAL == -1)
-   XSRETURN_UNDEF;
+   if(RETVAL == -1)
+   XSRETURN_UNDEF;
}
 
LEAVE;



I'm confused.

Nicholas Clark


[PATCH] B::TerseSize.pm updates for mod_perl2 RC5+ compatability

2005-08-21 Thread Philip M. Gollucci

Hi,

This patch does the following:

o add an MP2 constant to check for MP2 throughout
o up the version from 0.04 to 0.05
o accounts for the 
s/Apache->request/Apache2::RequestUtil->request()->location()/
  mp2 RC5+ API rename
o in mp2, Apache::Status is called Apache2::Status
o Clone Apache::Status::noh_fileline as Apache2::Status::noh_fileline
  a. $r->args() doesn't work as in MP1.  This is in libapreq2, but we can use
 CGI.pm as its in PERL core.
  b. s/$r->send_http_header()/$r->content_type()/
o fix the Apache2::Status menu entry

Checked against:
perl 5.8.7
apache2 svn prefork
mp2 SVN
FreeBSD 5.4-RELEASE

P.S.
  Once you get this stuff working, its freaking cool!

--- TerseSize.pmSat Mar 31 16:07:44 2001
+++ TerseSize.pm.newSun Aug 21 05:53:05 2005
@@ -9,6 +9,7 @@

 use strict;
 use constant IS_MODPERL => $ENV{MOD_PERL};
+use constant MP2=> $ENV{MOD_PERL_API_VERSION} == 2 ? 1 : 0;

 use B ();
 use B::Asmdata qw(@specialsv_name);
@@ -16,7 +17,7 @@

 {
 no strict;
-$VERSION = '0.04';
+$VERSION = '0.05';
 }

 my $opcount;
@@ -315,7 +316,7 @@
 my $window = sprintf "offset=%d&len=%d", $line - 100, $line + 100;
 my $args = sprintf "noh_fileline=1&filename=%s&line=%d&$window",
 cop_file($curcop), $line;
-my $uri = Apache->request->location;
+my $uri = MP2 ? Apache2::RequestUtil->request()->location() : 
Apache->request->location;
 $linestr = qq($linestr);
 }

@@ -515,6 +516,69 @@
 0;
 }

+sub Apache2::Status::noh_fileline {
+my $r = shift;
+my $args = $r->args;
+
+require CGI;
+my $CGI = CGI->new($args);
+my %params = map { $_ => $CGI->param($_) } $CGI->param();
+
+my $offset = $params{offset} || 0;
+my $len = $params{len} || 0;
+
+local *FH;
+my $filename = $params{filename};
+$r->content_type('text/html');
+
+unless (Apache2::Status::status_config($r, "StatusTerseSize")) {
+print "sorry, StatusTerseSize not enabled\n";
+return 0;
+}
+
+unless (exists $main::{"_<$filename"}) {
+#useithreads doesnt gv_fetchfile()
+my $in_inc = 0;
+for (keys %INC) {
+if ($INC{$_} eq $filename) {
+$in_inc = 1;
+$main::{"_<$filename"} = $_;
+last;
+}
+}
+unless ($in_inc) {
+print "sorry, '$filename' is not a file used by Perl\n";
+return 0;
+}
+}
+
+my $i = 0;
+$r->print('');
+if ($offset > 0) {
+printf "%4d..%d [...]\n", 1, $offset-1;
+}
+open FH, $filename or die $!;
+while () {
+$i++;
+next if $len > 0 and $i > $len;
+next if $offset > 0 and $i < $offset;
+chomp;
+s/^\t//; #indent proper
+my $lineno = sprintf "%4d", $i;
+B::Size::escape_html(\$_);
+my $line = ($i == $params{line}) ?
+  \qq($_) : \$_;
+print qq($lineno: $$line\n);
+
+}
+if ($len > 0 and $i > $len) {
+printf "%4d..%d [...]\n", $len+1, $i;
+}
+close FH;
+
+0;
+}
+
 sub max {
 my($cur, $maybe) = @_;
 $maybe > $cur ? $maybe : $cur;
@@ -547,8 +611,15 @@
 sub status_memory_usage {
 my($r, $q) = @_;

-unless (Apache::Status::status_config($r, "StatusTerseSize")) {
-return ["StatusTerseSize is not enabled"];
+if (MP2) {
+unless (Apache2::Status::status_config($r, "StatusTerseSize")) {
+return ["StatusTerseSize is not enabled"];
+}
+}
+else {
+unless (Apache::Status::status_config($r, "StatusTerseSize")) {
+return ["StatusTerseSize is not enabled"];
+}
 }

 unless ($r->dir_config("StatusTerseSizeMainSummary")) {
@@ -578,10 +649,18 @@
 [EMAIL PROTECTED];
 }

-Apache::Status->menu_item(
-'status_memory_usage' => "Memory Usage",
-\&status_memory_usage,
-) if IS_MODPERL and Apache->module("Apache::Status");
+if (MP2) {
+Apache2::Status->menu_item(
+'status_memory_usage' => "Memory Usage",
+\&status_memory_usage,
+);
+}
+elsif (IS_MODPERL and Apache->module("Apache::Status")) {
+Apache::Status->menu_item(
+'status_memory_usage' => "Memory Usage",
+\&status_memory_usage,
+);
+}

 1;


--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: [perl #36959] List Constructor Operator - Undefined Values

2005-08-21 Thread Yitzchak Scott-Thoennes
On Sat, Aug 20, 2005 at 12:43:03AM -0400, Rick Delaney wrote:
> On Fri, Aug 19, 2005 at 05:30:41PM -0700, Yitzchak Scott-Thoennes wrote:
> > On Fri, Aug 19, 2005 at 01:35:49PM -0700, Chris Unger wrote:
> > > 
> > > my @array = (1, 2); # this means $#array is set to 1
> > > 
> > > for $i ($value1..$#array) { # note that $value1 is undefined
> > >print "Loop 1: $i\n";
> > > }
> > > 
> > > print "\n";
> > > 
> > > for $i ($value2..$#array) { # note $value2 is also undefined
> > >print "Loop 2: $i\n";
> > > }
> > 
> > Sounds like a missing mg_get somewhere.
> 
> Looks like it might be all over the place.  From sv.h:
> 
> /* Let us hope that bitmaps for UV and IV are the same */
> #define SvIV(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))
> #define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
> #define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv))
> 
> #define SvIV_nomg(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv_flags(sv, 0))
> #define SvUV_nomg(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv_flags(sv, 0))
> 
> Aren't those first three going to return the old un-mg_getted value
> quite often?  Should they just be
> 
> #define SvIV(sv) sv_2iv(sv)
> #define SvUV(sv) sv_2uv(sv)
> #define SvNV(sv) sv_2nv(sv)
> 
> or is it the responsibility of setters to do SvNIOK_off?

IIRC (don't have time to check the code now), magic only results in
the private flags being set (e.g. SvIOKp), so it all Just Works (TM).


[perl #36969] Syntax error crashing perl-5.8.6

2005-08-21 Thread via RT
# New Ticket Created by  [EMAIL PROTECTED] 
# Please include the string:  [perl #36969]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=36969 >



This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.6.


-
[Please enter your report here]

Source w/syntax error causes crash of Perl.

Unfortunately unable to minimize some reproducible case. It occurs in mod_perl
environment. Prepared reproducibility binary kit (Fedora Core 4 based):

http://www.jankratochvil.net/priv/perl-semicolon-crash-2005082100-chrooted.tar.gz

Everything contained inside, reproducible by:
chroot /tmp/chrooted/ /usr/sbin/httpd -d 
/home/lace/www/engine/etc/httpd -DPERL -X

Tried also perl-5.8.7 (ported myself) and it still crashes. All the binaries
tried only in their Fedora Core 4 variants.

Source fix to avoid this bug:
--- home/lace/www/www.jankratochvil.net/project/captive/CVS.pm-orig 
2005-08-21 11:00:52.058785000 +0900
+++ home/lace/www/www.jankratochvil.net/project/captive/CVS.pm  2005-08-21 
11:01:02.607094776 +0900
@@ -99,7 +99,7 @@
.'requirement: '

.a_href('http://linux-ntfs.sourceforge.net/downloads.html#downloads','ntfsprogs')
.' '.$format.' ≥ 1.8.0'
-   .'';
+   .''
.'';
};
 

Extracted relevant part from gdb(1):

#0  Perl_pad_free (my_perl=0x8390f10, po=29) at pad.c:1171
1171SvPADTMP_off(PL_curpad[po]);
(gdb) bt
#0  Perl_pad_free (my_perl=0x8390f10, po=29) at pad.c:1171
#1  0x00e1fafa in Perl_op_clear (my_perl=0x8390f10, o=0x8878480) at op.c:516
#2  0x00e1fe49 in Perl_op_free (my_perl=0x8390f10, o=0x8878480) at op.c:380
#3  0x00e1fe04 in Perl_op_free (my_perl=0x8390f10, o=0x88784a8) at op.c:368
#4  0x00e1fe04 in Perl_op_free (my_perl=0x8390f10, o=0x88a7ac8) at op.c:368
#5  0x00e1fe04 in Perl_op_free (my_perl=0x8390f10, o=0x88a7b10) at op.c:368
#6  0x00e1fe04 in Perl_op_free (my_perl=0x8390f10, o=0x88a7aa0) at op.c:368
#7  0x00e2daff in Perl_newATTRSUB (my_perl=0x8390f10, floor=293, o=0x88a74a0, 
proto=0x0, attrs=0x0, block=0x88a7aa0)
at op.c:4376
#8  0x00e1d536 in Perl_yyparse (my_perl=0x8390f10) at perly.y:355
#9  0x00e95628 in S_doeval (my_perl=0x8390f10, gimme=0, startop=0x0, 
outside=0x0, seq=137958892) at pp_ctl.c:2847
#10 0x00e9c277 in Perl_pp_require (my_perl=0x8390f10) at pp_ctl.c:3344
#11 0x003e5026 in modperl_perl_global_request_restore () from 
/home/lace/www/engine/etc/httpd/modules/mod_perl.so
#12 0x00e436e1 in Perl_runops_debug (my_perl=0x8390f10) at dump.c:1449
#13 0x00df0b9e in S_call_body (my_perl=0x8390f10, myop=0x19, is_eval=58) at 
perl.c:2299
#14 0x00df3c73 in Perl_eval_sv (my_perl=0x8390f10, sv=0x83a37a0, flags=2) at 
perl.c:2363
#15 0x003db8f8 in modperl_require_module () from 
/home/lace/www/engine/etc/httpd/modules/mod_perl.so
#16 0x003d6d0d in modperl_cmd_modules () from 
/home/lace/www/engine/etc/httpd/modules/mod_perl.so
#17 0x00d52e02 in ap_add_named_module () from /usr/sbin/httpd
#18 0x00d532f9 in ap_walk_config () from /usr/sbin/httpd
#19 0x00d53839 in ap_process_config_tree () from /usr/sbin/httpd
#20 0x00d5766b in main () from /usr/sbin/httpd
(gdb) p my_perl->Tcurpad[po]
$1 = (SV *) 0x19
(gdb) up
#1  0x00e1fafa in Perl_op_clear (my_perl=0x8390f10, o=0x8878480) at op.c:516
516 pad_free(o->op_targ);
(gdb) p *o
$2 = {op_next = 0x8878460, op_sibling = 0x8878460, op_ppaddr = 0xe5a962 
, op_targ = 29, op_type = 66, 
  op_seq = 0, op_flags = 70 'F', op_private = 2 '\002'}
(gdb) p *o->op_next
$3 = {op_next = 0x88784a8, op_sibling = 0x0, op_ppaddr = 0xe5a3c0 
, op_targ = 0, op_type = 5, op_seq = 0, 
  op_flags = 2 '\002', op_private = 0 '\0'}



[Please do not change anything below this line]
-
---
Flags:
category=core
severity=low
---
This perlbug was built using Perl v5.8.6 in the Red Hat build system.
It is being executed now by Perl v5.8.6 - Wed May 18 18:20:12 EDT 2005.

Site configuration information for perl v5.8.6:

Configured by Red Hat, Inc. at Wed May 18 18:20:12 EDT 2005.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
osname=linux, osvers=2.4.21-27.0.2.elsmp, archname=i386-linux-thread-multi
uname='linux decompose.build.redhat.com 2.4.21-27.0.2.elsmp #1 smp wed jan 
12 23:35:44 est 2005 i686 i686 i386 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables 
-Dversion=5.8.6 -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red 
Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr

25309 does not compile

2005-08-21 Thread Andreas J. Koenig
25308 was compiling OK, but 509 says:

`sh  cflags "optimize='-g'" pp_sort.o`  pp_sort.c
  CCCMD =  cc -DPERL_CORE -c -DDEBUGGING -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -g  -Wall
rm -f libperl.a
/usr/bin/ar rcu libperl.a perl.o  gv.o toke.o perly.o op.o pad.o regcomp.o 
dump.o util.o mg.o reentr.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o 
pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o 
globals.o perlio.o perlapi.o numeric.o locale.o pp_pack.o pp_sort.o 
`sh  cflags "optimize='-g'" opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
  CCCMD =  cc -DPERL_CORE -c -DDEBUGGING -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -g  -Wall
opmini.c: In function 'Perl_newCONSTSUB':
opmini.c:4611: warning: null argument where non-null required (argument 1)
cc -L/usr/local/lib -o miniperl \
miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc 
libperl.a(sv.o): In function `Perl_sv_2pv_flags':
/home/src/perl/repoperls/[EMAIL PROTECTED]/sv.c:3277: undefined reference to 
`svWupgrade'
collect2: ld returned 1 exit status
make: *** [miniperl] Error 1



-- 
andreas


[perl #36967] Pod/Perldoc.pm bug with -m switch

2005-08-21 Thread via RT
# New Ticket Created by  Enrico Sorcinelli 
# Please include the string:  [perl #36967]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=36967 >


This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.7.

Pod/Perldoc.pm adds also .pod extension (to perldoc argument) only if:

1) -m switch hasn't been specified

or

2) for 'pod/' or 'pods/' subdirectories (even if -m switch has been specified).

Sincerely, I don't know if there's a directive and/or specification and/or a
reason that suggests to put *.pod files (shipped in a distribution) into a pod/
or pods/ subdirectory, but there are many CPAN modules that don't do it! :-)

So for example:

%> perldoc -m perlboot

works well (in general with all core pods, since them lives under pods/
directory), but:

%> perldoc -m lwpcook

doesn't work (with the last you must have LWP installed in your system).

IMHO, 1) and 2) conditions are a nonsense together.

I've included a simple patch over Pod/Perldoc.pm 3.14 for checking
also .pod (indipendently from -m switch presence).

Regards

- Enrico

---
Flags:
category=library
severity=low
---
Site configuration information for perl v5.8.7:

Configured by bepi at Thu Aug  4 15:55:39 CEST 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
osname=linux, osvers=2.4.22, archname=i686-linux-thread-multi
uname='linux helena 2.4.22 #6 tue sep 2 17:43:01 pdt 2003 i686 unknown 
unknown gnulinux '
config_args='-des -Dprefix=/disk2/local/perl-5.8.7 -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.2.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.2'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.8.7:
/disk2/local/perl-5.8.7/lib/5.8.7/i686-linux-thread-multi
/disk2/local/perl-5.8.7/lib/5.8.7
/disk2/local/perl-5.8.7/lib/site_perl/5.8.7/i686-linux-thread-multi
/disk2/local/perl-5.8.7/lib/site_perl/5.8.7
/disk2/local/perl-5.8.7/lib/site_perl
.

---
Environment for perl v5.8.7:
HOME=/home/bepi
LANG=C
LANGUAGE (unset)
[EMAIL PROTECTED]
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt-3.2.1/bin:.
PERL_BADLANG (unset)
SHELL=/bin/bash



Perldoc.pm-3.14-switchm_patch
Description: Binary data


[PATCH lib/CPAN.pm] Make curl follow redirects

2005-08-21 Thread Michael G Schwern
curl won't follow redirects unless specificly told to do so with the -L
flag.  CPAN.pm currently doesn't give it this flag so it can't load from
things like http://search.cpan.org/CPAN/

Patch attached.

-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
ROCKS FALL! EVERYONE DIES!
http://www.somethingpositive.net/sp05032002.shtml
--- lib/CPAN.pm 2005/08/21 07:12:45 1.1
+++ lib/CPAN.pm 2005/08/21 07:13:37
@@ -2653,7 +2653,9 @@
$src_switch = " -c";
   } elsif ($f eq "wget"){
 $src_switch = " -O -";
- }
+  } elsif ($f eq 'curl'){
+$src_switch = ' -L';
+  }
 
  my($chdir) = "";
  my($stdout_redir) = " > $asl_ungz";