[15458] in Perl-Users-Digest
Perl-Users Digest, Issue: 2868 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 26 11:05:21 2000
Date: Wed, 26 Apr 2000 08:05:09 -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: <956761508-v9-i2868@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 26 Apr 2000 Volume: 9 Number: 2868
Today's topics:
5.6.0 make Problem jlsimms@hotmail.com
Re: 5.6.0 make Problem <tony_curtis32@yahoo.com>
5.6.0: split() doesn't handle Unicode? <Denis.Haskin@bigfoot.com>
Re: 5.6.0: split() doesn't handle Unicode? <elaine@chaos.wustl.edu>
Re: [New O'Reilly book ?!?] Has anybody seen it? <elaine@chaos.wustl.edu>
Re: \ in @ARGV (Tad McClellan)
Re: \ in @ARGV <tony_curtis32@yahoo.com>
Accessing Perl 5 on NT <eva@westelcom.com>
Re: Can anyone recommend a good book (Tad McClellan)
Re: Can anyone recommend a good book <michaelr@apgtest.com>
Re: files redirection to an external program <Frederic.Aussedat@Alcatel.fr>
Re: How to replace these strings in a html file (2nd p (Tad McClellan)
Re: man2html <idontlikespam_jcman@worldnet.att.net>
match and assign statement denance@my-deja.com
Re: match and assign statement (Eric Bohlman)
Net:FTP module not working for me on perl win32... <kmojar@bmjgroup.com>
NEWBIE: Testing scripts <jetlund@tele.ntnu.no>
Re: NEWBIE: Testing scripts <tfm@sei.cmu.edu>
Re: NEWBIE: Testing scripts <ppi@searchy.net>
Re: oral perl problem( I can't update table!) <red_orc@my-deja.com>
Perl2EXE Reassembler <R.Roethemeier@gmx.net>
ppmfix doesn't seem to fix ppm <johnlin@chttl.com.tw>
Re: Similar problem <tfm@sei.cmu.edu>
Re: Sort on xx-st piece of array <ppi@searchy.net>
strict <ppi@searchy.net>
Re: strict <tony_curtis32@yahoo.com>
Re: strict <sariq@texas.net>
Re: use strict; isn't good enough <aqumsieh@hyperchip.com>
Re: use strict; isn't good enough <aqumsieh@hyperchip.com>
Re: Voting script <kuse@transpatent.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Apr 2000 14:44:20 GMT
From: jlsimms@hotmail.com
Subject: 5.6.0 make Problem
Message-Id: <8e6vbv$40s$1@nnrp1.deja.com>
Alright... Perhaps those of you who have attempted the 5.6.0
installation can be of some assistance. I have installed Perl dozens
and dozens of times, and have been programming with it for a couple of
years, so I am certainly not new to some of its behavior. But recently,
when I tried installing 5.6.0, I had some weird things happen.
Everything, as far as I could tell, went great throughout the entire
Configure operation. No weird errors, etc. When I ran make, however,
the following message appeared:
makefile:691: *** target pattern contains no `%'. Stop.
So, I took a look at line 691 of the trusty makefile, and saw this:
config.h: Bletch: How does this C preprocessor catenate tokens?
Hmmm... This is strange, as I have a complete running copy of 5.005_03
on the same box. Does anyone have insight into this problem? To help,
here is some (perhaps) helpful system information:
Compiler: egcs-2.91.66
Linux Kernel: 2.2.14-5.0 (RedHat)
Otherwise, I can see nothing else wrong with the makefile. Any
assistance or insight would be appreciated.
Jason Simms
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 Apr 2000 10:02:29 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: 5.6.0 make Problem
Message-Id: <87d7ncx5ve.fsf@shleppie.uh.edu>
>> On Wed, 26 Apr 2000 14:44:20 GMT,
>> jlsimms@hotmail.com said:
> Alright... Perhaps those of you who have attempted the
> 5.6.0 installation can be of some assistance. I have
> installed Perl dozens and dozens of times, and have been
> programming with it for a couple of years, so I am
> certainly not new to some of its behavior. But
> recently, when I tried installing 5.6.0, I had some
> weird things happen.
> So, I took a look at line 691 of the trusty makefile,
> and saw this:
> config.h: Bletch: How does this C preprocessor catenate
> tokens?
> Compiler: egcs-2.91.66 Linux Kernel: 2.2.14-5.0 (RedHat)
The same as my system.
It looks like the Configure process didn't figure out how
to smash two tokens together using the C preprocessor.
Look in config.h for CAT2 and STRINGIFY. Are they set to
anything? Here's the bit of my config.h from 5.6.0 which
indicates the options (trimmed slightly for space
considerations).
#if 42 == 42
# define PeRl_CaTiFy(a, b) a ## b
# define PeRl_StGiFy(a) #a
/* the additional level of indirection enables these macros to be
* used as arguments to other macros. See K&R 2nd ed., page 231. */
# define CAT2(a,b) PeRl_CaTiFy(a,b)
# define StGiFy(a) PeRl_StGiFy(a)
# define STRINGIFY(a) PeRl_StGiFy(a)
#endif
#if 42 != 1 && 42 != 42
#include "Bletch: How does this C preprocessor catenate tokens?"
#endif
You might want to try playing with the C preprocessor
yourself to see if you can get it to catenate tokens using
##, e.g.
#define SMASH(a,b) a##b
SMASH(toge,ther)
and see what "gcc -E -" outputs when you enter the above.
hth
t
------------------------------
Date: Wed, 26 Apr 2000 13:37:46 GMT
From: Denis Haskin <Denis.Haskin@bigfoot.com>
Subject: 5.6.0: split() doesn't handle Unicode?
Message-Id: <3906F0B7.818D9BF1@bigfoot.com>
Is this a bug in Unicode support in 5.6.0 or is my expectation
incorrect? With the following test script:
<CODE>
use utf8;
$x = "This contains \x{A7} a unicode char.";
($b, $a) = split(/\x{A7}/, $x);
print "\$before: .$b.\n";
print "\$after: .$a.\n";
($b, $a) = $x =~ /^(.+)\x{A7}(.+)$/;
print "\$before: .$b.\n";
print "\$after: .$a.\n";
</CODE>
I would expect the split() and the m// to have the same result, but they
don't:
$before: .This contains .
$after: .§ a unicode char..
$before: .This contains .
$after: . a unicode char..
Is this a known bug? Am I wrong in expecting split() to return the same
result as m//?
Let me know if further details would be helpful. Depending on what I
hear, I'll file a bug report if it sounds right.
Thanks,
dwh
------------------------------
Date: Wed, 26 Apr 2000 14:09:02 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: 5.6.0: split() doesn't handle Unicode?
Message-Id: <B52C7100.30CF%elaine@chaos.wustl.edu>
in article 3906F0B7.818D9BF1@bigfoot.com, Denis Haskin at
Denis.Haskin@bigfoot.com quoth:
> Let me know if further details would be helpful. Depending on what I
> hear, I'll file a bug report if it sounds right.
Nope. Known bug.
e.
------------------------------
Date: Wed, 26 Apr 2000 14:06:59 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: [New O'Reilly book ?!?] Has anybody seen it?
Message-Id: <B52C7085.30CE%elaine@chaos.wustl.edu>
in article jaqcgs81869jsm9hi2ntopdf5a148pfmu9@4ax.com,
mitiste@charlie.iit.edu at mitiste@charlie.iit.edu quoth:
> Just stumbled across an ad in Linux magazine: a new
> Perl/O'Reilly book seems to be out (?!?): "Perl for System
> Administration" - has anybody had the chance to get their hands/eyes
It's in production from what I understand and will probably be another month
or two to get to market.
e.
------------------------------
Date: Wed, 26 Apr 2000 09:08:47 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: \ in @ARGV
Message-Id: <slrn8gdqiv.7j5.tadmc@magna.metronet.com>
On Tue, 25 Apr 2000 21:09:38 -0700, Anthony Argyriou <anthony@alphageo.com> wrote:
>How can I preserve a '\' in a command line?
Processing of command lines is done by the command processor (e.g. shell).
It happens before perl is invoked, and so has nothing to do
with Perl.
Ask in some newsgroup related to whatever command processor
you are using.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Apr 2000 09:07:52 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: \ in @ARGV
Message-Id: <878zy1q7k7.fsf@shleppie.uh.edu>
>> On Tue, 25 Apr 2000 21:09:38 -0700,
>> Anthony Argyriou <anthony@alphageo.com> said:
> How can I preserve a '\' in a command line? I am
> writing a script to call an image viewer from a windows
> program running under Wine (on Linux). The program
> generates a call of "program.exe
> c:\path\to\file". program.exe is planned to be a perl
> script which parses the remainder of the command line,
> then calls an appropriate program with the proper unix
> parameters/filenames. The backslashes in the filepath
> don't show up in @ARGV, making it difficult to parse the
> path.
That's something your shell is doing before it even gets
to perl. You'll need to investigate backslashing in
whichever shell you are using.
hth
t
------------------------------
Date: Wed, 26 Apr 2000 10:27:48 -0400
From: "eva" <eva@westelcom.com>
Subject: Accessing Perl 5 on NT
Message-Id: <3906ffc6@news.westelcom.com>
We have Perl 5 installed on our server, NT4 running IIS4 with SP6a. My
question is what is the best way to allow my domain users access to that
location? We host domains that wish to run Perl scripts.
Any help is greatly appreciated!
------------------------------
Date: Wed, 26 Apr 2000 08:30:34 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can anyone recommend a good book
Message-Id: <slrn8gdoba.7i5.tadmc@magna.metronet.com>
On Wed, 26 Apr 2000 10:31:58 +0100, Mark Rendle <rendle@clara.co.uk> wrote:
>Can somebody recommend the best book to go from knowing nothing of
>perl to competent CGI scripting in about a week?
You want to learn two things.
You should consider two books for the two things.
Get a Perl book to learn Perl programming ("Learning Perl" or
"Elements of Programming with Perl").
Get a CGI book to learn CGI programming.
Many (most? all?) books that purport to teach the two subjects
simultaneously do a profoundly poor job of it.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Apr 2000 08:50:48 -0600
From: Michael Roinestad <michaelr@apgtest.com>
Subject: Re: Can anyone recommend a good book
Message-Id: <39070248.6F271B50@apgtest.com>
Greetings,
BarnesandNoble.com has this CD-collection for $40 +/-. Thats about $20
cheaper the O'Reilly themselves sell it for.
I agree it is an awesome collection of books. However, CGI is only discussed to
a primer level, nothing real in depth.
Michael Roinestad
Apollinaris Schoell wrote:
> Hi
>
> The Perl CD Bookshelf
> It contains 6!! O'Reilly books on CD(including a search engine which runs on
> *nix and windows) and 'Perl in a Nutshell'.
>
> Polli
>
> "Mark Rendle" <rendle@clara.co.uk> writes:
>
> > I'm completely new to perl, never seen it before, but I've been programming
> > for over 10 years, used Unix ksh, still remember some awk, more recently
> > been using VC++ and VB, HTML and Javascript, need to learn CGI/Perl in a
> > hurry. Can somebody recommend the best book to go from knowing nothing of
> > perl to competent CGI scripting in about a week? Looked on amazon.co.uk but
> > the reviews contradict each other horribly...
> >
> > Thanks in advance,
> >
> > --
> >
> > Mark R
> > http://www.markrendle.co.uk (new and improved!)
------------------------------
Date: Wed, 26 Apr 2000 15:31:04 +0200
From: Frederic Aussedat <Frederic.Aussedat@Alcatel.fr>
Subject: Re: files redirection to an external program
Message-Id: <3906EF98.D778B331@Alcatel.fr>
Dans ta seconde proposition essaye :
system ("echo '$input' | pamb");
Pour la première : c'est soit un pb de droit d'execution, soit un pb de
path mal positionné. Mais cela me semble correcte.
pour faire plus lisisble sur input, utilise la notation 'heereafter
data' (données ci-dessous), c'est plus joli & beaucoup plus lisble dans
le cas de données multiplignes.
$input = << "END";
complex${num}topol
1
complex${num}mincrd
1
complex${num}.min.pdb
END
A+
Frédéric Aussedat
Logean Antoine a écrit:
>
> Hy,
>
> I use a program XXX that needs as input :
>
> complex17.topol
> 1
> complex17.mincrd
> 1
> complex17.min.pdb
>
> I can store these 5 lines in a script "input.txt" and direct or pipe
> it to XXX :
>
> % input.txt > XXX
>
> or
>
> % cat input.txt | XXX
>
> OK
>
> Now I must perform that a lot of times so I want to write a perl script
> to automatize that :
>
> I wrote this perl script :
> ------------------------------------------------------------------
> #!/usr/sbin/perl -w
>
> $num = 17;
> $input = "complex" . $num . ".topol\n";
> $input .= "1\n";
> $input .= "complex" . $num . ".mincrd\n";
> $input .= "1\n";
> $input .= "complex" . $num . ".min.pdb\n";
> open TRANS, "| pamb" or die "can not open the pipe : $!";
> print TRANS $input;
> close TRANS or die "can not close the pipe : $!";
>
> -------------------------------------------------------------
> error :
>
> Can't exec "pamb": Permission denied at concane.pl line 9.
> can not close the pipe : at concane.pl line 11.
>
> or
> --------------------------------------------------------------
> #!/usr/sbin/perl -w
>
> $num = 17;
> $input = "complex" . $num . ".topol\n";
> $input .= "1\n";
> $input .= "complex" . $num . ".mincrd\n";
> $input .= "1\n";
> $input .= "complex" . $num . ".min.pdb\n";
>
> system("$input > pamb");
> ----------------------------------------------------------------
>
> error :
>
> sh: complex17.topol: cannot execute
> sh[2]: 1: not found
> sh[3]: complex17.mincrd: cannot execute
> sh[4]: 1: not found
> sh[5]: complex17.min.pdb: not found
>
> so it does not work.
>
> How can i do that properly, I mean creation of an input file and
> redirection of it to an external program ?
>
> How can I store permanently this input-file (in my case $input) in a
> file on the hard disc ?
>
> What is exactly the difference between a redirection ant a pipe ?
>
> Thank you for your help
>
> Antoine
------------------------------
Date: Wed, 26 Apr 2000 08:23:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to replace these strings in a html file (2nd post)
Message-Id: <slrn8gdntk.7i5.tadmc@magna.metronet.com>
On Tue, 25 Apr 2000 22:49:56 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <WmuN4.560$d73.7519@newscontent-01.sprint.ca> on Wed, 26 Apr
>2000 00:41:42 -0400, Huy Vu <huyv@usa.net> says...
>> I did a batch file which contents:
>>
>> perl -e 's/>·</FONT><FONT size=2 style="font-family:'Arial';
>> font-size:10pt; " > />·</FONT><FONT size=2 style="font-family:'Arial';
>> font-size:9pt;" </FONT><FONT size=2
>> style="font-family:'Arial'; font-size:10pt; " >/g' file.htm
>>
>> There are many '/' in the line below (one long line in the batch file)
Those are not regex metacharacters.
Those are pattern match delimiters.
>Use alternate delimiters, for example any character that isn't in the
>regex or substitution:
>
> s!...!...!g
>
><Jeopardectomy>
... and arrange for something to be in $_ if you want to
pattern match against it.
Maybe you want to add a -n or -p switch?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Apr 2000 14:22:03 GMT
From: "Ira Weiner" <idontlikespam_jcman@worldnet.att.net>
Subject: Re: man2html
Message-Id: <fYCN4.35544$WF.1718121@bgtnsc04-news.ops.worldnet.att.net>
Thanks. I have an older version of groff, and it doesn't recognize
the -Thtml flag.
Wouldn't that leave me with the same problem, though, of how to pass a
variable from the CGI environment to a UNIX script?
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:8e4ucl$soe$1@orpheus.gellyfish.com...
> On Tue, 25 Apr 2000 12:33:42 GMT Ira Weiner wrote:
> > Bart Lateur <bart.lateur@skynet.be> wrote in message
> > news:39066518.8663375@news.skynet.be...
> >> Makarand Kulkarni wrote:
> >>
> >> >> Has anyone else gotten this perl script to work?
> >> >
> >> >yes. I got it to work. It works !!
> >>
> >> Gee, that is helpful.
> >>
> >
> > The version I have appears to work such that I need to "man <command> |
> > man2html" and man2html reads stdout and formats it to HTML. I wrote a
> > simple script to do this, but it does not recognize my environment
variable.
> > I guess the question now becomes: how to pass an environment variable
from a
> > browswer to a UNIX script
> >
> > #!/bin/bash
> > /usr/bin/man $1 | ./man2html
> >
>
> Quite honestly I wouldnt bother ;-} If you get the latest version of
> 'groff' then you can do :
>
> groff -man -Thtml /usr/man/man1/red.1
>
> For instance and cut out the middle man.
>
> If you are using a version of 'man' that supports it you
> could use the '-w' flag to get the path of the file that man would use.
>
> Of course you could wrap all this in a Perl program.
>
> /J\
> --
> The only link between Literature and the Drama left to us in England at
> the present moment is the bill of the play.
> --
> fortune oscar homer
------------------------------
Date: Wed, 26 Apr 2000 14:02:54 GMT
From: denance@my-deja.com
Subject: match and assign statement
Message-Id: <8e6su3$17l$1@nnrp1.deja.com>
Can someone please confirm/correct my interpretation of the rvlaue of
the following statment:
$ob=~/PA:"?([^"><,]+)"?,/
PA: followed by an optional " followed by anything but one or more of
the following characters: ^ " > < or , followed by an optional "
followed by a ,
Thanks
-Denance
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 Apr 2000 14:41:35 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: match and assign statement
Message-Id: <8e6v6v$9f6$1@slb0.atl.mindspring.net>
denance@my-deja.com wrote:
: Can someone please confirm/correct my interpretation of the rvlaue of
: the following statment:
: $ob=~/PA:"?([^"><,]+)"?,/
:
: PA: followed by an optional " followed by anything but one or more of
: the following characters: ^ " > < or , followed by an optional "
: followed by a ,
Not "anything but one or more of," but rather "one or more of anything
but." In plain(?) English: "PA:" followed by an optionally quoted string
that contains neither internal quotes nor angle brackets not commas,
followed by a comma.
------------------------------
Date: Wed, 26 Apr 2000 14:42:39 +0100
From: Kourosh A Mojar <kmojar@bmjgroup.com>
Subject: Net:FTP module not working for me on perl win32...
Message-Id: <3906F24F.A6727BB7@bmjgroup.com>
Dear all,
I am an fairly experienced novice user of perl. I am using perl win32
(ActivePerl 633) on win nt4 srvpck 5. Previously I used ftp oriented
scripts to automate some file transfers (while I was using cross
platform perl). Now I have upgraded/changed to perl win32 this no longer
works. I have installed (I hope I set everything correctly) and updated
the the latest libnet module (using ppm.bat) which includes the ftp
Net::FTP module. Since I changed I cant use the FTP modules. I get this
syntax error:
syntax error at C:/Perl/site/lib/Net/Config.pm line 86, near ">"
Compilation failed in require at C:/Perl/site/lib/Net/FTP.pm line 21.
BEGIN failed--compilation aborted at C:/Perl/site/lib/Net/FTP.pm line
21.
Compilation failed in require at D:\ce\is3_prnt\support\copy_ftptest.pl
line 3.
BEGIN failed--compilation aborted at
D:\ce\is3_prnt\support\copy_ftptest.pl line 3.
I have looked at the modules but I don't think I can decide or
understand where I am going wrong.
Can any one help me? Thanking you in advance and for your kind
attention,
Kourosh A Mojar
kmojar@bmjgroup.com
------------------------------
Date: Wed, 26 Apr 2000 16:04:46 +0200
From: Ola Jetlund <jetlund@tele.ntnu.no>
Subject: NEWBIE: Testing scripts
Message-Id: <3906F77E.ABCD38F4@tele.ntnu.no>
Hi,
I'm trying to test a script. The scripts work when I test it from the promt:
perl test.pl
But I can't seem find out how to test it with netscape. When I write the
scripts location on my harddisk netscape wants to download it. and I have
tried to"chmod" to almost any value.
Help
--
------------------------------------------------------
Email: jetlund@tele.ntnu.no
Mail: Harald Bothnersvei 8, 7051 Trondheim, Norway
Telephone - work: +47 73 59 27 47
- home: +47 73 82 19 25
- mob.: +47 91 54 45 79
------------------------------
Date: Wed, 26 Apr 2000 10:25:00 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: NEWBIE: Testing scripts
Message-Id: <3906FC3C.C4EF2D38@sei.cmu.edu>
Ok,
This isn't strictly a perl problem. Has more to do with CGIs than
Perl.
Where are you putting this file? I am assuming that you are running on
a Unix-like system with Apache as your web-server.
if you are accessing your page with a URL like
http://<server>/~<user>...
Then there should probably be a directory called cgi-bin under your
public_html directory.
What may be happening is the server isn't set up to recognize these
directories as containing executables. What you can (try to) do is add
a .htaccess file to this director with the line
Options +ExecCGI
in it. This tells Apache to consider this directory as containing
executable content. Entries in this directory should be chmod'ed to
(something like) 755 (rwxr-xr-x). You don't want the DIRECTORY or any
FILE IN THE DIRECTORY to be world writable AND executable. Big security
hole if you do.
If you are using other OS's and / or web-servers, then I can't help you
at all.
Ted
Ola Jetlund wrote:
>
> Hi,
>
> I'm trying to test a script. The scripts work when I test it from the promt:
>
> perl test.pl
>
> But I can't seem find out how to test it with netscape. When I write the
>
> scripts location on my harddisk netscape wants to download it. and I have
>
> tried to"chmod" to almost any value.
>
> Help
>
> --
> ------------------------------------------------------
> Email: jetlund@tele.ntnu.no
> Mail: Harald Bothnersvei 8, 7051 Trondheim, Norway
> Telephone - work: +47 73 59 27 47
> - home: +47 73 82 19 25
> - mob.: +47 91 54 45 79
------------------------------
Date: Wed, 26 Apr 2000 17:00:02 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: NEWBIE: Testing scripts
Message-Id: <39070472.5CAD38AF@searchy.net>
I see you are using linux.
If right your system has already a http server. You can find it out by
going here: http://127.0.0.1/
If it doesn't respond or respond with an error, its not installed. Then
you must download it first from http://www.apache.org/ , compile and
install it.
Usually when the server is installed you can find your webdir in most
cases here: /usr/local/httpd
You must place all perl scripts in the cgi-bin to let the do their job.
Ola Jetlund wrote:
>
> Hi,
>
> I'm trying to test a script. The scripts work when I test it from the promt:
>
> perl test.pl
>
> But I can't seem find out how to test it with netscape. When I write the
>
> scripts location on my harddisk netscape wants to download it. and I have
>
> tried to"chmod" to almost any value.
>
> Help
>
> --
> ------------------------------------------------------
> Email: jetlund@tele.ntnu.no
> Mail: Harald Bothnersvei 8, 7051 Trondheim, Norway
> Telephone - work: +47 73 59 27 47
> - home: +47 73 82 19 25
> - mob.: +47 91 54 45 79
--
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
------------------------------
Date: Wed, 26 Apr 2000 14:38:38 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: oral perl problem( I can't update table!)
Message-Id: <8e6v1b$3s3$1@nnrp1.deja.com>
In article <8e33sp$ngv$1@news.tamu.edu>,
"yoon" <yoonjung@cs.tamu.edu> wrote:
> I can't update the table. I don't know why.
> I could do "select " statment using &ora_open;
>
> $query1= "update $data_DB_Nm set pre_dept='$data{'pre_dept'}',
> pre_courseno='$data{'pro_no'}',instructor='$data{'inst_tamu_id'}',
> instruid='$data{'inst_logid'}' where courseno = $data{'course_id'} and
> sectionno = $data{'course_section'} and term='$semester' and dept =
> '$data{'dept'}';";
>
I don't know if the oracle DBI is similar enough to the mySQL DBI for
this to help, but in the mySQL DBI, the SQL line terminator ';' needs to
be omitted from the query when used through the DBI like this, even
though it is required at the command line interface.
I guess the idea is that the database interface knows when the SQL
command terminates when a program feeds it, but needs the terminator
when the SQL command is simply typed in.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 13:51:20 GMT
From: Ron Sommer <R.Roethemeier@gmx.net>
Subject: Perl2EXE Reassembler
Message-Id: <8e6s8h$gu$1@nnrp1.deja.com>
Hi,
worst english, excuse me please.
I ´ve got following problem:
I wrote a program to erase a network-problem in a company (language:
TP7) and want sold it to them.
This company said:We don´t need this function. Now 3 month later I´ve
found an Perl-Script on there intranet, which is compiled with perl2exe
and has the same function like my program. Is there any chance to get
the source-code out of the compiled perl ?
I think about something like Source-Grabber for c++ and delphi.
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 21:53:33 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: ppmfix doesn't seem to fix ppm
Message-Id: <8e6s3l$mo8@netnews.hinet.net>
Dear all,
I installed Win32 ActivePerl5.6 and got error messages when
I tried to re-install all the packages I installed in the old version.
C:\unzipped\Win32-ASP>ppm install Win32-ASP.ppd
Error installing package 'Win32-ASP.ppd': Could not locate
a PPM binary of 'Win32-ASP.ppd' for this platform
PPM hot fix (ppmfix.zip)? Yes, I tried, and got the same error messages.
What shall I do?
People say Perl5.6 can re-use packages installed in old version.
But I didn't see this feature during the whole installation process.
What did I miss?
Thank you.
John Lin
P.S.
During the struggle, I removed the old Perl version. But it didn't help.
Thus, I have no chance to see the 're-use old packages' feature either.
------------------------------
Date: Wed, 26 Apr 2000 09:25:02 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: Similar problem
Message-Id: <3906EE2E.C9A5C063@sei.cmu.edu>
OK, I'm assuming that this is something like a POSIX operating system.
I'm also coming from a C language environment.
There is a signal called SIGCHLD (or some variant there of) that gets
sent to a parent process when a child process dies / terminates.
One choice you have is to have the parent poll for status of it's
children. One way to do this is by using the WAIT or WAITPID functions
(probably you want WAITPID).
pid_t waitpid( pid_t pid, int *stat_loc, int options);
if pid is -1, the wait is for any child.
if pid is = 0, the wait is for any child with the same process group as
the parent process
if pid is >0, the wait is for the process with that pid value
if pid is < -1, the wait is for any child process of a process group
|pid|.
Options are some combination of WNOHANG and NUNTRACED (probably you
want WNOHANG).
stat_loc returns a status value of the requested process.
The function will return either the PID value of the task status'ed, -1
if there is an error, and 0 if there is no child available.
The other way you can deal with this is set up a signal handler, catch
SIGCHLD, and then wait/waitpid the signalling process.
I don't know if your PERL environments have similar capabilities (the
probably do).
There is a limit on the number of child processes a process can have,
so, if you don't get rid of the terminated child processes, you get to
the point where you can't spawn off any more processes.
Good luck
Ted
andrewspruce@my-deja.com wrote:
>
> We have a similar problem :
>
> As per man page we fork and if the allocation
> returns non-zero defined value we do parent stuff:
>
> if (my $pid = fork) {
> # Parent stuff
> $children++;
> $usedDbh{$pid} = $dbh;
> next TABLE;
> } elsif (defined $pid) {
> # Child stuff
> my $rows = 0;
> my $context = new SHA;
> $context->reset;
> }
> else {
> # undef handling
> }
>
> We get zombies (entries in the process table
> marked as <defunct>) and the parent has some max
> number of children logic so when all slots
> allocated are defunct the parent simply sits and
> waits.
>
> We do not use signal handlers for the child.
>
> Any ideas ?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 16:15:40 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: Sort on xx-st piece of array
Message-Id: <3906FA0C.C8FE8DED@searchy.net>
I had already a script myself. But somehow it just failed when trying to
sort my attached file.
I also tried various others, but without success...
nobull@mail.com wrote:
>
> Penpal International <ppi@searchy.net> writes:
>
> > I have an array loaded from a file (I've attached it). All fields are
> > splitted by a \| . The last one of them must also be splitted with <|>
> > (< or >). Does anyone know how to sort the lines of the file?
>
> See FAQ: "How do I sort an array by (anything)?"
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
--
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
------------------------------
Date: Wed, 26 Apr 2000 16:51:57 +0200
From: Penpal International <ppi@searchy.net>
Subject: strict
Message-Id: <3907028D.B68E9E90@searchy.net>
I'm already programming in perl for quite a while (1.5 years). But I
still have no idea what this exactly does: "use strict" Can someone
explain the use of it?
Thanks,
Frank de Bot
--
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
------------------------------
Date: 26 Apr 2000 10:04:22 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: strict
Message-Id: <87aeigx5s9.fsf@shleppie.uh.edu>
>> On Wed, 26 Apr 2000 16:51:57 +0200,
>> Penpal International <ppi@searchy.net> said:
> I'm already programming in perl for quite a while (1.5
> years). But I still have no idea what this exactly does:
> "use strict" Can someone explain the use of it?
Hmmm, haven't you found "perldoc" after 1.5 years?
perldoc strict
hth
t
------------------------------
Date: Wed, 26 Apr 2000 10:04:33 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: strict
Message-Id: <39070581.2F289929@texas.net>
Penpal International wrote:
>
> I
> still have no idea what this exactly does: "use strict" Can someone
> explain the use of it?
How many times do people have to tell you to RTFM before you start RTFM?
perldoc strict
- Tom
------------------------------
Date: Wed, 26 Apr 2000 14:16:01 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: use strict; isn't good enough
Message-Id: <7aog6x7xsv.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
<dwb1@home.com> writes:
> Is there a way to get perl to validate function calls on execution?
If you mean 'during compile time', then the answer is 'not really'.
> "use strict" is wonderful for variables, but doesn't seem to work
> for function calls... I need to be able to know at compile-time if
> a function used by a perticular script is actually available to the
> script or module calling it... right now, the scripts just wait until
> they get to that function and bomb if it can't find it...
If you're unsure of the availability of some subroutine, you can test
it with defined():
if (defined &func) {
func(@args);
} else {
print "Function func not defined\n";
}
This will not catch any undefined functions during compilation though.
HTH,
--Ala
------------------------------
Date: Wed, 26 Apr 2000 14:33:08 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: use strict; isn't good enough
Message-Id: <7aln217x0d.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
Alex Rhomberg <rhomberg@ife.ee.ethz.ch> writes:
> dwb1@home.com wrote:
> >
> > Is there a way to get perl to validate function calls on execution?
>
> You mean at compile time..
>
> use the critical function calls without ampersands or parens:
>
> % perl -Mstrict -wle'print 1;b 1'
> Execution of -e aborted due to compilation errors.
What Perl are you using? I get this:
% perl -Mstrict -wle'print 1;b 1'
Bareword "b" not allowed while "strict subs" in use at -e line 1.
Unquoted string "b" may clash with future reserved word at -e line 1.
Number found where operator expected at -e line 1, near "b 1"
(Do you need to predeclare b?)
syntax error at -e line 1, near "b 1"
Execution of -e aborted due to compilation errors.
To be able to call a subroutine without the ampersand or parens, you
have to predeclare it. This means that you have to know before hand
whether a subroutine exists or not, which defeats the purpose.
--Ala
------------------------------
Date: Wed, 26 Apr 2000 21:25:38 +0200
From: Leif Kuse <kuse@transpatent.com>
Subject: Re: Voting script
Message-Id: <390742B2.B5B69F3E@transpatent.com>
> What would you consider secure enough for your needs?
>
> Please consider your answer carefully before replying.
>
My suggestions are as follows:
1. The sysadmin launches an election
2. The system sends some PGP signed messages to the voters. One for each
cndidate.
3. The voters forward one of theese messages with the name of the
corresponding candidate back to the electionserver.
4. The server checks the PGP signature and after a certain time the
result of the election will be sent back to the voters.
Is there a work for that in progress?
Leif.
------------------------------
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 2868
**************************************