[16038] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3450 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 22 06:05:33 2000

Date: Thu, 22 Jun 2000 03:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961668315-v9-i3450@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 22 Jun 2000     Volume: 9 Number: 3450

Today's topics:
    Re: Accessing config files from CGI scripts. <stephenh@esec.com.au>
    Re: Attempting to parse malformed XML <peter@accesss.com.au>
    Re: Do any of you know how to do this? <godzilla@stomp.stomp.tokyo>
    Re: Do any of you know how to do this? <rob13@rock13.com>
        GCC Installation <r51692@email.sps.mot.com>
    Re: How can I get perl (cgi) html to work on the OS Sea <gellyfish@gellyfish.com>
    Re: I need to get better at Perl <gellyfish@gellyfish.com>
        Its Late... Im really Tired... drew@i4free.co.nz
    Re: Know of any good perl books? (Bart Lateur)
    Re: Know of any good perl books? <rob13@rock13.com>
    Re: Looping through records in an array scarey_man@my-deja.com
    Re: LWP and HTTPS fail <gellyfish@gellyfish.com>
    Re: Need app to generate perl for windows (IQnegativeOne)
    Re: Newbie question about subroutines... <vhatz@ccf.auth.gr>
    Re: Number or string item in an array? (Bart Lateur)
        Perl contracting <se97hs@dmu.ac.uk>
    Re: perl reference challenge: (Bart Lateur)
    Re: Perl, CGI, Browser differences <barrowman_99@yahoo.com>
    Re: Perl, CGI, Browser differences <barrowman_99@yahoo.com>
    Re: ppm: Can't find unicode character property definiti <peter@accesss.com.au>
    Re: Problem installing CPAN Date::Calc gevens@my-deja.com
        Problems gettting starting with perLdap under ActivePer <cmullNOcmSPAM@austin.rr.com.invalid>
    Re: q: next pair key in a hash (Charles DeRykus)
    Re: q: next pair key in a hash <gellyfish@gellyfish.com>
        regex engin's undocumented behaviour? victor@catchacorp.com
    Re: Setting locale failed. <gellyfish@gellyfish.com>
    Re: simple array question (Bart Lateur)
    Re: simple array question (Bart Lateur)
    Re: Simple Reg Expression Question (Bart Lateur)
    Re: strict and @ISA (Bart Lateur)
        Swapping a picture using perl on error. <egberts@mac.com>
    Re: Sys::Syslog & _PATH_LOG <gellyfish@gellyfish.com>
    Re: Why cant a cgi and module use the same library? (Bart Lateur)
    Re: XML Schema and datatypes with Perl <peter@accesss.com.au>
        zope, python vs apache, perl amitr@w-o-i.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 22 Jun 2000 17:50:06 +1000
From: Stephen Henwood <stephenh@esec.com.au>
Subject: Re: Accessing config files from CGI scripts.
Message-Id: <3951C52E.4281D77@esec.com.au>

Drew Simonis wrote:

> Stephen Henwood wrote:
> >
> > Does anybody have a neat way of accessing config files from a
> > Perl/CGI script ( running on Linux/Apache)
> >
>
> Let me see if I am understanding this correctly.
>
> You want to have a script that (for example) queries data from a
> database.  Items like DB user name and password will be in an
> external file?
>
> What have you tried so far?  If I am reading this correctly,
> its a really easy task.  Create a file of the proper format,
> maybe something like:
>
> db_users:
>
> database_name:username:password
>
> or whatever, really.  Then your Perl script can open() the file,
> split() the lines into an array or strings and then use those array
> values/strings in the main body.  Am I on the right track?
>
> open DB_CONFIG, "db_users" or die "can't read from db_users: $!\n";
>
> while (<DB_CONFIG>)
> {
>         if ($_ =~ /$web_supplied_username/)
>         {
>                 my ($dsn, $username, $password) = split(/:/, $_);
>         }
> }
>
>
> Or something.  Let me know if I'm off by a mile.

Ok, you're on the right track but you really haven't addressed what
I was asking.

Creating a config file and reading it is the easy part, but how do you
locate
the file with out hard coding the location of the config file in you
script.

"and I also don't want to hard code the location of the configuration
file in my script."







------------------------------

Date: Thu, 22 Jun 2000 19:10:58 +1000
From: "Peter G. Martin" <peter@accesss.com.au>
Subject: Re: Attempting to parse malformed XML
Message-Id: <3951D822.DAC7AFBB@accesss.com.au>



Charles Capps wrote:
> 
> I've been given the job of taking exported data from a certain extremely
> brain-damaged and poorly designed application and rewriting it into a format
> that an in-house application can read.
> 
> The only form of exported data is XML.  The XML that it produces has
> *CERTAIN* tag elements unquoted.  Example:
> <message body="Laa dee daa" number=000001 author="Lame dude">
> 
> Unfortunately, nothing will parse it.  Expat (XML::Parser, etc) chokes and
> dies when it comes across the unquoted elements.
> 
> I'm very reluctant to attempt to write my own parsing routine.  I'm currently
> using a series of regexes to split apart the tag, but it's difficult, tedious
> work due to the randomness of the element locations, values, and lengths, as
> well as tags.
> 
> Does anyone have any recommendations, pointers, hints, URLs, or
> perldoc/manpages?  ;)

Haven't tried it with XML, but tidy works really well in cleaning up
HTML,
and has flags for XML input/output.    Docs say it's not the full quid
on
XML, but may be worth trying.

Have assumed you want everything on the fly -- so why not a perl regex
to
fix up the unquoted stuff first ?  

If not on the fly, try a nice editor like XMLWrite which has progressive 
syntax checking and marking built in.

-- 
--peter@access.com.au   -- Peter G. Martin,  Tech writer
mobile: 04 08 249 113   Home: peterm@zeta.org.au
Home page: http://www.zeta.org.au/~peterm
"Regexes::Text   as Numbers::Mathematics."


------------------------------

Date: Thu, 22 Jun 2000 01:02:49 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Do any of you know how to do this?
Message-Id: <3951C829.F206995F@stomp.stomp.tokyo>

psycho wrote:
 
> does any one know how to do something like this? <img
> src="cgi_file.cgi"> and then the cgi shows an image.

Yep. Easy way is to store your graphics wherever, setup
your script for LWP Simple. Fetch your picture, print
a content type and picture, wallah! All done. You should 
be able to write this script in no more than five lines,
four lines would be Goldilocks just right.

You will discover some rather humorous bugs if you try to
pull or print more than one picture at a time. Have fun.


!#chitty/chitty/bang/bang/purl

use LWP etc.. ever so simple;

$picture = get ("whatever address");

print "Content-Type: image/jpeg\n\n";

print $picture;


( image/gif image/bmp image/porno .. whichever)



> Got questions?  Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com


My stats for today. How ya doing over at keen.com ???

(Figures in parentheses refer to the 7 days to 21-Jun-2000 23:56). 
Successful requests: 6,081 (6,077) 
Average successful requests per day: 871 (868) 
Distinct files requested: 430 (430) 
Distinct hosts served: 363 (363) 
Data transferred: 100.886 Mbytes (100.656 Mbytes) 
Average data transferred per day: 14.456 Mbytes (14.379 Mbytes) 


Godzilla!


------------------------------

Date: Thu, 22 Jun 2000 04:58:12 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: Do any of you know how to do this?
Message-Id: <3951D524.776D920E@rock13.com>

psycho wrote:
> 
> does any one know how to do something like this? <img
> src="cgi_file.cgi"> and then the cgi shows an image.

Look into counter scripts. Something to do with sending the correct
content-type to the user agent.

-- 

Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


------------------------------

Date: Thu, 22 Jun 2000 17:13:49 +0800
From: Kig-Keat Yong <r51692@email.sps.mot.com>
Subject: GCC Installation
Message-Id: <3951D8CD.ECE7D6B3@email.sps.mot.com>

This is a multi-part message in MIME format.
--------------2A9D611896F3BAC1EFE11DFE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

        I found some difficulties when installing Apache..it requires
Perl and GCC.
When i want to install GCC..there several stages need togo through..
    install a precomplied GNU C compliler
    install GNU make
    use those to complile the current GCC suite

but when i in stage 2..there is the problem i facing...

phantom# ./configure --prefix=/opt/GNUmake
loading cache ./config.cache
checking for a BSD compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... ./configure: make: not found
no
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking whether make sets ${MAKE}... (cached) no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

Somebody can help?

Regards
Raphel

--------------2A9D611896F3BAC1EFE11DFE
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Raphel Yong Kig Keat
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Raphel Yong Kig Keat
n:              Kig Keat;Raphel Yong
org:            Computer Integrated Manufacturing (CIM)     
email;internet: r51692@email.sps.mot.com
title:          System Engineer, Motorola (Malaysia) Sdn Bhd
note:           Research & Developement     
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------2A9D611896F3BAC1EFE11DFE--



------------------------------

Date: 21 Jun 2000 22:41:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How can I get perl (cgi) html to work on the OS Seal ?
Message-Id: <8ircr7$p2m$1@orpheus.gellyfish.com>

On Tue, 20 Jun 2000 23:02:45 GMT smile773 wrote:
> Seal is a dos (gui) OS but is still in it's infancy.
> I would like to incorporate perl as a problem solving tool.

If this 'Seal' is a new OS there doesnt appear to be a port of Perl
to it.  You might have to do the port yourself - please supply the
patches to p5p ... You may want to ask in a group that discusses the OS
if you need help in programming for tha platform.

> Because of many developmental problems with 32 bit pmode
> I would like to use html  for input and output.
> 

Then perhaps you might also need an HTTP server for your platform - you
may need to port one yourself.  You will need to ask in the group
comp.infosystems.www.servers.misc about this.

> The person named Drew Simonis need not reply < rude
> 

Ah I see - picky and thin-skinned, perhaps you might find another medium
than Usenet.

> If you nice ppl have some information that will help me get
> perl working in a dynamic cgi mode with seal, I am
> looking forward to hearing from you.
> 

When you have configured an HTTP server to run CGI programs on your
platform you will probably want to ask in the more appropriate
comp.infosystems.www.authoring.cgi if you have questions about CGI.  If
you cannot find a port of Perl for your platform you might have to take
a hand in making one yourself.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: 21 Jun 2000 22:13:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I need to get better at Perl
Message-Id: <8irb6c$p0r$1@orpheus.gellyfish.com>

On Wed, 21 Jun 2000 17:19:50 GMT robb4444@my-deja.com wrote:
> 
> <Drew Simonis wrote> :
>> The problem is that people insist on posting off topic.
> 
> This is a miscellanous forum.
> 

For the discussion of Perl - not the configuration of web servers, HTML,
e-mail, SQL or any hundred protocols or specifications that might be in
vogue at the current time.  There are other places to discuss these things.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: Thu, 22 Jun 2000 09:37:24 GMT
From: drew@i4free.co.nz
Subject: Its Late... Im really Tired...
Message-Id: <8ismok$o32$1@nnrp1.deja.com>

Hi....


I know hwo to do this but I can't think...

How do u parse a form input from a textarea form... so that teh returns
do no taffect it when u write it to a file..

eg
$msg =~ s/\%([0-9A-F]{2})/\x$1/g;

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 22 Jun 2000 08:01:13 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Know of any good perl books?
Message-Id: <3959c189.2906466@news.skynet.be>

David Bell wrote:

>I was thinking about getting 'Programming Perl', is this
>one good?  ...Does it also have CGI info?

No. Programming Perl only focuses on the Perl language. It was the first
Perl book ever available (I think).

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 04:56:58 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: Know of any good perl books?
Message-Id: <3951D4DA.701F0A3E@rock13.com>

David Bell wrote:
> 
> Hello!  I'm looking for a good Perl book.  I've got 'Learning Perl' from
> O'Reilly, and it's great, but I'd like something a bit more in-depth.  ...And
> with more CGI info.  I was thinking about getting 'Programming Perl', is this
> one good?

Its consider the official language reference so getting it would
probably be a good idea. It is not specific to CGI though. Do a search
on bn.com perhaps for some books.

The Perl Cookbook is a nice one, a decent amount of stuff CGI related
in there.

-- 

Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


------------------------------

Date: Thu, 22 Jun 2000 08:06:01 GMT
From: scarey_man@my-deja.com
Subject: Re: Looping through records in an array
Message-Id: <8ishd2$kf7$1@nnrp1.deja.com>

Tom, thanks for that.  I'll give it a try.

  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Wed, 21 Jun 2000 scarey_man@my-deja.com wrote:
>
> > How can I easily loop through the number of rows checking whether
the
> > value of the same element in the next row is different or not, and
> > displaying it if it is different?
>
> The general idiom for this sort of thing in Perl (trying to adapt to
> resemble your attempt) looks somewhat like this:
>
>     my $previous;
>     for my $cntr (0..5) {
> 	my $current = &whatever($cntr);
> 	if (!defined $previous or $previous ne $current) {
> 	    # We haven't seen it before
> 	    print "$current\n";
> 	    $previous = $current; # so we'll know it when we see it
again
> 	}
>     }
>
> Hope this helps!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 22 Jun 2000 09:03:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LWP and HTTPS fail
Message-Id: <8ish7u$qgi$1@orpheus.gellyfish.com>

On Wed, 21 Jun 2000 15:10:27 +0200 JOW wrote:
> Hi im trying to do a POST in HTTPS using LWP
> 
> I have:
>  Open SSL 0.95a
>  Perl 5.005_03
>  true64 unix
> 
> 
> 
> But i cant make the connection, because I get this error:
> 
> 500 Can't connect to secure.incab.se:443 (Bad file number)
> 
> 

Do you have either Net::SSL or IO::Socket::SSL installed ?

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: 22 Jun 2000 08:37:47 GMT
From: iqnegativeone@aol.com (IQnegativeOne)
Subject: Re: Need app to generate perl for windows
Message-Id: <20000622043747.05169.00000102@ng-cm1.aol.com>


Sounds more like write my own. Perhaps something more like a html editor where
it wraps the the tags for you, would be of help. Not to exactly write my app
for me, but, generated code close to what you want. At least the syntax would
be in place. This would help a newbie a lot.

Thanks I will have a look at tk for perl. Its just that adding another layer to
the learning curve, dosen't make my day.

Thanks to all for responding. 
Rivertide
>factoryjs wrote:
>You might do well to check out Perl/tk. I have used the Activestate port of
>Perl on win95 with tk and it was about like VB. Okay myabe like VB3 was when
>you had to do more of it your self. The O'Reilly books on Perl/Tk give you
>plenty of info if you already understand Windows app development




------------------------------

Date: Thu, 22 Jun 2000 10:33:40 +0300
From: Vlasis Hatzistavrou <vhatz@ccf.auth.gr>
Subject: Re: Newbie question about subroutines...
Message-Id: <3951C150.648574F1@ccf.auth.gr>

Hi,

    Thank you verymuch for your input.

> What you _also_ need is permission. Most of the major search engines want
> you to at least ask before you do this. If you're making a public
> interface then some (possibly all, though you must check) require
> licensing of some sort, too. The engines get their revenues from
> advertising, and since a meta-engine strips that out you're basically
> using someone's resources without paying, which isn't too polite.
>
>                                 Dan

The metaengine does not concer any of the public search enginees around. It's about
creating a common basic search tool for various e-journal providers who already
provide us with their search tools. Permission is already obtained.

Thanks again,

--
Vlasis Hatzistavrou



------------------------------

Date: Thu, 22 Jun 2000 08:01:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Number or string item in an array?
Message-Id: <3956bdfd.1998281@news.skynet.be>

Tad McClellan wrote:

>1.0e10     looks like a number. looks like a string.
>
>123        looks like a number. looks like a string.
>
>
>You don't _need_ to know.
>
>Why do you think you need to know this?

Er... because bitwise operators make the distinction?

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 10:05:41 +0100
From: Haris Siakalis <se97hs@dmu.ac.uk>
Subject: Perl contracting
Message-Id: <3951D6E5.49200763@dmu.ac.uk>

Hello,
does anyone know if anywhere on the net there are demo contracts for
people doing perl work? Could it be possible for somebody to send me
one?

Thanks


------------------------------

Date: Thu, 22 Jun 2000 08:01:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: perl reference challenge:
Message-Id: <3957bed3.2212598@news.skynet.be>

Matthew O. Persico wrote:

>I can copy the list to the array: @x = (1,2,3,4).
>
>I can initialize the hash:

>%y = ( 1,2,3,4).
>
>So if (1,2,3,4) is an array, it's also a hash. Since it cannot be both,
>it is neither. It is a list. Period.

A list is closer to an array, than it is to a hash. According to your
scheme:

	%y = @x;

an array is a hash. Not!

You know, if you do

	%z = %y;

The intermediate stage is a flattended list, while internally, hashes
are like tree structures.

An array exists in memory, a list only on a stack. That is memory to,
granted, but all that you have is a set of *individual* items on the
stack, and not just a complete array.

Once your statement is finished, the list is gone. The array still
exists.

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 09:50:00 +0100
From: "Phil" <barrowman_99@yahoo.com>
Subject: Re: Perl, CGI, Browser differences
Message-Id: <8isjvt$15d$1@bignews.shef.ac.uk>


Alan J. Flavell <flavell@mail.cern.ch> wrote in message
news:Pine.GHP.4.21.0006211909200.6396-100000@hpplus03.cern.ch...
> On Wed, 21 Jun 2000, Phil wrote:
>
> > Can anyone tell me why a simple script that outputs html can work OK
with
> > IExplorer but with Netscape the text appears underlined?
>
> Yes, but you don't have a Perl language question.
>

Hahahahahahahahha!
Yes.




------------------------------

Date: Thu, 22 Jun 2000 09:52:33 +0100
From: "Phil" <barrowman_99@yahoo.com>
Subject: Re: Perl, CGI, Browser differences
Message-Id: <8isk4l$1e1$1@bignews.shef.ac.uk>


Alan J. Flavell <flavell@mail.cern.ch> wrote in message
news:Pine.GHP.4.21.0006211909200.6396-100000@hpplus03.cern.ch...
> On Wed, 21 Jun 2000, Phil wrote:
>
> > Can anyone tell me why a simple script that outputs html can work OK
with
> > IExplorer but with Netscape the text appears underlined?
>
> Yes, but you don't have a Perl language question.
>

The answer was that Netscape didn't recognise the </A> tag that was output
by the script.. though IExplorer did OK.  Funnily enough in Netscape all the
following text (after the opening <A>) did not become a link but DID become
underlined.




------------------------------

Date: Thu, 22 Jun 2000 19:13:59 +1000
From: "Peter G. Martin" <peter@accesss.com.au>
Subject: Re: ppm: Can't find unicode character property definition
Message-Id: <3951D8D7.54D2D57@accesss.com.au>



Thilo Opaterny wrote:
> 
> Hallo alltogether
> 
> I tried
>     H:\X\PROG\perl>ppm install Tk
> and get
>     Can't find unicode character property definition via main->R or R.pl at
> unicode/Is/R.pl line 0
> 
> History:
> NT4.0Sp6
> installed ActivePerl 5.6.0.613 and it works (despite MSI)
> made a local repository, since targetmachine in not really on the net
> setted HTTP_PROXY
> adjusted PPM to a local repository
> installed PPM 1,1,4,0 with "ppm install ppm", works too (getting euphoric)
> installed TK 800,022,0,0 mit "ppm install Tk" but all I get is the error
> message (coming down hard)
> 
> there is a directory with lot of unicode stuff, but there is no "R.pl".
> There is a make*, that does a lot of things, but it does not generate
> "R.pl". It should be not a simple installation problem, since the message
> comes from deep inside ppm.
> 
> Who has a hint for me

More like a "me too", I'm afraid....    the same thing breaks my
attempts
to rebuild a perlindex database, dammit !    This time, it's main->E or
E.pl
or somesuch.




-- 
--peter@access.com.au   -- Peter G. Martin,  Tech writer
mobile: 04 08 249 113   Home: peterm@zeta.org.au
Home page: http://www.zeta.org.au/~peterm
"Regexes::Text   as Numbers::Mathematics."


------------------------------

Date: Thu, 22 Jun 2000 08:10:47 GMT
From: gevens@my-deja.com
Subject: Re: Problem installing CPAN Date::Calc
Message-Id: <8ishm0$kop$1@nnrp1.deja.com>

I got this as well and would be interested learning the cause.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 22 Jun 2000 00:20:32 -0700
From: cmull <cmullNOcmSPAM@austin.rr.com.invalid>
Subject: Problems gettting starting with perLdap under ActivePerl
Message-Id: <0d3c8900.0c7734e9@usw-ex0106-044.remarq.com>

I am trying to get perLdap working with ActivePerl.

I installed ActivePerl on Windows 95 machine.
Then used ppm to install perl-ldap package.

Wrote a simple 1 line perl program which is:

use Mozilla::LDAP::Conn;


run the program and get the following output:

Can't locate loadable object for module Mozilla::LDAP::API in @INC
(@INC contain
s: C:/perl/lib C:/perl/site/lib .) at C:/perl/lib/Mozilla/LDAP/Utils.pm
line 29
Compilation failed in require at C:/perl/lib/Mozilla/LDAP/Utils.pm line
29.
BEGIN failed--compilation aborted at C:/perl/lib/Mozilla/LDAP/Utils.pm
line 29.
Compilation failed in require at C:/perl/lib/Mozilla/LDAP/Conn.pm line
32.
BEGIN failed--compilation aborted at C:/perl/lib/Mozilla/LDAP/Conn.pm
line 32.
Compilation failed in require at perldap.pl line 1.
BEGIN failed--compilation aborted at perldap.pl line 1.

Anybody seen this one?

thxs in advance, -craig




* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



------------------------------

Date: Thu, 22 Jun 2000 07:20:56 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: q: next pair key in a hash
Message-Id: <FwJoEx.M10@news.boeing.com>

In article <FwJBED.FoI@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
> ...
>my $some_index = $hash->[0]->{$some_key};
>print "previous: $hash->[$some_index - 1]\n";
>print "next:     $hash->[$some_index + 1]\n";


Some error checking would be good too:

exists $hash->{$some_key} or die "invalid key: $some_key\n"; 
my $some_index = $hash->[0]->{$some_key};
print "previous: ", $some_index == 1 ? "none\n" 
                    : "$hash->[$some_index - 1]\n";
print "next:     ", $some_index == @$hash -1 ? "none\n"
                    : "$hash->[$some_index + 1]\n";


--
Charles DeRykus


------------------------------

Date: 22 Jun 2000 09:11:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: q: next pair key in a hash
Message-Id: <8ishnq$qhf$1@orpheus.gellyfish.com>

On Wed, 21 Jun 2000 16:26:59 +0400 Roman Chumakov wrote:
> A little trouble.
> 
> I have a big hash: $hash.
> 
> I have a key for this hash to retrieve: $key
> its value is:
> $keyvalue = $hash{$key}
> 
> But how can I know previous key in a $hash, that is previos $key?
> And also, how to get next key?
> 

As has been said the idea of 'next' and 'previous' when talking about
the keys of a hash - you will need to define what you mean by these
terms in the context of your data then extract the keys of the hash with
keys() and sort them into an array in the appropriate order then you can
move within the elements of the array ...

You will probably want to see the entry in perlfaq4 :

       How do I sort a hash (optionally by value instead of key)?

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: Thu, 22 Jun 2000 08:29:11 GMT
From: victor@catchacorp.com
Subject: regex engin's undocumented behaviour?
Message-Id: <8isioe$le5$1@nnrp1.deja.com>

$_=aabbaa;
/^(aa(bb)?)+$/;
print $1; # you will get 'aa'
print $2; # should output 'bb'?? but is empty

i think perl is somewhat confused by the combination of '?' and '+'. my
solution:
/^(aa(bb)?)(aa(bb)?)?$/; # unambiguous.

any better solution?


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 22 Jun 2000 09:22:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Setting locale failed.
Message-Id: <8isic7$qi4$1@orpheus.gellyfish.com>

On Wed, 21 Jun 2000 09:03:38 -0700 Tom Phoenix wrote:
> On Wed, 21 Jun 2000 des3das@my-deja.com wrote:
> 
>>  I got this message when I tried to use perl.
>> 
>> perl: warning: Setting locale failed.
>> perl: warning: Please check that your locale settings:
> <snip>
> 
>> Can someone tell me how I can correct it. I've tried FAQ's but I can't
>> find any reference to it.
> 
> It's in perldiag, which says the following.
> 
>     =item perl: warning: Setting locale failed.

It might be noted that on a certain popular Linux distribution attempting
to set the locale to other than en_us will cause this warning whether
the appropriate locale files are there or not ... this is probably a
problem with the locale files .

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: Thu, 22 Jun 2000 08:00:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: simple array question
Message-Id: <3952b924.757196@news.skynet.be>

Phil Sutcliffe wrote:

>> You can put them in a hash.
>>
>> @data{@names} = @fields;
>>
>
>What if I need to put the elements back into @fields at some stage in strict
>order?
>
>I know you can still do this with a hash, but it's not as easy is it?

Er... It's reversible.

	@fields = @data{@names};

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 08:00:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: simple array question
Message-Id: <3953b9df.944490@news.skynet.be>

Phil Sutcliffe wrote:

>That's a bit harsh! At no stage have I "insisted on using symrefs", rather I
>suggested that perhaps this could be done using symrefs.
>
>I have "insisted" on finding a method of doing this without using a hash. Is
>that such a crime?

I tried

	@{"alpha", "beta", "gamma"} = (1 .. 3);

but it gives me a syntax error. So it won't work.

I think your best shot is using a loop.

	for my $i (0 .. $#names) {
	    ${$names[$i]} = $fields[$i];
	}

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 08:00:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Simple Reg Expression Question
Message-Id: <3954bba0.1393612@news.skynet.be>

Abe Timmerman wrote:

>my $ID = ' DA86E130-470E-11D4-9F14-0080ADC93510';
>
>my @hexid = map "0x$_" =>
>	(unpack 'aa8aa4aa4aa2a2aa2a2a2a2a2a2', $ID)[1,3,5,7,8,10..15];

I think you should look at the "x" datatype in pack/unpack.

my @hexid = map "0x$_", unpack 'xa8xa4xa4xa2a2xa2a2a2a2a2a2', $ID;

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 08:01:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: strict and @ISA
Message-Id: <3955bd21.1778636@news.skynet.be>

Andrew Perrin - Demography wrote:

>Quick question: what is the proper way to make strict not complain
>about @ISA requiring a package name?  Packages that don't work under
>use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.

IMO this is a bug. Perl doesn't complain about $a or $b, does it? So why
does it complain about @ISA? That *is* a special case for Perl anyway,
so why not treat it like one, as it deserves?

It's not likely that anyone typing @ISA in his code would have made a
mistake.

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 17:53:50 +0800
From: Bert <egberts@mac.com>
Subject: Swapping a picture using perl on error.
Message-Id: <3951E22D.F41FDF4@mac.com>

Hi, I have a problem... (so what's new)...

This is what I'm trying to do:

I've written some perl cgi code that searches thru a MySql database for
records that indicate a particular item has a picture to go with it.

However, there are approx. 3000 records that indicate those 3000 items
have pics, BUT I have only 1000 pictures, so the search results shows a
lot of 'broken gifs'.

Is there some way that I can write some code that would cause the cgi to
search for a pic and use a generic 'Not available yet.gif' when it is
unable to locate the required picture?

I'm quite the beginner at Perl (and programming) and would really
appreciate any help at all.

Thanks in advance.


Egbert
egberts@mac.com



------------------------------

Date: 22 Jun 2000 08:55:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sys::Syslog & _PATH_LOG
Message-Id: <8isgpj$qg0$1@orpheus.gellyfish.com>

On Wed, 21 Jun 2000 10:52:48 -0500 Daniel Weber wrote:
> I posted this originally in c.l.p.modules, but it hasn't turned up any
> responses. Probably should have cross-posted to begin with.
> 
> Anyway, has anyone else noted this behavior on AIX or IRIX? Anyone have a
> solution?
> 
> -------- Original Message --------
> Subject: Sys::Syslog & _PATH_LOG
> Date: Mon, 19 Jun 2000 17:06:40 -0500
> From: Daniel Weber <d-weber@itg.uiuc.edu>
> Reply-To: d-weber@uiuc.edu
> Organization: University of Illinois at Urbana-Champaign
> Newsgroups: comp.lang.perl.modules
> 
> I'm running perl-5.6.0 on both AIX 4.3.3 and IRIX 6.5.7 and attempting to test
> the Net::Daemon module which requires the Sys::Syslog module. On both operating
> systems, I get the error:
> 
>> t/config............Your vendor has not defined the Sys::Syslog macro _PATH_LOG
>> at /usr/local/encap/perl-5.6.0/lib/perl-5.6.0/IP22-irix-thread-multi/Sys/Syslog.
>> pm line 277.
> 
> (adjusting the path for AIX obviously).
> 
> 277 is the line:
>>         my $syslog = &_PATH_LOG  || croak "_PATH_LOG not found in syslog.ph";
> 
> As far as I can tell, syslog.ph isn't included with a require by this
> version of Syslog.pm as in earlier versions of perl, so that croak
> message probably isn't correct.

Its not actually the result of that croak that you are seeing - this is
coming from within the XS code that replaces the need to require
'syslog.ph'.  The Sys::Syslog manpage is also incorrect in this respect -
I guess I should do a patch ...

> Though to be sure I ran h2ph on the entire /usr/include hierarchy but
> still got the same error. On IRIX, _PATH_LOG is defined in paths.ph,
> but under AIX, it doesn't appear in *any* .ph file. A grep of all .h
> files on AIX confirmed this.

> I tried modifying line 277 of Syslog.pm to read "my $syslog =
> _PATH_LOG()" as suggested in previous posts as archived on deja.com,
> but I still get the same error.

> Changing line 277 to be hardcoded "$syslog = '/dev/log'" seems to work
> on AIX, but not on IRIX, even though in paths.ph on IRIX _PATH_LOG
> is simply /dev/log.  That is to say it passes the tests under AIX but
> generates more errors on IRIX.

All that follows comes with no warranty as neither OS will run on my
laptop ;-}

On IRIX you could edit the file <perl src dir>/ext/Sys/Syslog/Syslog.xs
so that it has something like :

#ifdef I_SYSLOG
#ifdef IRIX        /* You will need to check this constant */
#include <paths.h>
#endif
#include <syslog.h>
#endif

instead of just including syslog.h.  You might find that you will need
to include other stuff which will probably be described in the syslog(3)
manpage.

You will then need to run 'make' and 'make install' in that directory.

For the AIX you should again look at the syslog(3) manpage to determine
what include files it requires - however as it appears that it uses some
other macro than _PATH_LOG you may need to define this yourself or
find out whether there is some other macro that holds the equivalent
information - this might be defined in /usr/include/syslog.h (or some
file included from there or listed in the manpage).

You might end up with :

#ifdef AIX
/* possibly some includes to pull in the appropriate macros */
#define _PATH_LOG _AIX_PATHL_LOG /* of course this will be something else */
#endif

If all else fails you could just put

#ifndef _PATH_LOG
#define _PATH_LOG /dev/log
#endif

somewhere after all the other preprocessor stuff.

If you do get this to work you should probably send the patch to 
perl5-porters or via perlbug - if you dont you might want to submit
a report via perlbug as the module being part of the standard distribution
is now looked after by p5p ..

> Does anyone have a solution or a patch to apply to Syslog.pm to fix
> the problem?

You could use setlogsock() with a value of 'inet' which will not use
PATH_LOG at all if all else fails ...

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


------------------------------

Date: Thu, 22 Jun 2000 08:01:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why cant a cgi and module use the same library?
Message-Id: <3958c086.2647330@news.skynet.be>

Jeff Helman wrote:

> When the compiler gets to the second require statement (in
>A.cgi), it skips it since that file has already been loaded.

but into the wrong package.

That's why "import" was invented.

You can get around it by putting the require statement before the
package declaration, and assume that what you need from the library file
is in package main (qualify the sub names). If you're paranoid, you can
even put "package main;" in front of it.

-- 
	Bart.


------------------------------

Date: Thu, 22 Jun 2000 19:26:52 +1000
From: "Peter G. Martin" <peter@accesss.com.au>
Subject: Re: XML Schema and datatypes with Perl
Message-Id: <3951DBDC.651D2604@accesss.com.au>



shikida@my-deja.com wrote:
> 
> I want to check datatypes using XML Schemas with perl.
> Is there any library I can use to do this?
> Seems that the most popular XML parser for perl don't check datatypes.
> 

It's a bit early just yet -- XML Schema standard hasn't got to the RFC
stage yet, so no-one can be +really+ sure what to parse against.

I suggest you keep an eye on the Perl-XML mailing list (check it
at http://www.activestate.com ).   A lot of recent work is being
flagged there.

-- 
--peter@access.com.au   -- Peter G. Martin,  Tech writer
mobile: 04 08 249 113   Home: peterm@zeta.org.au
Home page: http://www.zeta.org.au/~peterm
"Regexes::Text   as Numbers::Mathematics."


------------------------------

Date: Thu, 22 Jun 2000 08:03:32 GMT
From: amitr@w-o-i.com
Subject: zope, python vs apache, perl
Message-Id: <8ish8e$kde$1@nnrp1.deja.com>

hi

I want to evaluate zope, python vs apache, perl.

which one can be used where!
strong points and pitfalls.

thanks in advance


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

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 V9 Issue 3450
**************************************


home help back first fref pref prev next nref lref last post