[8052] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1677 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 19 22:21:12 1998

Date: Mon, 19 Jan 98 19:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 19 Jan 1998     Volume: 8 Number: 1677

Today's topics:
    Re: "LWP::Simple;" Problem <merlyn@stonehenge.com>
        are there something like "Perl for Idiot" in Bookstore? <uchat@rocketmail.com>
    Re: are there something like "Perl for Idiot" in Bookst (Mike Stok)
    Re: Create file <rhodri@wildebst.demon.co.uk>
    Re: Detecting the presence of a sub declaration <dgoddard@us.oracle.com>
        File name from descriptor (David Stashower)
        help - torture testing webserver? (Ken Gaugler)
        Help Please (corey andersen hammer)
    Re: I am still a virgin <camerond@mail.uca.edu>
    Re: Last change script <johnrs@dc.net>
        living and free software (was: Re: source into binary c (Greg Bacon)
        Local ISP POST is good, AOL POST returns error (DRSFASAYPE)
    Re: Local ISP POST is good, AOL POST returns error (Martien Verbruggen)
        newbie question about ipc <sanct@dlc.fi>
        Obtaining Source Code (ovanes manucharyan)
        Odd syntax problem (System Administrator)
        package declaration <dzuy@dazel.com>
        Perl + C in NT <ni@aoe.vt.edu>
    Re: PERL forking <cbpkxh@arcochem.com>
    Re: Perl on NT server 4.0 (Roland Sellger)
    Re: Perl on NT server 4.0 smcdani@clemson.edu
    Re: PL/SQL in Oraperl <dgoddard@us.oracle.com>
    Re: please, help me, help me, help me..... (Greg Bacon)
    Re: problem with POST method for NT (Roland Sellger)
    Re: returning values out of a recursed sub <rhodri@wildebst.demon.co.uk>
    Re: source into binary code <rjc@liddell.cstr.ed.ac.uk>
    Re: source into binary code (John Stanley)
    Re: Switch statement in Perl-5??? <david.mohorn@sourcebbs.com>
    Re: Switch statement in Perl-5??? (Martien Verbruggen)
    Re: Use of uninitialized value at fastbib.pl line 103. <dhoover@textwise.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 19 Jan 1998 17:55:38 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: "LWP::Simple;" Problem
Message-Id: <8ciurgge0l.fsf@gadget.cscaper.com>

>>>>> "Phil" == Phil Buckley <!pbuckley@tiac.net> writes:

Phil> I am still very bad at perl, but I did find a really great perl
Phil> program at this guys site, he was kind enough to share it with me, but
Phil> I can't get it to work correctly on my server.

Phil> I am receiving the following error message:

Phil> Can't locate LWP/Simple.pm in @INC (@INC contains:
Phil> /usr/lib/perl5/i386-openbsd/5.00404 /usr/lib/perl5
Phil> /usr/lib/perl5/site_perl/i386-openbsd /usr/lib/perl5/site_perl .) at
Phil> /home/us001287/cgi-bin/stockquote.pl line 21.
Phil> BEGIN failed--compilation aborted at
Phil> /home/us001287/cgi-bin/stockquote.pl line 21.
Phil> [Wed Jan 14 08:06:14 1998] [error] Premature end of script headers:
Phil> /home/us001287/cgi-bin/stockquote.pl

[...]

Phil> Any ideas? Any guidance?

Yes.  You need to install LWP!  It doesn't come with Perl, but it's
found in the CPAN.

Phil> remove the "!" before replying via e-mail

Remove the ! before posting, please.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 224 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 20 Jan 1998 01:41:35 GMT
From: "Chat U" <uchat@rocketmail.com>
Subject: are there something like "Perl for Idiot" in Bookstore?
Message-Id: <01bd2501$51c37180$4c05c180@default>

I just jumped from win95 to Unix a couple weeks ago.  
I'm do well with pascal and OK with C....but right now, perl is my choice
:-)

Any comments about Perl books for beginer?

Thanks a lot.
^_^



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

Date: 19 Jan 1998 21:01:04 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: are there something like "Perl for Idiot" in Bookstore?
Message-Id: <6a10h0$2im$1@stok.co.uk>

In article <01bd2501$51c37180$4c05c180@default>,
Chat U <uchat@rocketmail.com> wrote:
>I just jumped from win95 to Unix a couple weeks ago.  
>I'm do well with pascal and OK with C....but right now, perl is my choice
>:-)
>
>Any comments about Perl books for beginer?

O'Reilly's Learning Perl is pretty good by all accounts.  You cn check out
Tom's book reviews (Camel Critiques) on http://www.perl.com/ or look at
O'Reilly's blurb at http://www.ora.com/catalog/lperl2/

perldoc perlbook

works on recent perl installation will get some information...

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 20 Jan 1998 00:12:00 +0000 (GMT)
From: Rhodri James <rhodri@wildebst.demon.co.uk>
Subject: Re: Create file
Message-Id: <480b218780rhodri@wildebst.demon.co.uk>

In article <34C2E4D1.4EC6645@coos.dartmouth.edu>,
 Chipmunk <rjk@coos.dartmouth.edu> wrote:
> I think it's safe to assume that is the defined behavior of the
> interface, since Lincoln Stein is the author of CGI.pm.

Ah.  Implementors are always the worst people for using undocumented
behaviour :-)

-- 
Rhodri James  *-*  Wildebeeste herder to the masses
If you don't know who I work for, you can't misattribute my words to them

 ... My heart is Danish, likewise is it blue


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

Date: Mon, 19 Jan 1998 14:49:59 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: Detecting the presence of a sub declaration
Message-Id: <34C3D897.72397467@us.oracle.com>

> Re: Detecting the presence of a sub declaration, Russ
> <rra@stanford.edu> said:
>
> Russ> What I'm looking for is an implementation of
> Russ> sub_exists().
>
> defined &$subname
>
> should be what you want, I think.

   Yes. And for lots of good info on similar stuff, see the *excellent*
book
_Advanced Perl Programming_, by S. Srinivasan



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

Date: Mon, 19 Jan 1998 15:31:32 -0700
From: rc0230@email.mot.com (David Stashower)
Subject: File name from descriptor
Message-Id: <rc0230-1901981531320001@mac-stash.sps.mot.com>

Is there a way to retrieve the file name (relative, full pathname,
whatever) from an "open" file-descriptor ?  I.e. such that a routine can
be passed a descriptor for an open file, but be able to "find out" and
handle the actual file involved.

Any ideas ?

Thanks,
David


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

Date: Tue, 20 Jan 1998 00:02:37 GMT
From: keng@hybrid.com (Ken Gaugler)
Subject: help - torture testing webserver?
Message-Id: <34c7e818.544806832@news.hybrid.com>

There was a program in volume 8 of The Perl Journal that could be used
to torture test webservers. Unfortunately there are some issues with
the Perl installation that for now prevent me from using that script.

Are there any good freeware/shareware/$$ware programs available for
pounding a server, or to see if there are any configuration problems,
security holes, etc? If my server can be broken, I would like to know
before I turn it loose on the 'net.

Thanks in advance!
-Ken


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

Date: 20 Jan 1998 02:41:17 GMT
From: c-hammer@students.uiuc.edu (corey andersen hammer)
Subject: Help Please
Message-Id: <6a12sd$fv$1@vixen.cso.uiuc.edu>

I'm writing a script using cgi-lib.pl.  However, PERL won't let me use the -d
switch to degub my script.  It keeps giving me "Can't locate perl5db.pl in
@INC."  I get a similar message when I use -w to check the warnings, but this
one is about cgi-lib.pl.  I added the following line to my script when I found it:

BEGIN { unshift(@INC, '/perl/custom'); }

but it doesn't work.  I've tried adding the drive letter and switching to 
backslashes, but that didn't work either.  I've been using CGI Primer Plus
by Mohammed Kabir to learn what I need for my script, but it doesn't cover 
troubleshooting PERL itself.  The html docs that came with PERL are no help
either.  They don't provide any real help on this problem.  Does anyone on
this group know what my problem is and how to solve it.

Please respond to:

Corey Hammer
chammer@shrike.depaul.edu


The University of Illinios account is my old undergraduate account.
Do not respond there.
--
Corey Hammer
c-hammer@uiuc.edu
Visit Corey's Castle at http://www.students.uiuc.edu/~c-hammer


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

Date: Mon, 19 Jan 1998 17:10:17 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Kelly Hirano <hirano@Xenon.Stanford.EDU>
Subject: Re: I am still a virgin
Message-Id: <34C3DD59.3EE61807@mail.uca.edu>

Nope, Kelly, that isn't (necessarily) it, I tried it w/NS Fasttrack, and
-Type worked just as well as -type. However, as Jim Bowlin pointed out,
she mentions nowhere that she has a _server_ involved!

Cameron Dorey
camerond@mail.uca.edu

Kelly Hirano wrote:
> 
> i believe the line "Content-type: text/html\n\n" is case sensitive and
> the
> 't' in type must be lowercase, not uppercase.
> 
> hope that helps!
> 
> kelly
> 
> In article <34C22707.304E3D13@hotmail.com>,
> Kati  <katigaebler@hotmail.com> wrote:
> >Hello,
> >
> >Could someone help me get started.
> >
> >I made a simple test and placed
> >it in my cgi bin:
> >
> >#!/usr/bin/perl
> >
> >print "Content-Type: text/html\n\n";
> >print "This is my first test\n";
> >


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

Date: Mon, 19 Jan 1998 17:51:35 -0500
From: john -r s <johnrs@dc.net>
To: Rick <rlluhman@netins.net>
Subject: Re: Last change script
Message-Id: <34C3D8F6.A25FB786@dc.net>

Rick - This is a general description.. You can adjust fire as you need to. Also
I dont know if this can be done better using javascript. As always though,
there is more than one way to do it.

If you are using cgi then you can do something like:
1. Use the cgi to render the parts of your page.
2. Read file date using something like this command $last =
(stat("myfile"))[9];
3. Render the date information. Heres an example:

    print <<END;
    HTML stuff here
    .
    .
    .
    <H1>Last Modified:</H1>
    END
    print "$last<p>\n";

Rick wrote:

> Anyone know of a script that can be used on a WEB page  to let someone know
> when a different text file was last changed.
>
> RICK



--
john -r s (unix spelling)
johnr~s (Windows 3.1 spelling)
JOHNRS (DOS spelling)
John R S (Win95 spelling)




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

Date: 19 Jan 1998 23:37:40 GMT
From: gbacon@adtran.com (Greg Bacon)
Subject: living and free software (was: Re: source into binary code)
Message-Id: <6a0o44$20k$9@info.uah.edu>

In article <6a0hvf$3hi$1@news.orst.edu>,
	stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
: In article <6a0dg5$20k$1@info.uah.edu>, Greg Bacon <gbacon@adtran.com> wrote:
: you need to be able to enforce your rights to limit who
: uses your software for it to be true. With perl, you cannot.  With perl,
: if you give the source away, you give the ability to use it away. 

I don't have much use for useless software. :-)  This is the sort of
attitude that begat license managers and Unices shipping without a
bundled C compiler. :-(

: >...or perhaps it's just me, and I'm reading between some obscure, hidden
: >lines in both of these guys' posts.  Nevertheless, I believe firmly in
: >the free software movement and have myself made decent money by charging
: >for the time it took me to write software which I retained the right to
: >make freely available.
: 
: I have never questioned the "free software movement" for those who wish
: to follow that path. Yes, there's lots of great free software out
: there, and I use lots of it every day. I am also not trying to make a
: living by giving away software, so I can afford to give what I write
: away, too.

No one is claiming to make a living by giving away software.  Why do you
insist on returning to a settled point?  MAKING A LIVING AND GIVING AWAY
SOFTWARE ARE INDEPENDENT EVENTS--KNOWLEDGE OF ONE DOES NOT PROVIDE
EVIDENCE FOR THE OTHER.  Was that clear enough?

: What I question is the attitude of the "free software movement" that,
: because it is good enough for them, it is the way everyone must
: operate.

s/must/should/--the free software movement is just like any other
religion: it has its rituals, symbols, icons, prophets, etc.  What fun
would religion be without evangelists?

: I also note yet another example of how you make a living by giving
: software away based on the facts that you make a living by charging for
: the software. You make a living by charging for the time to write the
: software, not by giving it way.

You misunderstand.  Read carefully: I charge for my time spent (plus a
little more) for a service rendered, just like a plumber or an
electrician or an auto mechanic might.  Wouldn't you be upset if one of
these service agents tried to tell you how you could and couldn't use
the results of their labor?  They don't attempt to prevent you from
discovering what techniques they used to fix your problem.  You're free
to learn how and do it yourself, but you don't have their skill or
experience.  The same is true of a programmer.

: It's great that you give it away. 

No, for me, it's the Right Thing.  I, along with many others, feel the
world would be a better place if others had similar convictions.

: >Source hoarders be damned.
: 
: My my, yes, that attitude I was just talking about. 

It is natural and normal to harbor contempt for those who cause trouble
and are generally harmful to society.

: First, it isn't "hoarding" if you want to sell your code. It's called
: "capitalism", and "entrepreneurial spirit". You don't make money if you
: hoard, you make money if you sell. 

You're referring to selling an obfuscated version of your work.  This is
still hoarding.  No one can benefit from what you've learned.  You're
not contributing to human knowledge.  Greed is motivating you to the
point of eliminating any feelings of altruism you might have.  I
question any action motivated by greed.

The Internet wasn't pioneered by greedy source hoarders, but we're
definitely infested with them now.  No Utopia can last when there's
greed.

: But, more important, if you don't want to use their source, write your
: own and don't pay for theirs. Nobody forces you to use their code, just
: like nobody forces you to give yours away. You have no grounds to demand
: their services, just like nobody has a right to demand yours.

I don't demand anyone's service any more than evangelists (of tolerant
religions) demand conversion.  I'm just painting a picture of how nice
things would be for everyone if they joined the free software movement.

Greg
-- 
open G,"|gzip -dc";$_=<<EOF;s/([0-9a-f]+)/print G pack"h*",$1/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 19 Jan 1998 23:55:37 GMT
From: drsfasaype@aol.com (DRSFASAYPE)
Subject: Local ISP POST is good, AOL POST returns error
Message-Id: <19980119235500.SAA15448@ladder01.news.aol.com>

I'm using a CGI script to POST form data to a web site and return data via
e-mail. E-mail works for local ISP dial up and AOL. POST routine works for ISP
but returns message: Cannot retrieve http://www.dwbp-onlinPOST at AOL. Our web
site address is http://www.dwbp-online.com. Our ISP is stuck on this problem
and advised to call AOL... hmmm. Any ideas why the POST works well with IE 4.0
and an ISP and does not work with AOL...?


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

Date: 20 Jan 1998 01:37:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Local ISP POST is good, AOL POST returns error
Message-Id: <6a0v4o$js7$1@comdyn.comdyn.com.au>

[Followup-To set]

In article <19980119235500.SAA15448@ladder01.news.aol.com>,
	drsfasaype@aol.com (DRSFASAYPE) writes:
> I'm using a CGI script to POST form data to a web site and return data via
> e-mail. E-mail works for local ISP dial up and AOL. POST routine works for ISP
> but returns message: Cannot retrieve http://www.dwbp-onlinPOST at AOL. Our web
> site address is http://www.dwbp-online.com. Our ISP is stuck on this problem
> and advised to call AOL... hmmm. Any ideas why the POST works well with IE 4.0
> and an ISP and does not work with AOL...?

Now... what does this have to do with perl? You talk about CGI,
E-mail, some POST routine, whatever that is (HTTP POST?), AOL and your
ISP. Nowhere in there do I even see perl mentioned. Even if the CGI
script you mention is written in perl, the problem obviously, as you
seem to realise yourself, has nothing to do with perl.

Frankly, I don't even have a clue what you're talking about.

Why don't you post this on a group that discusses one of the things
you are talking about, and try to be a bit clearer?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: Sat, 17 Jan 1998 22:09:51 +0200
From: Aleksi Asikainen <sanct@dlc.fi>
Subject: newbie question about ipc
Message-Id: <34C1100F.9FBC899F@dlc.fi>

Hello

I'm trying to do only a simple server and 2(-x) clients networking so
that depending on running parameters the one client can send to the
server or to the other client simple message, that appears to be "Hello
world" ;) 

In the documentation of perl there is a simple example, that sends from
the server to the client a message, but because I've not worked with any
languages on networking, I don't have a clue what to do. Another problem
is that I don't understand how to communicate with to clients via server
(i.e how to access "my"-code).

So I would be more than pleased, if someone just colud help, and tell me
where to find documentation/explanation/FAQ about this, or some source
code.

-aleksi asikainen


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

Date: 20 Jan 98 02:02:20 GMT
From: hbbio031@huey.csun.edu (ovanes manucharyan)
Subject: Obtaining Source Code
Message-Id: <34c405ac.0@130.166.1.64>

Hi,

Is there a way I could obtain the source code for the  UNIX "df" command,
I guess it would have to be one of the free implementations. And if I do,
would it be possible to run in on different platforms?

Is there a translation of that code into perl, or would it be possible for
me to re-write that in perl? Thanks in advance.

--
---------------------------------------------------------------------
   Ovanes Manucharyan  -  COMPUTER SCIENCE   - hbbio031@csun.edu
---------------------------------------------------------------------


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

Date: 20 Jan 1998 02:22:42 GMT
From: root@atrium.cardima.com (System Administrator)
Subject: Odd syntax problem
Message-Id: <6a11pi$2m7$1@usenet48.supernews.com>


OK, folks, here's a weirdness.  I'm trying to truncate a string
immediately before the last forward-slash in the string, if the string
contains an = character.  I've come up with about four different ways to
do it, but I've found a puzzling problem with one of them.


The following two code blocks should, theoretically, be syntactically
equivalent:

a)
	if (/=/)
        {
	    @buffer = split(/\//, $_);
	    $_ = join('/', splice(@buffer, -1, 1));
	}

b)

	$_ = join('/', splice(split(/\//, $_), -1, 1)) if (/=/);

However, in practice, (a) works, and (b) generates a syntax error right
before the split() call: 

$ perl -c tasks
syntax error in file tasks at line 120, next 2 tokens "(split"


Can anyone shed any light on this?


(Note:  I know this isn't the most efficient way of performing this
operation.  I'm just curious why it doesn't work as a single line.)



-- 
Phil V. Stracchino | Opinions expressed by me do not represent official
MIS Administrator  | positions or policies of Cardima Inc., and support
Cardima, Inc.      | by me of any organization, platform or position   
mis@cardima.com    | does not imply support thereof by Cardima Inc. 


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

Date: Mon, 19 Jan 1998 16:34:01 -0600
From: Dzuy Nguyen <dzuy@dazel.com>
Subject: package declaration
Message-Id: <34C3D4D9.41C67EA6@dazel.com>

Hi,

How can you declare a package name which is a variable? i.e.

$temp = foo;

package $temp; 	# doesn't work
package \$temp;  # No good
package ${ $temp } # doesn't like reference either


Also, I can declare a variable in a package without declaring the
package:

$foo::bar = blah;	# works OK

However,
$temp = foo;

${ $temp }::bar = blah;	# doesn't work

I also tried eval without success.  Any clue would be much appreciated.

Dzuy


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

Date: Mon, 19 Jan 1998 19:30:21 -0800
From: nisy <ni@aoe.vt.edu>
Subject: Perl + C in NT
Message-Id: <34C41A4D.BCC899D2@aoe.vt.edu>

I can call Perl routines from C in UNIX after I read the manpages of
Perlembed, Perlcall.... But I need to call Perl routines from C in NT,
furthermore call C routines from Perl in NT, urgently. Please give me
helps to tell me how to do it or show me where I can learn it !!!
Thanks and thanks,
Paul Ni
ni@aoe.vt.edu



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

Date: Mon, 19 Jan 1998 23:23:18 GMT
From: "ARCO Chemical Company" <cbpkxh@arcochem.com>
Subject: Re: PERL forking
Message-Id: <01bd2528$d601be80$bc40f9a5@dyyfc1.aca.arcochem.com>

I don't know if this will help, but here goes.  I wrote a Perl server that
accepts
a barcode (via a socket), and then calls a local Pro-C program on my UNIX
box.
Every time I made a call to the server from any client I would get another
Zombie on my UNIX box. The solution for me was to include this line:

$SIG{'CLD'} = 'IGNORE';   #--------> Prevent Zombies !!

Here is a part of the signal (5) man page

     SIGCLD         Setting the action for SIGCLD to SIG_IGN in a
                          parent process prevents exiting children of the
                          calling process from creating a zombie process.

Hope this helps
   Kevin Hawley
   P.S. The Perl FAQ is TOO big!!


Anders Nilsson <an@oso.chalmers.se> wrote in article
<34C382E9.6CBA41C2@oso.chalmers.se>...
> Hello!
> 
> I am working with a perl program to administrate a large number of
> calculations. When a subprocess terminates from a fork it becomes a
> zombie. I haven't checked everything all through but judging from
> the simple csh program I wrote, the problem seems to be that perl
> refuses to release the control until the mother process dies. It is
> a real problem since the the actual loop will not be formed as below
> in the future. It will probably include a couple of thousand runnings
> and I don't think that a thousand zombies is particularly healthy for
> a linux machine. It's not a linux problem since it works the same on
> a HP-UX machine.
> 
> The active part of my test program is included below. Let me also tell
> that I have tried with: system("cmd"); and: `cmd`; for the row exec cmd;
> with the same result. The command cmd is a simple csh program for
> testing
> purposes including a find and an echo terminated by exit(0).
> The subroutine get_load extracts the load using csh uptime.
> 
> My question is: is this a bug in perl or is there another way to do it?
> I would prefer not to kill the main program and restart it.
> 
> for ( $z=0; $z< 100 ; $z++ ) {
>     print "Lap $z\n";
>     ( $load_01_min, $load_05_min, $load_15_min) = get_load();
>     if ( $load_01_min < 0.6 ) {
>         if ( $pid = fork ) {
>             print "Main Process\n";
>         } else {
>             print "Starting child process $pid\n";
>             exec cmd;
>             exit 0;
>         }
>     } else {
>         print "Not starting any process\n";
>     }
>     sleep 5;
> }
> 
> Thankful for help,
> 
> Anders Nilsson,   an@oso.chalmers.se
> 


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

Date: 17 Jan 1998 01:05:16 GMT
From: paten@t-online.de (Roland Sellger)
Subject: Re: Perl on NT server 4.0
Message-Id: <69p04c$apj$1@news02.btx.dtag.de>


tom_endyke@hmco.com schrieb in Nachricht
<884980156.821624842@dejanews.com>...
>Well, I have Perl5 up and running on my NT Server 4.0 w/service pack3.  My
>problem is that although the following simple script (hello.pl)works fine:
>
>print "hello, World!\n";
>
>the next simple script (prog1_1.pl) does not:
>
>$inputline = <STDN>;
>print ( $inputline );
>
>I've played around with this quite a bit and still can't get it to go.
>Do I need a specific header line for NT server?  I've associated the *.pl
>files with Perl and type them directly into the command prompt.
>
>Any feedback would be helpful.
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet

Try it with $inputline=<STDIN> instead of using <STDN> from the DOS-Box.
Roland Sellger http://www.moses-online.org




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

Date: Mon, 19 Jan 1998 20:09:59 +0000
From: smcdani@clemson.edu
To: Roland Sellger <paten@t-online.de>
Subject: Re: Perl on NT server 4.0
Message-Id: <34C3B315.3F37AC3B@clemson.edu>

>print "hello, World!\n";
>
>the next simple script (prog1_1.pl) does not:
>
>$inputline = <STDN>;
>print ( $inputline );
>

all i can see is that it should be <STDIN> not <STDN>



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

Date: Mon, 19 Jan 1998 14:45:24 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
To: wtang@cs.ualberta.ca
Subject: Re: PL/SQL in Oraperl
Message-Id: <34C3D784.E4E11D5D@us.oracle.com>

Wei Tang wrote:

> I am using Oraperl for Perl4 :-<, 'cause I am not 'root'.

Complain. Using perl4 in this day and age in inexcusable.

> Could somebody tell me how to pass a PL/SQL block to Oracle in
> Oraperl?

I will assume that you can connect to the DB and do simple SELECTs.

Use &ora_do($lda,$stmt), ie:
$stmt = q{
BEGIN
   SchemaName.StoredProcedure();
   INSERT INTO foo VALUES ( 'bar', 'glarch');
EXCEPTION
   WHEN OTHERS THEN NULL;  /* ha ha */
END;
};
&ora_do($lda,$stmt);

RTFM. Specifically, 'perldoc Oraperl'



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

Date: 19 Jan 1998 22:59:33 GMT
From: gbacon@adtran.com (Greg Bacon)
To: seong@cse.bridgeport.edu
Subject: Re: please, help me, help me, help me.....
Message-Id: <6a0lsl$20k$8@info.uah.edu>

[Posted and mailed]

In article <34C2EC3A.5011@cse.bridgeport.edu>,
	"Seong Y. Kim" <seong@cse.bridgeport.edu> writes:
: I am trying to write a program that searchs all the files and dirs in
: specific directory.  

[ snip code using glob ]

: This is part of my humble source code.
: Problem is that whenever i run this code, it gave me message 'arguments
: too long'.  
: This directory has more than 1500 dirs in one dir. 

This is a FAQ.  Find the answer to your supplication at

    http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.html

Followups set, hike!
Greg
-- 
open G,"|gzip -dc";$_=<<EOF;s/([0-9a-f]+)/print G pack"h*",$1/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 17 Jan 1998 01:30:37 GMT
From: paten@t-online.de (Roland Sellger)
Subject: Re: problem with POST method for NT
Message-Id: <69p1jt$auv$1@news02.btx.dtag.de>


Jerry Chen schrieb in Nachricht <34BFC826.238BACE9@mitel.com>...
>Hello
>
>I am trying to use Perl for Win32 with PWS
>(scaled down version of MS-IIS) for NT Workstation.
>I am able to get the test CGI working;
>however, I can't get the POST method working on the system.
>The submitted values $in{'rating'}, and $in{'hiddenfield'}
>can not be printed.
>
>Please inform me if you know how to solve it or work around.
>(or I did something wrong?)
>Thanks.
>
>....
>Perl CGI codes:
>
># --- Perl code begin --- #
># cgitest.pl
>#
># Test perl for win32
>
>use CGI qw(:cgi-lib);
>
># === main === #
>MAIN:
>{
>    &ReadParse;
>
>    print "HTTP/1.1 200 OK";
>    print "Content-Type: text/html\n\n";
>    print <<END;
><html>
>   <head><title>Results are </title></head>
>   <body>
>   <h2>Results are</h2>
>END
>
>    print "Rating : $in{'rating'}<br>";
>    print "Hidden Field: $in{'hiddenfield'}<br>";
>    print "Query String: $ENV{'QUERY_STRING'}<br>";
>
>    print "\n</body>\n</html>";
>}
># --- Perl code end --- #
You should change  the header line
print "HTTP/1.1 200 OK";
to print "HTTP/1.1 200 OK\n";
in order to get a correct header or even delete this line and than it will
work.
Roland Sellger http://www.moses-online.org






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

Date: Tue, 20 Jan 1998 00:25:55 +0000 (GMT)
From: Rhodri James <rhodri@wildebst.demon.co.uk>
Subject: Re: returning values out of a recursed sub
Message-Id: <480b22cda8rhodri@wildebst.demon.co.uk>

In article <34C33023.A8F364C@5sigma.com>,
 Joseph N. Hall <joseph@5sigma.com> wrote:
> Let's keep it simple.

>   $line =~ tr/\t / /s;

True.  I never get "tr" quite right the first time.  Sigh.

-- 
Rhodri James  *-*  Wildebeeste herder to the masses
If you don't know who I work for, you can't misattribute my words to them

 ... Why do you keep saying "Oops," Barbarian?


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

Date: 19 Jan 1998 23:07:54 +0000
From: Richard Caley <rjc@liddell.cstr.ed.ac.uk>
Subject: Re: source into binary code
Message-Id: <eyhd8hodpv9.fsf@liddell.cstr.ed.ac.uk>

In article <6a0il5$abi$1@news.orst.edu>, John Stanley (js) writes:

js> And what if all it took to make an amplifier was to show the
js> schematic to a computer -- with no costs for parts or labor, who
js> would be buying the amplifier from the manufacturer anymore when
js> they can get it for free? 

Keeping the source secret certainly doesn't prevent piracy. If it did
Microcruft would be immune from piracy rather than being the major
victim.

I place software on a spectrum:

	I don't mind not having the source to Duke Nukem. 

	..

	I'm not touching anything security related where I don't have
		the source.

Basicly things where I don't have the source get put towards the `toy'
end of the scale. I may use them for work, but before I do I make sure
I can do without them at short notice when they blow up. Anything I
rely on needs to be maintainable, and not just by the manufacturer (who
will tell me to go take a runnoing jump if I come to them in two
years).

Things I do commercially get supplied with full source because two
years from now I might have gone to live up the Orinoco, and the
people who payed me for a product shouldn't be left up shit creek.

-- 
rjc@cstr.ed.ac.uk			_O_
					 |<



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

Date: 20 Jan 1998 02:48:27 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <6a139r$63c$1@news.orst.edu>

In article <eyhd8hodpv9.fsf@liddell.cstr.ed.ac.uk>,
Richard Caley  <rjc@liddell.cstr.ed.ac.uk> wrote:
>Keeping the source secret certainly doesn't prevent piracy. If it did
>Microcruft would be immune from piracy rather than being the major
>victim.

Please consider the group that you are reading this in when you make
such statements. Yes, keeping the source secret when the source is perl
really does help prevent piracy. It can't prevent it if one of your
contractually obligated to secrecy purchasers decides to violate that
obligation, but it will stop people from copying and running your code
because they can't just ftp it from everywhere.

>Basicly things where I don't have the source get put towards the `toy'
>end of the scale. I may use them for work, but before I do I make sure
>I can do without them at short notice when they blow up. 

Tell that to corporate IS managers who base their IS services on MS
products. 

>Things I do commercially get supplied with full source because two
>years from now I might have gone to live up the Orinoco, and the
>people who payed me for a product shouldn't be left up shit creek.

That is your choice. Who has said that you can't make such a choice?



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

Date: Mon, 19 Jan 1998 19:44:38 -0500
From: "David Mohorn" <david.mohorn@sourcebbs.com>
Subject: Re: Switch statement in Perl-5???
Message-Id: <01bd253d$2b789f00$315c5499@user.ncr.com>

What is perlsyn?  I am using Perl for Win32.  I don't have Perl for UNIX
installed anyplace.

Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> wrote in article
<34C3A05B.24BFC368@gpu.srv.ualberta.ca>...
> David Mohorn wrote:
> > 
> > What?  Perl-5 doesn't have a switch statement like C?  How can I do a
menu?
> 
> search for 'switch' in the perlsyn manpage...there are many
> examples of perlish equivelants to switch type contructs.
> 
> regards
> andrew
> 


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

Date: 20 Jan 1998 01:40:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Switch statement in Perl-5???
Message-Id: <6a0vak$js7$2@comdyn.comdyn.com.au>

In article <01bd253d$2b789f00$315c5499@user.ncr.com>,
	"David Mohorn" <david.mohorn@sourcebbs.com> writes:
> What is perlsyn?  I am using Perl for Win32.  I don't have Perl for UNIX
> installed anyplace.

perl syntax documentation. It should be avalable to you too. 

perldoc perlsyn

perldoc is a utility to access the documentation pages that come with perl.
Try 

perldoc perldoc

first.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 


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

Date: Mon, 19 Jan 1998 19:24:25 -0500
From: Dean Hoover <dhoover@textwise.com>
Subject: Re: Use of uninitialized value at fastbib.pl line 103.
Message-Id: <34C3EEB9.44A@textwise.com>

Tad McClellan wrote:
> 
> Dean Hoover (dhoover@textwise.com) wrote:
> : Why is this message emitted? The statement that it is warning on
> : looks like this:
> 
> :       if (defined $oldhandler)
> 
> : Obviously, I am attempting to do the right thing... So why
> : is it warning me?
> 
>    perl -e 'if (defined $oldhandler) {print "yep\n"}'
> 
> remains silent for me...
> 
> Can't duplicate the problem. Can't fix the problem. Sorry.
> 
> (maybe you need to give more of the surrounding code? Maybe you have
>  an 'off by one' (or more) error on the line number?
> )

Here's the entire .pl file:

no strict 'subs';
use Socket;
use Sys::Hostname;
use FileHandle;

sub FastbibCommand
{
	my ($serverHost, $port, $command) = @_;
	my $oldhandler = $SIG{INT};
	$SIG{INT} = \&FastbibCommand::Quit;


#-------------------------------------------------------------------------
	# Determine 'protocol'.

	my $protocol = (getprotobyname('tcp'))[2];


#-------------------------------------------------------------------------
	# Set the format for packing/unpacking.

	my $socketAddressFormat = 'S n a4 x8';


#-------------------------------------------------------------------------
	# Determine 'clientName'.

	my $rawClientAddress = (gethostbyname(hostname))[4];
	my $clientName = pack($socketAddressFormat, AF_INET, 0,
$rawClientAddress);


#-------------------------------------------------------------------------
	# Determine 'serverName'.

	my $rawServerAddress = (gethostbyname($serverHost))[4];
	my $serverName =
	  pack($socketAddressFormat, AF_INET, $port, $rawServerAddress);


#-------------------------------------------------------------------------
	# Make the socket filehandle.

	$FastbibCommand::socket = new FileHandle;

	if (not socket($FastbibCommand::socket, AF_INET, SOCK_STREAM,
$protocol))
	{
		if (defined $oldhandler)
		{
			$SIG{INT} = $oldhandler;
		}
		else
		{
			$SIG{INT} = undef;
		}

		return undef;
	}


#-------------------------------------------------------------------------
	# Give the socket an address.

	if (not bind($FastbibCommand::socket, $clientName))
	{
		if (defined $oldhandler)
		{
			$SIG{INT} = $oldhandler;
		}
		else
		{
			$SIG{INT} = undef;
		}

		undef $socket;
		return undef;
	}


#-------------------------------------------------------------------------
	# Call up the server.

	if (not connect($FastbibCommand::socket, $serverName))
	{
		if (defined $oldhandler)
		{
			$SIG{INT} = $oldhandler;
		}
		else
		{
			$SIG{INT} = undef;
		}

		undef $socket;
		return undef;
	}

	$FastbibCommand::socket->autoflush(1);
	print $FastbibCommand::socket "$command\nbye\n";	# send command to
server
	my $reply;
	my $results;

	while (defined $FastbibCommand::socket and
	  ($reply = <$FastbibCommand::socket>))
	{
		$results .= $reply;
	}

	close($FastbibCommand::socket);

	if (defined $oldhandler)
	{
		$SIG{INT} = $oldhandler;
	}
	else
	{
		$SIG{INT} = undef;
	}

	return $results;
}

package FastbibCommand;

my $socket;

sub Quit
{
	if (defined $socket)
	{
		close($socket);
		undef $socket;
	}

	exit 1;
}

1;


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1677
**************************************

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