[18406] in Perl-Users-Digest
Perl-Users Digest, Issue: 574 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 27 11:10:43 2001
Date: Tue, 27 Mar 2001 08:10:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985709416-v10-i574@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 27 Mar 2001 Volume: 10 Number: 574
Today's topics:
Re: Using Sunfreeware's perl in place of Sun's perl <och@nym.alias.net>
Re: Using Sunfreeware's perl in place of Sun's perl (Garry Williams)
Re: Using Sunfreeware's perl in place of Sun's perl (Mike Horwath)
Re: What way is 'better' ? (Anno Siegel)
Wierd new response to old CGI script <ruhl@realrates.com>
Re: Wierd new response to old CGI script <bart.lateur@skynet.be>
XML Parser where do I start? <jxm96c@hotmail.com>
Re: XML Parser where do I start? <gus@black.hole-in-the.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Mar 2001 14:26:29 -0000
From: Och <och@nym.alias.net>
Subject: Re: Using Sunfreeware's perl in place of Sun's perl
Message-Id: <20010327142629.15126.qmail@nym.alias.net>
> Mike:
>
> Followups Trimmed.
Followups re-added.
This is an obscure problem (one hit on deja).
I'll be lucky if anyone in any of the groups can provide a correct answer.
>> Och:
>>
>> In a SolarisIA 8 environment, the perl that Sun distributes displays
>> the following errors when I invoke inn's mailpost
>>
>> Can't locate syslog.ph in @INC (did you run h2ph?) (@INC contains: /usr/perl5/5.
>> 00503/i86pc-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/i86pc-solaris
>> /usr/perl5/site_perl/5.005 .) at /usr/perl5/5.00503/Sys/Syslog.pm line 117.
>> BEGIN failed--compilation aborted at /usr/news/bin/mailpost line 15.
>>
>> Apparently perl displays this error because Sun used its proprietary
>> C compiler to create its perl distribution, but my host uses gcc.
> Are you smoking drugs?
>
> THe error is so clear!
>
> type, as root:
>
> # h2ph /usr/include/syslog.h
>
> and try your comand again.
>
> In fact, it even asks yo uif you have run h2ph yet!
# ./h2ph /usr/include/syslog.h
/usr/include/syslog.h -> /usr/include/syslog.ph
# cat zz | mailpost local.ipfilter
Can't locate syslog.ph in @INC (did you run h2ph?) (@INC contains: /usr/perl5/5.
00503/i86pc-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/i86pc-solaris
/usr/perl5/site_perl/5.005 .) at /usr/perl5/5.00503/Sys/Syslog.pm line 117.
BEGIN failed--compilation aborted at /usr/local/news/bin/mailpost line 15.# ls /usr/include/*.ph
/usr/include/*.ph: No such file or directory
# ls /usr/include/*.ph
/usr/include/*.ph: No such file or directory
Now, what was that bit about the error being so clear?
>> I changed cc to gcc in /usr/perl5/5.00503/i86pc-solaris/Config.pm,
>> but the error still occurs.
> That has nothing to do with it.
You don't know much about the Sun perl versus gcc perl problem in
Solaris do you?
_______________________________________________________________________
Och finger och@nym.alias.net for public key
Version: 2.6.2
iQCVAwUBOsCfMIk2xl+M24IFAQEonAP/WaCsxLQyindurjRZ4elus4Cy5jezNi2O
8RDFlwaJW0iPLwEV5M1GshkRU8XraUv0SL6yUX0AdWa2gFkRRl63CeLGB7T/6p3h
PmHgHX1EvO6zUIbxZ3vbiW13EScHARPMi5LYUtKJgUow9eURfKRVhL1L38uP1q2i
ca7K3SeJgjI=
=poxr
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 27 Mar 2001 15:47:19 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Using Sunfreeware's perl in place of Sun's perl
Message-Id: <slrn9c1dg7.f4o.garry@zfw.zvolve.net>
On 27 Mar 2001 05:50:26 -0000, Och <och@nym.alias.net> wrote:
>
> In a SolarisIA 8 environment, the perl that Sun distributes displays
> the following errors when I invoke inn's mailpost
>
> Can't locate syslog.ph in @INC (did you run h2ph?) (@INC contains: /usr/perl5/5.
> 00503/i86pc-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/i86pc-solaris
> /usr/perl5/site_perl/5.005 .) at /usr/perl5/5.00503/Sys/Syslog.pm line 117.
> BEGIN failed--compilation aborted at /usr/news/bin/mailpost line 15.
>
> Apparently perl displays this error because Sun used its proprietary
> C compiler to create its perl distribution, but my host uses gcc.
I would disagree. The C compiler is not involved here. The
interpreter simply cannot find syslog.ph.
> It also seems that a pkgrm SUNWpl5? fails because the Solaris 8
> kernel now depends upon perl.
That's interesting. How did you conclude that?
> How the heck can I install Sunfreeware's perl, compiled with gcc,
> if Sun's perl refuses to remove itself?
Installing a Perl distribution is straightforward. The default
configuration will want to install in /usr/local, but you can change
that to whatever you'd like. (See the installation documentation in
the perl distribution.)
> I changed cc to gcc in /usr/perl5/5.00503/i86pc-solaris/Config.pm,
> but the error still occurs.
That's a Bad Thing. The Sun compiler and gcc are quite incompatible
on their command lines. You will not (in general) get away with this
hack.
I encountered problems about a year ago, when I began using an
UltraSparc 10 that came with Solaris 8. I may have even run into the
same error -- I don't remember. I do remember not finding things I
expected to be included with perl. I concluded that the perl
installation was defective, obtained the latest distribution and built
perl using the Workshop 5.0 compiler. I removed the /bin/perl
(/usr/bin/perl) file that shipped with Solaris and replaced it with a
symbolic link to my installation. I've never looked back.
Hope this helps.
--
Garry Williams
------------------------------
Date: Tue, 27 Mar 2001 15:59:37 GMT
From: drechsau+usenet@yuck.net (Mike Horwath)
Subject: Re: Using Sunfreeware's perl in place of Sun's perl
Message-Id: <JN2w6.3337$SB2.606429@ruti.visi.com>
In news.software.nntp Och <och@nym.alias.net> wrote:
:> Mike:
:>
:> Followups Trimmed.
: Followups re-added.
And retrimmed.
This is a perl problem, not an INN problem.
: This is an obscure problem (one hit on deja).
deja is gone, how can you have one hit?
:)
:>> Och:
:>>
:>> In a SolarisIA 8 environment, the perl that Sun distributes displays
:>> the following errors when I invoke inn's mailpost
:>>
:>> Can't locate syslog.ph in @INC (did you run h2ph?) (@INC contains: /usr/perl
: 5/5.
:>> 00503/i86pc-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/i86pc-sola
: ris
:>> /usr/perl5/site_perl/5.005 .) at /usr/perl5/5.00503/Sys/Syslog.pm line 117.
:>> BEGIN failed--compilation aborted at /usr/news/bin/mailpost line 15.
:>>
:>> Apparently perl displays this error because Sun used its proprietary
:>> C compiler to create its perl distribution, but my host uses gcc.
:> Are you smoking drugs?
:>
:> THe error is so clear!
:>
:> type, as root:
:>
:> # h2ph /usr/include/syslog.h
:>
:> and try your comand again.
:>
:> In fact, it even asks yo uif you have run h2ph yet!
: # ./h2ph /usr/include/syslog.h
: /usr/include/syslog.h -> /usr/include/syslog.ph
What is your current directory?
: # cat zz | mailpost local.ipfilter
: Can't locate syslog.ph in @INC (did you run h2ph?) (@INC contains: /usr/perl5/5.
: 00503/i86pc-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/i86pc-solaris
: /usr/perl5/site_perl/5.005 .) at /usr/perl5/5.00503/Sys/Syslog.pm line 117.
: BEGIN failed--compilation aborted at /usr/local/news/bin/mailpost line 15.# ls /
: usr/include/*.ph
: /usr/include/*.ph: No such file or directory
: # ls /usr/include/*.ph
: /usr/include/*.ph: No such file or directory
: Now, what was that bit about the error being so clear?
[9:55am] 18 [/usr/perl5]:taranis# /usr/bin/perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=solaris, osvers=2.8, archname=i86pc-solaris
uname='sunos localhost 5.8 i86pc i386 i86pc '
hint=previous, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags=''
ccflags =''
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.00503/i86pc-solaris/CORE'
cccdlflags='-KPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Built under solaris
Compiled at Jan 8 2000 18:12:48
@INC:
/usr/perl5/5.00503/i86pc-solaris
/usr/perl5/5.00503
/usr/perl5/site_perl/5.005/i86pc-solaris
/usr/perl5/site_perl/5.005
.
[9:55am] 19 [/usr/perl5]:taranis# find . -name '*syslog*'
./5.00503/syslog.pl
[9:55am] 20 [/usr/perl5]:taranis# bin/h2ph /usr/include/syslog.h
/usr/include/syslog.h -> /usr/include/syslog.ph
[9:56am] 21 [/usr/perl5]:taranis# !fi
find . -name '*syslog*'
./5.00503/syslog.pl
./site_perl/5.005/i86pc-solaris/usr/include/syslog.ph
Things look fine to me.
[9:56am] 24 [/usr/perl5]:taranis# uname -a
SunOS taranis 5.8 Generic_108529-06 i86pc i386 i86pc
:>> I changed cc to gcc in /usr/perl5/5.00503/i86pc-solaris/Config.pm,
:>> but the error still occurs.
:> That has nothing to do with it.
: You don't know much about the Sun perl versus gcc perl problem in
: Solaris do you?
Obviously I do.
--
Mike Horwath Admin & Manager @ VISI.com WORK: drechsau@visi.com
IRC: Drechsau http://www.visi.com/ HOME: drechsau@geeks.org
The only Minnesota ISP with public statistics: http://noc.visi.com/
Garbage In -- Gospel Out. - berkeley fortune(6)
------------------------------
Date: 27 Mar 2001 08:50:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What way is 'better' ?
Message-Id: <99pk8p$eo8$1@mamenchi.zrz.TU-Berlin.DE>
According to Christoph Neubauer <christoph.neubauer@siemens.at>:
> Hi All !
>
> Let script1.pl be a Perl script, calling another script2.pl.
> Assume script2.pl is supplied with some arguments
> and does not produce any output to STDOUT.
>
> As far as I know, there are 2 ways of calling script2.pl within
> script1.pl
>
> 1.) `script2.pl @args`;
> (if $? != 0) {die "..."};
>
> 2.) ((system "script2.pl @args") == 0) or (die "...");
>
> What way is faster, 'better perl style', recommended, ...
Short answer: 2.
A longer answer can be found in the FAQ: "perldoc -q backticks" takes
you there.
Anno
------------------------------
Date: Tue, 27 Mar 2001 10:13:57 -0500
From: "Janet Ruhl" <ruhl@realrates.com>
Subject: Wierd new response to old CGI script
Message-Id: <99qb02$sh6$1@bob.news.rcn.net>
Folks,
In the past week I've gotten two messages from would-be customers who
received the following response after invoking my perl ordering script.
-----
cgi-lib.pl: Unknown Content-type:
application/x-www-form-urlencoded,
application/x-www-form-urlencoded
-----
This script which runs on a site hosted by OLM has been running for many
months without problems. And it is still working fine for lots of other
users--including me. I have been completely unable to duplicate this problem
coming in from my ISP.
cgi-lib.pl is referenced in a "require" statement that is the 3rd lind of
the script that is invoked. When the error occurs the script is not being
executed.
I'm thinking that the problem is probably a web hiccup, but getting two of
these reports in one week from customers, after never getting any, ever,
makes me wonder whether perhaps there are a bunch of other customers getting
the same response from whom I am not hearing.
I'm wondering if perhaps there might be some other explanation for this
error that some perl wizard out there would know.
Thanks for any help you can give me.
--Janet Ruhl
www.realrates.com
------------------------------
Date: Tue, 27 Mar 2001 15:47:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Wierd new response to old CGI script
Message-Id: <j5d1ctsb68f7jko2n5vpabu36o3rauh029@4ax.com>
Janet Ruhl wrote:
>In the past week I've gotten two messages from would-be customers who
>received the following response after invoking my perl ordering script.
>-----
>cgi-lib.pl: Unknown Content-type:
>application/x-www-form-urlencoded,
>application/x-www-form-urlencoded
That should teach you not to use cgi-lib.pl.
>I'm thinking that the problem is probably a web hiccup, but getting two of
>these reports in one week from customers, after never getting any, ever,
>makes me wonder whether perhaps there are a bunch of other customers getting
>the same response from whom I am not hearing.
>
>I'm wondering if perhaps there might be some other explanation for this
>error that some perl wizard out there would know.
It's much simpler than that: it's the new browsers. There are new
conventions in sending data from a web form to a CGI script, and
cgi-lib.pl doesn't know (yet) about those. BTW
"application/x-www-form-urlencoded" is nothing special. But cgi-lib.pl
doesn't know about it.
You should either upgrade to CGI.pm, or use one of the newer,
lighterweight, CGI.pm compatible, CGI request modules instead.
Excerpt from CGI.pm:
content_type()
Returns the content_type of data submitted in a POST, generally
multipart/form-data or application/x-www-form-urlencoded
See how common this is?
--
Bart.
------------------------------
Date: Tue, 27 Mar 2001 11:56:58 +0100
From: "Dr Joolz" <jxm96c@hotmail.com>
Subject: XML Parser where do I start?
Message-Id: <en_v6.34560$Q4.5993137@news2-win.server.ntlworld.com>
Dear all, I'm wondering if there's any place I can get myself started with
XML Parser? I don't even know how to use it or what it is for... the docs
included in the module doens't really clear my beginner's mind up...
Thanx,
Jules
***24 hours in a day...24 beers in a case...coincidence?***
------------------------------
Date: Tue, 27 Mar 2001 15:10:22 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: XML Parser where do I start?
Message-Id: <985705822.25615.0.nnrp-07.c29f015a@news.demon.co.uk>
In comp.lang.perl.modules Dr Joolz <jxm96c@hotmail.com> wrote:
> Dear all, I'm wondering if there's any place I can get myself started with
> XML Parser? I don't even know how to use it or what it is for... the docs
> included in the module doens't really clear my beginner's mind up...
Below is a simple example which takes an XML file of data and parses it
using XML::Parser
#!/usr/bin/perl -w
use XML::Parser;
use vars qq (%object_thingy);
$parser = new XML::Parser(ErrorContext=>1); # die() on XML errors.
$parser->setHandlers(Start=>\&foo_start,
Char=>\&foo_char,
End=>\&foo_end);
undef $/;
$parser->parse(<DATA>);
sub foo_start {
my ($parser,$element,@props) = @_;
my ($prop,$val,$count);
print "<$element> tag hit\n";
return undef unless ($element eq "stuff");
undef %object_thingy; # clear last foo we built.
# Run through the property/value pairs of the tag.
# <foo name='myname' this='that'>
for ($count = 0 ; $count < scalar(@props); $count++) {
$property = $props[$count];
$value = $props[++$count];
$object_thingy{$property} = $value;
}
}
sub foo_char {
my $parser = shift;
my $charstr = shift;
# This routine gets the text in between the starting and ending tags.
# for demo purposes we'll just stick it in the object_thiny hash.
$object_thingy{'TAGTEXT'} .= $charstr;
}
sub foo_end {
my ($parser,$tag) = @_;
return undef unless ($tag eq "stuff");
# End of tag function. We've got a complete 'foo' built now so
# print it out or dostuff() to it.
foreach (sort keys %object_thingy) {
print "The value of [",$_,"] is [", $object_thingy{$_},"]\n";
}
}
__DATA__
<?xml version="1.0"?>
<things>
<stuff name='mystuff' size='large'> My stuff is large </stuff>
<stuff name='otherstuff' size='small'> This stuff is small </stuff>
</things>
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 574
**************************************