[16040] in Perl-Users-Digest
Perl-Users Digest, Issue: 3452 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 22 11:05:38 2000
Date: Thu, 22 Jun 2000 08: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: <961686315-v9-i3452@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 22 Jun 2000 Volume: 9 Number: 3452
Today's topics:
Re: Accessing config files from CGI scripts. <care227@attglobal.net>
Re: Active Directory and Perl snval0@my-deja.com
ActivePerl for Windows NT Perl Packet Manager install p <hermans@excite.com>
Re: ActivePerl for Windows NT Perl Packet Manager insta <abe@ztreet.demon.nl>
basic ipchains perl scripts wmcn@my-deja.com
Re: basic ipchains perl scripts <care227@attglobal.net>
Re: basic ipchains perl scripts <gellyfish@gellyfish.com>
Re: BIG BUG in CGI.pm on Internet Explorer !! <makau@multimania.com>
CGI::Carp cluck abbreviating msgs? <hmerrill@my-deja.com>
Re: Detecting errors when embedding perl into c (Anno Siegel)
Finding Installed Modules <rootbeer@redcat.com>
Re: GCC Installation (Andrew E Page)
Re: help on perl format function <care227@attglobal.net>
HELP!!!!! <adam.lundrigan@nf.sympatico.ca>
Re: HELP!!!!! <abe@ztreet.demon.nl>
Re: HELP!!!!! <care227@attglobal.net>
Help---Perl---Storage- <pk1@gmx.li>
Re: Help---Perl---Storage- <care227@attglobal.net>
Re: I need to get better at Perl <care227@attglobal.net>
I'm confused, help please... <nathan.wright@sdrc.com>
Re: Is there a dos htm enviroment for perl ? <gellyfish@gellyfish.com>
NET::FTP Croak problem (BillyBob)
Re: NET::FTP Croak problem (BillyBob)
Re: Perl 5.6 says 'syntax error', Perl 5.005_03 does no <gellyfish@gellyfish.com>
Re: Perl Debugger (Andrew E Page)
Perl Network Programming nfin8axs@hotmail.com
Problem using sendmail <etxaved@etxb.ericsson.se>
Re: Problem using sendmail (Rafael Garcia-Suarez)
Re: regex engin's undocumented behaviour? <care227@attglobal.net>
Testing a process on NT with Perl ? <thibault.delplanque@renault.fr>
Re: Testing a process on NT with Perl ? <blah@nospam.com>
uncoupling SQL from object classes bsmith@webnetint.com
Re: uncoupling SQL from object classes (jason)
Re: Where is @INC in ActiveState Perl for Win32 ??????? (Steve A. Taylor)
Re: zope, python vs apache, perl <care227@attglobal.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 22 Jun 2000 09:49:14 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Accessing config files from CGI scripts.
Message-Id: <3952195A.2FE71F4D@attglobal.net>
Stephen Henwood wrote:
>
> "and I also don't want to hard code the location of the configuration
> file in my script."
Ah, I didn't see that bit. Perhaps you could allocate each user a
directory space within your filesystem, and source the config script
that way, such as (psuedo code)
my $user = param('username');
my $basedir = "/home";
my config_source = $basedir . "/" . $user;
Or do the same sort of logic with a known directory and name the
config files with some easily identified title.
Am I closer =)
------------------------------
Date: Thu, 22 Jun 2000 14:14:53 GMT
From: snval0@my-deja.com
Subject: Re: Active Directory and Perl
Message-Id: <8it70e$3cs$1@nnrp1.deja.com>
That's what I'm also looking for. I'm using Perl (incl. LDAP lib) for
some time now. It works fine when talking to Netscape Directory or DC
Directory server, but it is still not working on my Active Directory.
So anyone with a working example?
Gr,
Fred.
In article <AWY%4.119863$R4.721517@news1.rdc1.nj.home.com>,
Peter L. Berghold <peter@lberghold.net> wrote:
> In article <8hhc1f$olj$1@nnrp2.deja.com>, theowood@my-deja.com wrote:
> > Does anyone have sample Perl code for accessing
> > objects (ie. users, groups) in Microsoft's Active
> > Directory?
> As I understand it you can use the LDAP protocol to talk to M$/AD. If
that is the case
> then you should be able to use the LDAP modules from CPAN.
>
> --
>
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> Peter L. Berghold http://www.berghold.net
> Peter@Berghold.Net Linux Bigot at Large
> "Linux renders ships... Windows NT renders ships useless..."
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 22 Jun 2000 15:34:28 +0200
From: <hermans@excite.com>
Subject: ActivePerl for Windows NT Perl Packet Manager install problem
Message-Id: <8it4l8$9g4ef$1@reader2.wxs.nl>
Hi,
We have some difficulties while trying to install several PPM packages (i.e.
DBD-Oracle).
Perl version v5.6.0
PPM version 1.13
The installation worked fine while we had a online connection with internet
(www.activestate.com/packages)
1) ppm
PPM> query
PPM> install DBD-Oracle
succesfull installation !
Now we want to install the ppm module on a PC which has (due to security
rules) no online connection
to the internet.
We did ftp and extract the DBD-oracle module and installed it on the local
harddisk of the PC.
2) ppm
ppm > set repository DUMMYNAME c:\download-ftp\DBD-Oracle
ppm > set save
ppm > set
Current PPD repository paths
DUMMYNAME: c:\download-ftp
ACtivestate Package Repositoy:
soap://www.activestate.com/cgibin/SOAP
ppm install /location DUMMYNAME DBD-Oracle.ppd
Can't connect to www.activestate.com:80)
It seems that ppm doesn't touch de DUMMYNAME
location........Why.....Help
Yours sincerely,
Frank,
hermans@excite.com
------------------------------
Date: Thu, 22 Jun 2000 16:40:33 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: ActivePerl for Windows NT Perl Packet Manager install problem
Message-Id: <r864lsc3s9ut6ipqintg5nhm6k4pqqcl1m@4ax.com>
On Thu, 22 Jun 2000 15:34:28 +0200, <hermans@excite.com> wrote:
> Hi,
Hi,
>
> We have some difficulties while trying to install several PPM packages (i.e.
> DBD-Oracle).
> Perl version v5.6.0
> PPM version 1.13
Mine is 1.1.4 (after running ppmfix), but I don't think that the fix has
anything to do with the local install procedure.
...
> We did ftp and extract the DBD-oracle module and installed it on the local
> harddisk of the PC.
Just do:
cd c:\download-ftp
ppm install DBD-Oracle.ppd
--
Good luck,
Abe
------------------------------
Date: Thu, 22 Jun 2000 13:53:13 GMT
From: wmcn@my-deja.com
Subject: basic ipchains perl scripts
Message-Id: <8it5o1$2f9$1@nnrp1.deja.com>
Hi I'm looking for basic ipchains perl scripts to link to my
forms to remote configure ipchains debian box.
Thanks,
Bill
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 22 Jun 2000 10:47:00 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: basic ipchains perl scripts
Message-Id: <395226E4.99FB02E0@attglobal.net>
wmcn@my-deja.com wrote:
>
> Hi I'm looking for basic ipchains perl scripts to link to my
> forms to remote configure ipchains debian box.
> Thanks,
> Bill
>
I'm looking for a new pair of shoes. But I don't do it here.
------------------------------
Date: Thu, 22 Jun 2000 14:55:55 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: basic ipchains perl scripts
Message-Id: <%Np45.618$My4.59455@news.dircon.co.uk>
On Thu, 22 Jun 2000 13:53:13 GMT, wmcn@my-deja.com Wrote:
> Hi I'm looking for basic ipchains perl scripts to link to my
> forms to remote configure ipchains debian box.
Look at CPAN <http://search.cpan.org> there are a couple of things that
will help you to write such a script.
/J\
------------------------------
Date: Thu, 22 Jun 2000 14:54:20 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: Re: BIG BUG in CGI.pm on Internet Explorer !!
Message-Id: <8it9ai$5a3$1@nnrp1.deja.com>
> If CGI handles IE differently, it should be pretty easy to post code
> that prints query_string, and then walks through the param() list.
Agreed but not everyone would've had the idea of checking the $ENV
{QUERY_STRING} (I struggled myself many days before finding the
solution, and I am far from being a Perl beginner). Even less people
would have successfully unescaped the URI format to get a usable string.
So I just thought it would be nice to help others by providing working
code instead of just acting like others on this newsgroup and
say : "check $ENV{QUERY_STRING}! type perldoc url::unescape (or
whatever)". Working code is undoubtably much more useful that pointing
someone to the perl documentation ...
Apparently I was wrong helping so much (too much) by providing working
code. So I just apologize to everybody. I won't do it anymore.
--
Makau
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 22 Jun 2000 14:09:26 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: CGI::Carp cluck abbreviating msgs?
Message-Id: <8it6m8$38n$1@nnrp1.deja.com>
I'm using "cluck" because I want to get a stacktrace when an error
occurs. Some of the messages that I "cluck" are lengthy, and it seems
like cluck is abbreviating them, so that my full helpful text is being
truncated like "here's some useful text..." with the "..." at the end of
the message, where there should be more text.
Is there a way to get a cluck stacktrace without having my cluck
messages truncated?
TIA.
--
Hardy Merrill
Mission Critical Linux
http://www.missioncriticallinux.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Jun 2000 13:57:32 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Detecting errors when embedding perl into c
Message-Id: <8it60c$mph$1@lublin.zrz.tu-berlin.de>
Steve Dalton <steved@no-spam-please.writeme.com> wrote in comp.lang.perl.misc:
>Hi,
>I have been successfully using perl from a C++ program for some time now,
>using the method described in the perlembed man page. The code is pretty
>basic, just evaluating a small section of perl, built dynamically from a
>database. There is a slight chance under some circumstances that a
>divide-by-zero error (or similar) error could occur in the perl code --
>currently the whole program just terminates displaying the perl error
>message when this happens.
>
>I have searched the man pages for a way of trapping the perl errors in the
>C++ program, but have found nothing. Does anyone have any ideas? How does
>the perl interpreter terminate my program? It doesn't appear to use signals
>as I do not get any other error messages apart from the perl message.
Well, Perl's way of exception handling is block eval. Put the code
that might error out inside an eval and check $@ later to see if
an error occurred. Then again, if it's only division by zero, why
not check the denominator?
Anno
------------------------------
Date: Wed, 21 Jun 2000 17:12:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Finding Installed Modules
Message-Id: <Pine.GSO.4.10.10006211449430.4312-100000@user2.teleport.com>
I've become dissatisfied with the currently-available answers to the
question of how to determine which Perl modules are installed on a given
machine. I don't need to elaborate all of my reasons here, though; I'd
just like to say that I've cooked up a program which tries very hard to Do
The Right Thing everywhere, and to explain what's wrong when it can't.
Before I upload this program to CPAN, I'd like to have some volunteers
take it for a test drive on a few systems to ensure that it's really as
road-ready as I think it is. Interested parties should contact me by
private e-mail.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 22 Jun 2000 14:19:54 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Re: GCC Installation
Message-Id: <FwK7t7.7uL@world.std.com>
It would help to know what kind of system that you have. Some
systems come with C compilers, but they just aren't in your PATH
variable. Some systems provide K&R compilers that can be used to
build gcc.
Ironically to install gcc, Gnu C compiler, you need to have a
compiler already installed.
However, a few passes with a search engine usually turns up
precompiled installations.
In article <3951D8CD.ECE7D6B3@email.sps.mot.com>,
Kig-Keat Yong <r51692@email.sps.mot.com> wrote:
>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--
>
--
Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow
Software Engineering Consultant | The difference between what we are
Unix, Mac, C/C++/Java, Perl, NT | and what we want to be.
------------------------------
Date: Thu, 22 Jun 2000 10:38:13 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: help on perl format function
Message-Id: <395224D5.1A3F761A@attglobal.net>
Tom Phoenix wrote:
>
>
> A graphic? No; formats produce text. But maybe you could write the text to
> a file, then post-process it to make it part of an HTML page. (Is that
> what you're thinking?) If you're especially tricky, you may be able to
> avoid the temporary file, but I wouldn't bother with that.
>
Could the text that FORMAT outputs be a pointer to a file containing an
image? Such as an <img> tag for HTML display?
------------------------------
Date: Thu, 22 Jun 2000 13:07:03 GMT
From: Adam Lundrigan <adam.lundrigan@nf.sympatico.ca>
Subject: HELP!!!!!
Message-Id: <395210C5.E33BB0E7@nf.sympatico.ca>
Can I use a select case (VB) or switch (JS) in PERL???
if so, how?
please reply thru email. Any help is greatly appreciated
-Adam Lundrigan
adam.lundrigan@nf.sympatico.ca
------------------------------
Date: Thu, 22 Jun 2000 15:44:24 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: HELP!!!!!
Message-Id: <9854lsc4gjoujpjefgfkrd50ndh77mtei9@4ax.com>
On Thu, 22 Jun 2000 13:07:03 GMT, Adam Lundrigan
<adam.lundrigan@nf.sympatico.ca> wrote:
> Subject: HELP!!!!!
You stand a better chance of getting any, if you use the subject line to
specify a _subject_ and please don't shout.
> Can I use a select case (VB) or switch (JS) in PERL???
> if so, how?
This is a FAQ, therefor the answer sits on your hard drive.
please type the following on a command line:
perldoc -q switch
>
> please reply thru email. Any help is greatly appreciated
Post here; read here, this is not a personal help desk!
--
Good luck,
Abe
------------------------------
Date: Thu, 22 Jun 2000 10:10:11 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: HELP!!!!!
Message-Id: <39521E43.4A5CE6A7@attglobal.net>
Posted and Cc'd per request.
Note: Next time try to use a meaningfull subject. I assume most of
the readers of this NG will never see this question based on the
subject. The subject line is provided for a summary of the problem
at hand, not a plea.
Adam Lundrigan wrote:
>
> Can I use a select case (VB) or switch (JS) in PERL???
> if so, how?
Did you wven try to find the answer on your own? I doubt it strongly.
This question comes up very frequently. So often, in fact, that it
is a frequently asked question (FAQ). Did you know that all the Perl
FAQ's and documentation for dozens of other topics are already on your
system? on a Win32 system, I recall that there is a POP directory.
On a UNIX system, type 'perldoc perldoc' from the command prompt.
In any case, the answer to your question is here:
http://www.perl.com/pub/doc/manual/html/pod/perlfaq7.html
Under the heading:
"How do I create a switch or case statement?"
Next time at least try, won't you?
------------------------------
Date: Thu, 22 Jun 2000 15:28:49 +0200
From: "Pk" <pk1@gmx.li>
Subject: Help---Perl---Storage-
Message-Id: <3951eb67$1_1@news.nntpserver.com>
Sorry Guys for this posting in this NG,
but i´m searching a perl script, who is diplaying
the storage is in use of my account.
PS: I got no Telnet access
Thanks
Peter Kuhlmann
------------------------------
Date: Thu, 22 Jun 2000 10:22:21 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Help---Perl---Storage-
Message-Id: <3952211D.C1783AC8@attglobal.net>
Pk wrote:
>
> Sorry Guys for this posting in this NG,
Here is a lesson in manners. If you are typing something like this,
you shouldn't make the post.
> but i´m searching a perl script,
http://altavista.digital.com <-- my favorite search engine.
> who is diplaying the storage is in use of my account.
Is this a riddle? I give up. Who?
> PS: I got no Telnet access
Thats the number 1 on the R&B charts, right?
"I got no Telnet access" by Mojo Xterm
------------------------------
Date: Thu, 22 Jun 2000 09:59:20 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: I need to get better at Perl
Message-Id: <39521BB8.A8EF0EB5@attglobal.net>
Steven Smolinski wrote:
>
> mark_f_edwards@my-deja.com <mark_f_edwards@my-deja.com> wrote:
> >'learning perl' by schwartz/christianson
> > (how 'bout an "advanced learning perl", guys??)
>
> You mean "Programming Perl" (O'Reilly) by Wall, Christiansen, Schwartz?
> Or, perhaps "Advanced Perl Programming" (O'Reilly) by Sriram Srinivasan?
>
Don't forget "Mastering Algorithms With Perl" (O'Reilly) by Jon Orwant,
Jarkko Hietaniemi and John MacDonald and throw in "Mastering Regular
Expressions" for good measure.
------------------------------
Date: Thu, 22 Jun 2000 10:50:08 -0400
From: Nathan Wright <nathan.wright@sdrc.com>
Subject: I'm confused, help please...
Message-Id: <395227A0.6E2692E2@sdrc.com>
The following script is giving me trouble...
#!/usr/local/bin/perl5
print "Content type: text/html \n\n";
my $WEEKDAY = `date +%u`;
print "$WEEKDAY";
The output is always one value greater than what the unix shell window
displays when I just type "date +%u.
For instance, on Thursday the shell window says "4" to "date +%u", but
the script says "5".
"date +%d" is working fine though. The shell value and script value are
the same. I'm missing something really dumb aren't I?
Help would be appreciated,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathan.Wright@sdrc.com
Americas Support Center
Customer Applications Engineer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Thu, 22 Jun 2000 14:35:07 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is there a dos htm enviroment for perl ?
Message-Id: <vup45.616$My4.59455@news.dircon.co.uk>
On Thu, 22 Jun 2000 00:37:18 GMT, smile773 Wrote:
>
> begin 666 Xyzzy.pl
> M(PT*(R!X>7IZ>2YP; T*(PT*(R!!('-I;7!L92!P<F]G<F%M('1O(&QE87)N
Do not post uuencoded stuff to the newsgroup. If you want people to look
at it post a URL instead.
/J\
------------------------------
Date: Thu, 22 Jun 2000 14:35:05 GMT
From: billy@billy.bob (BillyBob)
Subject: NET::FTP Croak problem
Message-Id: <tup45.643$ei2.42930@dfiatx1-snr1.gtei.net>
I am using NET::FTP. It works fine until I try to get an error message. I
have no documentation on NET::FTP and I can't seem to find any on the net (nor
in cpan). Here is an example of what I am using...
$ftp = Net::FTP->new($form_results{'TARGET_SERVER'}) || croak "Problem With
Host Name Or IP Address<BR>\n";
$ftp->login($form_results{'TARGET_USERID'},$form_results{'TARGET_PASSWORD'})
|| die "Wrong User ID or Password<BR>\n";
The croak command I copied from someone else here in the newsgroup and it
does not work at all - totally aborts the program. The die command is not
working properly either - the program seems to die but no message is printed
out. If I "|| print "error\n" then the message prints out but the program
continues without dying. Any suggestions?
Steve
------------------------------
Date: Thu, 22 Jun 2000 15:02:24 GMT
From: billy@billy.bob (BillyBob)
Subject: Re: NET::FTP Croak problem
Message-Id: <4Up45.656$ei2.48785@dfiatx1-snr1.gtei.net>
Sorry - wrong group. I meant to post this to modules.
In article <tup45.643$ei2.42930@dfiatx1-snr1.gtei.net>, billy@billy.bob
(BillyBob) wrote:
>I am using NET::FTP. It works fine until I try to get an error message. I
>have no documentation on NET::FTP and I can't seem to find any on the net (nor
>in cpan). Here is an example of what I am using...
>$ftp = Net::FTP->new($form_results{'TARGET_SERVER'}) || croak "Problem With
>Host Name Or IP Address<BR>\n";
>$ftp->login($form_results{'TARGET_USERID'},$form_results{'TARGET_PASSWORD'})
>|| die "Wrong User ID or Password<BR>\n";
>
>The croak command I copied from someone else here in the newsgroup and it
>does not work at all - totally aborts the program. The die command is not
>working properly either - the program seems to die but no message is printed
>out. If I "|| print "error\n" then the message prints out but the program
>continues without dying. Any suggestions?
>Steve
------------------------------
Date: Thu, 22 Jun 2000 14:21:31 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl 5.6 says 'syntax error', Perl 5.005_03 does not
Message-Id: <Lhp45.611$My4.59455@news.dircon.co.uk>
On Wed, 21 Jun 2000 13:37:30 -0700, Tom Phoenix Wrote:
> On Wed, 21 Jun 2000, Jeff Boes wrote:
>
>> I came across this problem in a bit of Perl code found on my Mandrake
>> distribution. I wonder if anyone would care to comment:
>>
>> ---start of code snippet---
>> sub gtkpack($@) {
>> my $box = shift;
>> gtkpack_($box, map { 1, $_} @_);
>> }
>> ---end---
>>
>> This little bit of code compiles cleanly under perl 5.005_03, but not
>> under 5.6.0, where it flags the '} @_' area as containing a syntax
>> error.
>
> I suspect that the DWIMmer in 5.6.0 is confused and thinks that you want
> { 1, $_ } to be an anonymous hashref. (You don't, do you?) If you put
> parens around your list, it'll decide that you want that code to be a
> block. (There are other possible fixes, too, but this one seems clear to
> me.)
>
I think that its more a case of DSOODOTPOTM as in some other places
{ foo => 'bar', doo => 'wap'}->{foo}
is taken as a bare block and a syntax error .... Although I would have gone
for the inner parens in the OPs case .
/J\
------------------------------
Date: Thu, 22 Jun 2000 14:12:25 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Re: Perl Debugger
Message-Id: <FwK7Gp.3GC@world.std.com>
There's a free perl debugger with a Tk GUI available at:
http://world.std.com/~aep/ptkdb
You'll need Tk
perl -MCPAN -e "install Tk"
perl -MCPAN -e "install Devel::ptkdb"
In article <39513252$0$11873@wodc7nh1.news.uu.net>,
spurcell <skpurcell@hotmail.com> wrote:
>Hello,
>I want to start using the Perl Debugger a little more for "walking through
>scripts that I have written".
>
>I read the perldebug man page, but it is slightly cryptic, on how to do it
>to existing files.
>
>I tried
>perl -de 0 "myperlfile"
>
>but that takes me to a menu that asks to either quit or restart the
>debugger.
>
>Does anyone know how I can simply walk through a script, and check out the
>values of variables, and also those of anonymous variables?
>
>Thanks
>Scott
>
>
--
Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow
Software Engineering Consultant | The difference between what we are
Unix, Mac, C/C++/Java, Perl, NT | and what we want to be.
------------------------------
Date: Thu, 22 Jun 2000 14:54:05 GMT
From: nfin8axs@hotmail.com
Subject: Perl Network Programming
Message-Id: <8it9a4$59r$1@nnrp1.deja.com>
I am fairly new to Perl, but one of the things that I am interested
in is the ability to hand craft your own TCP packets. I am by convention
C coder (within the Linux platform) and I want to be able to extend some
of the functionality of my Perl code to have this capacity.
As a separate issue, I was wondering about "type-casting: Is there any
way I can force a numerical value upon a variable?
E.G.
$input = <STDIN>; #user inputs: 12345?
chop ($input);
How can I be sure that $input is numerical and not a string value?
I have been doing the equivalent to $input=$input+1 but i
know there has to be a better way to perform this function. Ultimately,
this value will be used for comparison to over 700,000 cells in a hash
table, so I need the value to be numeric (because numeric comparisons
are faster than string.)
If anyone could assist with this, I would be truly appreciative.
Thanx
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 22 Jun 2000 16:07:54 +0200
From: VAHAGN AVEDIAN <etxaved@etxb.ericsson.se>
Subject: Problem using sendmail
Message-Id: <39521DBA.9F400645@etxb.ericsson.se>
This is a multi-part message in MIME format.
--------------CCF431699D225470EEA1D15D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I have a problem using sendmail in my PERL CGI script where I use
'open(MAIL, "/usr/bin/sendmail -t");
print MAIL "To: name.sirname@domain.com\n";
.....
It seems that the script works for all emails, e.g.
'name@domain.com', 'name-sirname@domain.com' etc but the cases where
the email contains a dot (as in 'name.sirname@domain.com'). However if I
use
a incorrect receiver address I'm notified by the server that the email
address
does not exist. But if I use a valid address it just never gets there
and wanishes
out there somewhere....
I tried name\.sirname@domain.com, hoping it would help, but it
didn't...
Any ideas???
Thanks,
Vahagn
--
-------------------------------------------------------------------
Email: etxaved@etxb.ericsson.se
Tel Ericsson: +46 (0)8 719 82 03
Tel Mobile : +46 (0)707 73 33 83
--------------CCF431699D225470EEA1D15D
Content-Type: text/x-vcard; charset=us-ascii;
name="etxaved.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for VAHAGN AVEDIAN
Content-Disposition: attachment;
filename="etxaved.vcf"
begin:vcard
n:Avedian;Vahagn
tel;cell:+46 (0)707 73 33 83
tel;fax:+46 (0)8 719 77 50
tel;home:+46 (0)18 15 59 09
tel;work:+46 (0)8 719 82 03
x-mozilla-html:FALSE
url:http://www.csd.uu.se/~d93vav
adr;quoted-printable;quoted-printable:;;Varuv=E4gen 9B=0D=0A=C4V/ETX/D/XAGL;=C4lvsj=F6;Stockholm;S-126 25;Sweden
version:2.1
email;internet:etxaved@etxb.ericsson.se
title:Software design
org;quoted-printable:Ericsson Telecom AB;=C4V/D/XAGL
x-mozilla-cpt:;23168
fn:Vahagn Avedian
end:vcard
--------------CCF431699D225470EEA1D15D--
------------------------------
Date: Thu, 22 Jun 2000 14:27:13 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Problem using sendmail
Message-Id: <slrn8l48pm.bmb.garcia_suarez@rafael.kazibao.net>
VAHAGN AVEDIAN wrote in comp.lang.perl.misc:
>Hi,
>
>I have a problem using sendmail in my PERL CGI script where I use
>'open(MAIL, "/usr/bin/sendmail -t");
>print MAIL "To: name.sirname@domain.com\n";
This is not your actual code, is it?
You meant:
open(MAIL, "|/usr/bin/sendmail -t") # note the pipe to sendmail
or die "Can't open sendmail : $!\n"; # check return values of syscalls
print MAIL "From: myname\@domain.com\n"; # Provide a valid From: header
print MAIL "To: name.sirname\@domain.com\n"; # And escape the @ in double-
# quoted strings
>.....
>
>It seems that the script works for all emails, e.g.
>'name@domain.com', 'name-sirname@domain.com' etc but the cases where
>the email contains a dot (as in 'name.sirname@domain.com'). However if I
>use
>a incorrect receiver address I'm notified by the server that the email
>address
>does not exist. But if I use a valid address it just never gets there
>and wanishes
>out there somewhere....
Looks like a sendmail configuration problem. More precisely, this looks
like a mail alias configuration problem. But I can't guess more...
--
Rafael Garcia-Suarez
------------------------------
Date: Thu, 22 Jun 2000 10:29:25 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: regex engin's undocumented behaviour?
Message-Id: <395222C5.FEC7A71F@attglobal.net>
Tad McClellan wrote:
>
> aabbaa
> ^^^^
>
> That much matches, then the engine needs to start over again
> because it is not yet at end-of-string.
>
> The dollar-digit variables are reset to undef when it starts over.
>
> aabbaa
> ^^
>
> That matches the second time around (allowed by the +).
>
I thought the regex engine would always hold a marker for the first
position matched and backtrack to it?? What you are saying makes
logical sense, but it sure isn't the intuitive way of matching, IMO.
------------------------------
Date: Thu, 22 Jun 2000 15:12:25 +0200
From: Thibault DELPLANQUE <thibault.delplanque@renault.fr>
Subject: Testing a process on NT with Perl ?
Message-Id: <395210B9.54244FA6@renault.fr>
Hi all,
Now, I know how to create / kill a process on my NT server with a Perl
script, great !
But, I'd like to testing if a process is running or not... (I'm using
ActivePerl on Win95 / 98 / NT)...
Anybody here knows how to do ?
TIA,
--
Thibault DELPLANQUE
RENAULT - Unix Team -
Tel : 01 41 04 18 66
Fax : 01 41 04 50 44
GSM : 06 08 47 21 33
http://www.renault.com
------------------------------
Date: Thu, 22 Jun 2000 16:24:15 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Testing a process on NT with Perl ?
Message-Id: <3952218F.55C59B71@nospam.com>
Thibault,
Thibault DELPLANQUE wrote:
> I'd like to testing if a process is running or not... (I'm
> using ActivePerl on Win95 / 98 / NT)... Anybody here knows how to
> do ?
If you do not know the handle of the process it could be very hard. A
way there is using the third party TLIST.EXE utility coming with the
resource kit (callable via command line).
<code>
map { print "Running\n" if /TASKNAME\.EXE/ } (`TLIST.EXE`);
</code>
Best regards,
Marco
------------------------------
Date: Thu, 22 Jun 2000 13:55:53 GMT
From: bsmith@webnetint.com
Subject: uncoupling SQL from object classes
Message-Id: <8it5t1$2hr$1@nnrp1.deja.com>
In beginning to employ OO techniques in my Perl CGI programs, I find
that it would be wonderful if I could somehow move all my SQL reuquired
to manipulate my object data from the class methods themselves to some
"higher" application layer. I would like for each CGI program to grab a
db connection and provide access to all the object classes, and I would
like my SQL statements in some sort of configuration area where they can
be modified to fit different databases/structure with little or no
changes to the object class definitions.
Can someone lend some guidance as to what practices are employed with
using OO techniques with relational databases systems, MySql in
particular?
Thanks,
Brian
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 22 Jun 2000 14:41:16 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: uncoupling SQL from object classes
Message-Id: <MPG.13bcc2c781b68c4998974e@news>
bsmith@webnetint.com writes ..
>In beginning to employ OO techniques in my Perl CGI programs, I find
>that it would be wonderful if I could somehow move all my SQL reuquired
>to manipulate my object data from the class methods themselves to some
>"higher" application layer. I would like for each CGI program to grab a
>db connection and provide access to all the object classes, and I would
>like my SQL statements in some sort of configuration area where they can
>be modified to fit different databases/structure with little or no
>changes to the object class definitions.
>
>Can someone lend some guidance as to what practices are employed with
>using OO techniques with relational databases systems, MySql in
>particular?
I don't know what "practices are employed" .. but I have a collection
class that provides fairly standard collection methods applicable to a
range of different data
get
update
delete
add
getNext
getPrev
getAll
the item classes that make up the collections will change depending on
the data .. but the collection classes change very little (and the item
classes really only change their blessed hash - and their accessor
methods - if you're in to those)
then there are a few database classes .. essentially I split them up for
ease of maintenance .. the admin stuff will all be in one module - the
user stuff in another
they're singletons because I only want one database connection across
any and all modules that use the respective functions .. excuse the
formatting - trying to fit within 80 chars .. they look something like
this
package UserDatabase;
require 5.005;
$UserDatabase::VERSION = '1.0';
use DBI;
use Constants qw/DSN USERNAME PASSWORD LAST_ID_FUNCTION/;
my $self = undef;
sub single
{
my $class = shift;
die "Incorrect number of parameters passed to DatabaseHandle::new\n"
unless @_ == 0;
unless ( defined $self )
{
my $dbh = DBI->connect( DSN, USERNAME, PASSWORD);
$self
= bless { dbh => $dbh
, id => $dbh->prepare( 'SELECT '. LAST_ID_FUNCTION )
, table_sth => $dbh->prepare( 'SELECT * FROM table '
. 'WHERE id = ?'
)
# ...
# imagine as many prepared statements as you need here
# ...
} => $class;
}
$self;
}
sub DESTROY
{
$dbh->disconnect;
}
1;
from the collection classes you use it something like this
# attach to the singleton
my $dh = single UserDatabase;
# grab a statement handle to the statement we're interested in
my $sth = $dh->{table_sth};
# execute that statement
my $ret = $sth->execute;
# then use one of the $sth->fetchrow_ functions .. QED
btw .. excuse me if the code above doesn't run - I culled a few things
from it that are specific to my setup and can't really test the generic
version of it
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Thu, 22 Jun 2000 13:19:30 GMT
From: an400@freenet.carleton.ca (Steve A. Taylor)
Subject: Re: Where is @INC in ActiveState Perl for Win32 ???????
Message-Id: <39521215.11556254@news.ncf.carleton.ca>
On Thu, 22 Jun 2000 02:29:35 GMT, Jeff Helman <jhelman@wsb.com> wrote:
>Nick Palmer wrote:
>>
>> Nobody seems to know the answer to this question.
>
>I do. Open up a registry editor (regedit or regedt32). Go to the Local
>Machine structure. Go to software and add the key "Perl". Then, in the
>"Perl" key, add a "lib" REG_SZ value that points to whatever directory
>you want. I use this on all of my servers to keep my modules separate
>from the standard distribution. Specifically, I have "lib" defined as
>"c:/perl/wlib" on my servers.
>
>Hope this helps.
>JH
>
>> I've had lots of "It's in the registry somewhere....", "I think it's....",
>> but nobody knows!!!
>>
>> One suggestion was that it was in the file "Perl\lib\Config.pm"
>>
>> BUT:
>>
>> If you delete the file altogether then Perl still knows information where
>> the debugger is (in the registry) and still knows about @INC (not in the
>> registry)
>> E.g. if I try to debug a program (with Config.pm deleted) I get this
>> message:
>>
>> -----
>>
>> perl -d myprog.pl
>>
>> Can't locate Config.pm in @INC (@INC contains: c:\progra~1\perl\lib
>> C:/Program Files/Perl/lib C:/Program Files/Perl/site/lib .) at
>> C:\PROGRA~1\ACTIVE~1\PerlDB.pl line 84.
>>
>> BEGIN failed--compilation aborted.
>>
>> -----
>>
>> So it still keeps it's original values in @INC.
>>
>> Incidentally, the entry in @INC reported above, i.e. "c:\progra~1\perl\lib"
>> has been added by putting a value in the Registry
>>
>> key HKEY_LOCAL_MACHINE\Software\Perl with the name "PERL5LIB" and value
>> "c:\progra~1\perl\lib"
>>
>> Come on, someone must know!
>>
>> Yours Sincerely
>>
>> Nick
Look in CLPM where you also asked; (and in usenet guidelines)
------------------------------
Date: Thu, 22 Jun 2000 10:30:55 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: zope, python vs apache, perl
Message-Id: <3952231F.A746E9E8@attglobal.net>
amitr@w-o-i.com wrote:
>
> hi
>
> I want to evaluate zope, python vs apache, perl.
Good on you!
>
> which one can be used where!
> strong points and pitfalls.
>
This is the sort of thing that can start a language war. You are
asking in a Perl NG, so obviously the answers here are going to tend
to be biased towards Perl. The real answer is use them both, keep
the one that you like best. And have fun.
------------------------------
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 3452
**************************************