[15646] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3059 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 16 06:10:30 2000

Date: Tue, 16 May 2000 03:10:18 -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: <958471818-v9-i3059@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 16 May 2000     Volume: 9 Number: 3059

Today's topics:
    Re: Now serving 15? (How can I setup a small server in  <gellyfish@gellyfish.com>
    Re: Perl on AS/400.... <gellyfish@gellyfish.com>
    Re: perl on OS390 <sb@muccpu1.muc.sdm.de>
    Re: Programing Question... <webmaster@linkworm.com>
    Re: Queastion about CGI.pm sticky values (Alan Curry)
        Running a program through perl <kamri@asiapacificm01.nt.com>
    Re: Running a program through perl <billy@arnis-bsl.com>
    Re: Sending mail from Perl on NT <gellyfish@gellyfish.com>
    Re: shooting yourself in the foot ... (Csaba Raduly)
    Re: Starting another prog <gellyfish@gellyfish.com>
    Re: Starting another prog <billy@arnis-bsl.com>
        string starts with? <henjoSPAMKILL@glas.its.tudelft.nl>
    Re: string starts with? <phill@modulus.com.au>
    Re: Tanspose rows to columns <c.treczoks@ndh.net>
        xs: getting a char* into my Perl script <uackermann@orga.com>
    Re: zen and the art of trolling [OT] <you.will.always.find.him.in.the.kitchen@parties>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 16 May 2000 06:58:15 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Now serving 15? (How can I setup a small server in perl?)
Message-Id: <8fqo1n$62u$1@orpheus.gellyfish.com>

On Sat, 13 May 2000 13:36:25 -0700 Makarand Kulkarni wrote:
>>  I would really be thankful if someone could tell me how I
>> could set up a server in Perl.
> 
> perldoc  HTTP::Daemon
> 

I would suggest that Net::Daemon might be a better start.

/J\
-- 
Oh no! What have I done? I smashed open my little boy's piggy bank,
and for what? A few measly cents, not even enough to buy one beer. Wait
a minute, lemme count and make sure...not even close.
-- 
fortune oscar homer


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

Date: 16 May 2000 07:47:25 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl on AS/400....
Message-Id: <8fqqtt$fi3$1@orpheus.gellyfish.com>

On 15 May 2000 16:51:18 GMT Marc Logemann wrote:
> 
> 1) has anyone experiences in this?

Probably but not me.  The port hadnt been done when I last worked with an
AS/400 ...

> 2) is it possible to access db2/400 from perl installed on a linux system?

As far as I know you can use DBI & DBD::DB2 - I am pretty certain IBM have
a Linux version of their DB2 Client SDK which you will need to build this.

> 3) if q2 = no, what would be the best way to access db2/400 data from
> a linux system.
> 

You would have to ask in a DB2 or Linux newsgroup about this

/J\
-- 
Marge, there's an empty spot I've always had inside me. I tried to fill
it with family, religion, community service, but those were dead ends! I
think this chair is the answer.
-- 
fortune oscar homer


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

Date: 16 May 2000 09:56:59 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: perl on OS390
Message-Id: <8fr61b$6v0$1@solti3.sdm.de>

In article <Pine.GSO.4.10.10005151700410.25459-100000@user2.teleport.com>, Tom Phoenix <rootbeer@redcat.com> wrote:
> On Mon, 15 May 2000, Matteo Palmieri wrote:

>> Does anybody know what is the last supported version of perl for OS390
>> platform ?

> If it's not 5.6.0, it should be. :-)

Tom, you should know better!

Perl 5.6 is deliberately incompatible with any EBCDIC ports due to support
for Unicode. Both strands of development are supposed to be re-unified in
a later release.

If I'm not mistaken, the latest OS390 port is Perl 5.005_03 - Peter Prymmer,
is that correct?

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: Tue, 16 May 2000 03:07:38 -0700
From: "LinkWorm Software, Inc." <webmaster@linkworm.com>
Subject: Re: Programing Question...
Message-Id: <39211DEA.80D66D98@linkworm.com>

The Evil Beaver wrote:
> 
> LinkWorm Software, Inc. <webmaster@linkworm.com> wrote...
> ...
> > Yes, CGI can be used, which can be coded in Perl, C/++, Python and
> > other's. They can use combinations (or only) of CGI, PHP, ASP, Java,
> > etc. Many, many things are used, it depends on what you know best, and
> > what works best on said web server's OS/web server, etc. That's a very
> > vague question.
> Do we have ASP for any OS other than Windows yet?

Yes, but not quite up to par with Windows. Pretty BETA.

> If not, why bother even
> mentioning it?

Because he may be using Windows and have a better understanding of it.
He asked what languages these bigger sites use. Many use ASP. I didn't
say that is or is not the best choice. Hence, why I "mentioned it".

> ASP is pretty good, but as long as it's locked up on Windows, there is no
> need to bother with
> it.

Unless you use Windows and it'll best suit your needs, you understand it
better or your server admin (as stupid as it may be) won't install Perl.
I've seen it happen. There are legitimate reasons for using many things
that the majority will not like. I use ASP. I don't like it so much, but
it can be fun. I use it, because many people need work done in ASP. Just
because I don't prefer it myself, doesn't mean it's worthless. Only
knowing one interface (for example) and one language can be limiting in
this line of work.

> Same goes to VBScript and JScript, both of which are okay for server
> side work.

You mean "client side"... unless you're talking about writing ASP
scripts in different languages...

> If I am just out of date, please tell me...

Not really, in a way maybe, but I think it's more of an issue of your
opinion versus other's.
-- 
Regards,
Tim Greer: tech@linkworm.com | LinkWorm Software http://www.linkworm.com
Tel: 530 247-1749. Programming, CGI, Perl, C/C++, ASP, SQL, more. Design
Web Server & Network Administration, Security, Consulting, Installations
Configuration. Unix/Linux/FreeBSD & NT. Apache, IIS, TCP/IP, LAN/WAN/WWW


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

Date: Tue, 16 May 2000 04:07:34 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Queastion about CGI.pm sticky values
Message-Id: <aQ3U4.85334$vN5.12812253@news-east.usenetserver.com>

In article <39209dab.794692@news.earthlink.net>,
 <jamalone@earthlink.net> wrote:
>How is it possible to make variables retrieved from CGI.pm not sticky?
>I am going to go and get the book tomorrow but I can't find any online
>docs on it right now.

You can make all your fields with an explicit initial value and -override=>1
or if that makes the whole script look too cluttered, use 2 separate CGI
objects: one for reading the previous form results and one for printing the
next form.

-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: Tue, 16 May 2000 16:22:51 +1000
From: "Amri, Kuross [WOLL:4009-I:EXCH]" <kamri@asiapacificm01.nt.com>
Subject: Running a program through perl
Message-Id: <8fqpdc$q58$1@bcrkh13.ca.nortel.com>

G'day,
I have a script that I want to use to call another program in the same
directory. This program I want to call will have a variable passed to it as
its parameter. Is there any way of running a program through perl. I was
running it in a telnet session in perl before & I don't think it would be
easily done in a shell script (could be wrong).

Thanks for any questions, or answers,

ka




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

Date: Tue, 16 May 2000 09:37:34 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Running a program through perl
Message-Id: <8fr4ss$k8n$1@nnrp1.deja.com>

In article <8fqpdc$q58$1@bcrkh13.ca.nortel.com>,
  "Amri, Kuross [WOLL:4009-I:EXCH]" <kamri@asiapacificm01.nt.com> wrote:
> G'day,
> I have a script that I want to use to call another program in the same
> directory. This program I want to call will have a variable passed to it as
> its parameter. Is there any way of running a program through perl. I was
> running it in a telnet session in perl before & I don't think it would be
> easily done in a shell script (could be wrong).
>

Yes, you can start another program from your perl script, you may also
establish communication between parent and child process if needed.. There
are many ways to do it, but you didn't specify what you exactly need.

Plese read related documentation and pick a method you need:

perldoc perlfaq8
(or http://www.cpan.org/doc/manual/html/pod/perlfaq8.html)

perldoc perlipc
(or http://www.cpan.org/doc/manual/html/pod/perlipc.html)

perldoc -f system
(or http://www.cpan.org/doc/manual/html/pod/perlfunc/system.html)

perldoc -f fork
(or http://www.cpan.org/doc/manual/html/pod/perlfunc/fork.html)

perldoc -f exec
(or http://www.cpan.org/doc/manual/html/pod/perlfunc/exec.html)

perldoc -f open
(or http://www.cpan.org/doc/manual/html/pod/perlfunc/open.html)

perldoc perlop (about qx/STRING/ operator)
(or http://www.cpan.org/doc/manual/html/pod/perlop.html)

Hope this helps.

Ilja.



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


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

Date: 16 May 2000 07:56:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sending mail from Perl on NT
Message-Id: <8fqrf6$haf$1@orpheus.gellyfish.com>

On Mon, 15 May 2000 14:34:45 GMT old_flyer@my-deja.com wrote:
> Ok. I am familiar with calling system commands in UNIX, but I also have
> Active Perl on my NT machine. I want to use MS Outlook to mail out from
> a list of e-mail addresses.  I have done this easily in Perl, but
> anyone have any experience calling Outlook from the command line?  Can
> it be done, or do I need to get another mail client?
> 

You cant use Outlook as a command line mailer.  Things just arent done
like that in the Windows world.  Generally you will want to use Win32::OLE
to automate Outlook from within your program.  This is sketchily
documented in the Win32 specific FAQ that ships with ActivePerl - you
will almost certainly find examples in the archives of the Win32 perl
Mailing lists that you can find on the Activestate site.

/J\
-- 
I guess some people never change. Or, they quickly change and then
quickly change back.
-- 
fortune oscar homer


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

Date: 16 May 2000 08:32:05 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: shooting yourself in the foot ...
Message-Id: <8F366B91Bquuxi@193.82.145.131>

14 May 2000: A formal bug report was sent to Seti@Home, because the
following message originated from pj@no.spam (Peter Heslin) was
reported as containing signs of intelligence: 

>On Thu, 11 May 2000 10:10:03 -0400, Tad McClellan
[snip]
>
>Make a trigger pulling motion, and Perl will autovivify a gun for
>you, initialize it with bullets, fire a bullet ... and shoot you in
>the head -- because `head' is the default operand for that function
>and you didn't specify another.
>
>Peter
>

I think you're wrong here. You are "shooting yourself *in the foot*", 
so there's yer operand :-) If you wanted to "shoot yourself" then yes, 
the head is the default operand. All working as expected.
-- 
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com      http://www.sophos.com/
US Support +1 888 SOPHOS 9      UK Support +44 1235 559933
Life is complex, with real and imaginary parts.

-----BEGIN GEEK CODE BLOCK----- 
Version 3.1
GCS/IT/MU d- s:- a31 C++$ UL+ P+>+++ L++ E- W+ N++ w++>$ O++$ 
M-(+) V- PGP- t+ X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK----- 


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

Date: 16 May 2000 07:11:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Starting another prog
Message-Id: <8fqoqg$8l4$1@orpheus.gellyfish.com>

On Mon, 15 May 2000 10:14:12 -0700 Larry Rosler wrote:
> In article <8fohl3$n4j$1@nnrp1.deja.com> on Mon, 15 May 2000 09:56:56 
> GMT, Ilja <billy@arnis-bsl.com> says...
>> In article <391FC331.1F7CA592@datapharm.de>,
>>   Andreas Huber <ah@datapharm.de> wrote:
>> >
>> > how can I start another prog out of my perl-script, without keeping
>> > alive my main-script?
>> 
>> perldoc -f exec
>> 
>> (or http://www.cpan.org/doc/manual/html/pod/perlfunc/exec.html)
> 
> Ouch.  That is the WRONG answer, though it would become very clear to 
> anyone who reads the first paragraph of the document you refer to that 
> it is wrong, and what the correct answer is.

I might not have woken up yet but isnt exec() what the OP is asking for
when he says "without keeping alive my main-script" ?

/J\
-- 
What is abnormal in Life stands in normal relations to Art. It is the
only thing in Life that stands in normal relations to Art.
-- 
fortune oscar homer


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

Date: Tue, 16 May 2000 08:28:33 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Starting another prog
Message-Id: <8fr0r4$fva$1@nnrp1.deja.com>

In article <MPG.1389d03af658e20798aa7d@nntp.hpl.hp.com>,
  Larry Rosler <lr@hpl.hp.com> wrote:
> In article <8fohl3$n4j$1@nnrp1.deja.com> on Mon, 15 May 2000 09:56:56
> GMT, Ilja <billy@arnis-bsl.com> says...
> > In article <391FC331.1F7CA592@datapharm.de>,
> >   Andreas Huber <ah@datapharm.de> wrote:
> > >
> > > how can I start another prog out of my perl-script, without
keeping
> > > alive my main-script?
> >
> > perldoc -f exec
> >
> > (or http://www.cpan.org/doc/manual/html/pod/perlfunc/exec.html)
>
> Ouch.  That is the WRONG answer, though it would become very clear to
> anyone who reads the first paragraph of the document you refer to
that
> it is wrong, and what the correct answer is.
>

IMHO it is the *right* answer.

The OP's question was:
"how can I start another prog out of my perl-script, without keeping
alive my main-script?"

It's exactly what exec() does - it *replaces* the current process
image with a new one. I guess it is what OP means by
"... without keeping alive my main-script".

BTW maybe I got the question misinterpreted due to
my not-so-perfect English.
If so, please give me a right interpretation.

BRGDS
Ilja.




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


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

Date: 16 May 2000 09:20:03 GMT
From: Henjo <henjoSPAMKILL@glas.its.tudelft.nl>
Subject: string starts with?
Message-Id: <8fr3s3$el8$1@news.tudelft.nl>

How can I check if a string starts with another string?
For example:

I want to check if the string "iamareallycoolstring" starts with "iamnot"

   Henjo
 /-----------------------------------\
|  http://come.to/henjo               |
|  http://www.sweetdesign.nl          |
|  ICQ#  18616700                     |
 \-----------------------------------/


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

Date: Tue, 16 May 2000 19:35:08 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: string starts with?
Message-Id: <3921164C.6313@modulus.com.au>

Henjo wrote:
> 
> How can I check if a string starts with another string?
> For example:
> 
> I want to check if the string "iamareallycoolstring" starts with "iamnot"

1. Using regexs
$_ = 'iamareallycoolstring';
/^iamnot.*/ && print "starts with iamnot\n";

2. Using index
$_ = 'iamareallycoolstring';
index($_,'iamnot') || print "starts with iamnot\n";

perldoc perlop
perldoc perlre
perldoc -f index
provide extensive and reliable information on regular expressions in
perl, which are one of the main strengths of the language. So you owe it
to yourself to read them.

-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Tue, 16 May 2000 10:50:40 +0200
From: Christian Treczoks <c.treczoks@ndh.net>
Subject: Re: Tanspose rows to columns
Message-Id: <39210BE0.382E6A8D@ndh.net>

Xah schrieb:
> and that's so impressive for a Perl programer.
> Now witness a functional programer:
Oh, yes.. Functional programming - I remember a guy at our
university who was hot on functional programming. He showed me how
easy it is to print a list of primes: just define a list on numbers
with the typical properties of primes: can be divivded only by
1 and the number itself. Nice little one-liner in Miranda.

And the he started the program on the biggest sparc we had back
in ye olden times, and, behold, it died after 5 minutes (out of
memory) and listed the first ~20 primes :-)

I never touched functional programming again...


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

Date: Tue, 16 May 2000 11:56:11 +0200
From: Ulrich Ackermann <uackermann@orga.com>
Subject: xs: getting a char* into my Perl script
Message-Id: <39211B3B.FC316D7B@orga.com>

Hi;
I am trying get a string out of an C-function (e.g. get_name) which is
defined in a C library. The C-function returns an char*. 
After reading the perlxstut example 4 and the code of a friend, who did
nearly the same thing carefully I am still getting rubbisch into my
script.
The important part of my .xs-file looks like this:

     40 char *
     41 get_name()
     42 PPCODE:
     43     int len;
     44     char *name;
     45     name=(char*)malloc(sizeof(char[30]));
     46     name=  get_name();
     47     len = strlen(name); 
     48     printf ("xs: %s: %d \n", name,len);
     49     EXTEND(sp,2);
     50     PUSHs(sv_2mortal(newSViv(1)));
     51     PUSHs(sv_2mortal(newSVpv(name, len)));

The printf-statement gives me the correct values, but calling 

my ($int, $string) = Modul::get_name(); 

from within my script only gives me the integer-value correct. The
string-value looks like binary data and is not dependend on what
characters are in the string. 

Any help appriciated. BTW does anybody know a good tutorial for using
xs, because perlxstut is not giving enough information and I don't
understand to much of what is said in perlxs.

Thanks, Ulrich
-- 
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925 
mailto:uackermann@orga.com


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

Date: Tue, 16 May 2000 20:10:04 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <958464570.700688@shelley.paradise.net.nz>


"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:39207CA8.FC5A699E@vpservices.com...
> Tintin wrote:
> >
> > I think we can say with 99% certainty that it is her.  Notice how quiet
she
> > has been now that we know who she really is and what she looks like
(even
> > what her knickers look like).
>
> As you will be able to see from looking at the archives of this
> newsgroup, I have been active in trying to prevent misinformation caused
> by this person and I would sincerely like it if she contented herself
> with criticizing cabal members and in philosophizing and stopped with
> the bad advice to newbies.
>
> HOWEVER, I am thoroughly against this kind of tactic where you feel free
> to "expose" a person by publishing information about them they did not
> personally reveal and where you consider making remarks of a sexual
> nature fair game.  Please let us not sink to the level of trolls
> ourselves.  Criticize people on their contribution (or lack of it) to
> the Perl community but leave personal details and sexual innuendo out of
> the conversation.

I agree with most of what you say, but if a person puts something on a
publicly available web site, then it is by its very nature, public
information.




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

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 3059
**************************************


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