[8031] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1656 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 16 16:17:40 1998

Date: Fri, 16 Jan 98 13:00:24 -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           Fri, 16 Jan 1998     Volume: 8 Number: 1656

Today's topics:
     Re: CC from a perl (mail script) <*@qz.to>
     Re: CGI.pm (brian d foy)
     Re: first perl script <*@qz.to>
     Re: Give me reasons to use Perl for CGI <racronkite@hrl.com>
     Re: Give me reasons to use Perl for CGI <johnrs@dc.net>
     Re: globs passed from command line tobez@plab.ku.dk
     Help tokenizing strings w/ embedded quoted strings (Sheldon E. Smith)
     Re: Help tokenizing strings w/ embedded quoted strings tobez@plab.ku.dk
     Re: How to find timezone? <*@qz.to>
     Re: HTTP post (Nathan V. Patwardhan)
     Re: HTTP post (brian d foy)
     Re: inverse cosine? (Mike Stok)
     Re: inverse cosine? (Mark G. Scheuern)
     Re: once again print SOCK "Whatever"; <johnrs@dc.net>
     Re: perl -- a language for LEARNING programming? (Chris Benson)
     Re: perl build error on Solaris w/ gcc (Nathan V. Patwardhan)
     Perl on NT server 4.0 tom_endyke@hmco.com
     Perl5 and Oraperl on AIX <thriveni@prodigy.net>
     Re: Problem running HTML Processor script <*@qz.to>
     problem with POST method for NT <jerry_chen@mitel.com>
     select() on a file? <ed@texas.net>
     Sockets and Perl and Deadlock <johnrs@dc.net>
     Re: source into binary code <tchrist@mox.perl.com>
     Re: system call from within a cgi script (brian d foy)
     Re: system call from within a cgi script <johnrs@dc.net>
     Re: Using SetUID (brian d foy)
     Re: Wanted: generic macro/include pre-processor (Mike Stok)
     Re: Why does Perl5.0004 use a "Configure" script <merlyn@stonehenge.com>
     Re: WWWBoard Help (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 16 Jan 1998 18:58:45 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: CC from a perl (mail script)
Message-Id: <qz$9801161349@qz.little-neck.ny.us>

Werner  <w.vaarwerk@dp.dpfinance.nl> wrote:
> I'm trying to send a carbon copy from my mailscript. Underneeth I'll
> show you my working code now:
> 
> print MAIL "Subject: $mailsub\n";
> print MAIL "From: $mailsender\n";
> ?????print MAIL "CC: me@myaddress.com\r\n";????????

As others have pointed out, you need to backwhack the @. (Didn't -w 
warn you about that?)

> print MAIL "To: $c{mailto}\n";

How did you open MAIL? If you are using sendmail, unless you specified
the "-t" option, the headers will not be parsed looking for addresses.

Elijah
------
and hopefully you remembered to use "-oi" if using sendmail


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

Date: Fri, 16 Jan 1998 15:07:46 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI.pm
Message-Id: <comdog-1601981507460001@news.panix.com>
Keywords: just another new york perl hacker

In article <69npf4$okn@panix.com>, clay@panix.com (Clay Irving) posted:

> In <34BF4C05.1AF7@interworldnet.net> Builders Connection <jim39@interworldnet.net> writes:
> 
> >Where can you get CGI.pm 

> >and can it be used to run a script thru without put it on your server?
> 
> Sure.

really?  outside of NFS mounted filesystems and so on, how would
one use a remote copy of CGI.pm?  maybe i've misunderstood the
question...

-- 
brian d foy                                 <http://computerdog.com>
hmmmm... a centralized server of Perl modules


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

Date: 16 Jan 1998 19:23:14 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: first perl script
Message-Id: <qz$9801161405@qz.little-neck.ny.us>

<bfisk@pacbell.net> wrote:
> Below is my first attempt at writing any kind of perl script, just looking
> for some honest critics about making this a little better.

Welcome to the sharkpool^Wclub!

You should have a line turning on warnings. Even if you don't have a 
"#!" line. You can use "$^W = 1;" (either a <ctrl-w> or a <^><W> will
work).

> open(PATFILE, "operator.dt");

You are not checking the return value of the open:

open(PATFILE, "operator.dt") or die "Bloody 'ell: $!";

> $i = 0;
> $c = 0;
> while ($line = <PATFILE>) {

That will do ugly things if you have a line that is just "0", use:

while (defined($line = <PATFILE>)) {

>         if ($line =~ "host") {

That won't work. Maybe you meant:

        if ($line =~ /host/) {

>                 $HOST[$i] = [ split ' ', $line];
>                 $HostList[$i] =  $HOST[$i][1];
>         $i++;
>         }
>         if ($line =~ "container") {

And again here:

        if ($line =~ /container/) {

>                 $ContList[$c] = $line;
>         $c++;
>         }
> }

Otherwise, didn't seem too bad. But someone else will have other nitpicks
(like a failure to "use strict").

Elijah
------
not strict about use strict


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

Date: Fri, 16 Jan 1998 11:39:41 +0000
From: Robert Cronkite <racronkite@hrl.com>
Subject: Re: Give me reasons to use Perl for CGI
Message-Id: <34BF46F6.198BA5EF@hrl.com>

Perl is portable, it runs under Unix and NT.
Perl is interpreted, webmasters can check a Perl script to make sure
that the script won't damage their server.
You don't need to buy a compiler, the Perl package is free.
There is a tremendous amount of code already written in Perl with which
a person can draw upon.

Robert Cronkite



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

Date: Fri, 16 Jan 1998 15:24:59 -0500
From: john -r s <johnrs@dc.net>
To: Hann SO <hso@voyager.atc.fhda.edu>
Subject: Re: Give me reasons to use Perl for CGI
Message-Id: <34BFC21A.631A3496@dc.net>


Reason 1. Hann CGI (scripting?) use the king of all scripting languages.

Reason 2. Its easy. (Easy = Productive)
Reason 3. Are you teaching CGI techniques or C/C++ techniques? Perl will
let you concentrate on CGI and not the intricacies of C programming.
Reason 4. Perl combines the features of C and many scripting languages.
Reason 5. There is so much literature on CGI and Perl, Can everyone be
wrong?
Reason 6. very portable.
etc.
etc.
>Hann SO wrote:

>I'm teaching CGI at a community College. Would you please give me
reasons why I >should use Perl and not C, C++ or TCL?


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




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

Date: Fri, 16 Jan 1998 19:39:23 +0100
From: tobez@plab.ku.dk
Subject: Re: globs passed from command line
Message-Id: <34BFA95B.ADD@plab.ku.dk>

Peter J. Acklam wrote:

> > Ben, instead of doing glob in your case,
> > go through your @ARGV, it already has *.txt expanded.
> 
> That depends on the port. Both the Web2c port for Win32 and
> G. Sarathys port for Win32 would have *.txt in $ARGV[0] when
> given something like

> PS. ActiveState's port for Win32 is the only one I know
> where the glob is expanded.

Well, from the original post it is clear that the expansion
was taking place.  Don't know whether it was on Unix machine
where the expansion was done by a shell, or under OS/2 where
it is done by calling EMX-specific _wildcard(argc,argv), or
with Win32 port you've mentioned.

Anton.


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

Date: Fri, 16 Jan 1998 18:52:29 GMT
From: ssmith@galina.enet.dec.com (Sheldon E. Smith)
Subject: Help tokenizing strings w/ embedded quoted strings
Message-Id: <69oa9e$60c$1@mrnews.mro.dec.com>

(I'm running Perl 5.4-2 in DOS (Windows 95).)

I have several paragraphs that I want to break into words. Splitting on 
white-space seems the obvious choice. The problem is the paragraphs have 
embedded quoted strings, and I'd like the entire quoted string as a single 
element. If the white space in the quoted string needs to be converted to 
some unused character, such as tilde, that's OK too. I can convert it back 
to a blank later. (The unused character doesn't have to be a tilde.)

I've tried experimenting with   s/"[^"~]+"/  , but I can't find the right 
combination of backslashes or whatever.
I figure if I can get it to work once, I can put the whole thing into a 
loop. On the other hand, is there some much more elegant method if doing 
this in Perl?

What I start with:
The quick, brown fox. "A quoted string" Two, four, six, eight

What I need:
The
quick,
brown
fox.
"A~quoted~string"
Two,
four,
six,
eight

Thanks in advance....

------------------------------------------------------------------------------
	Sheldon E. Smith
	Enterprise Management Services
	OpenVMS & Digital Unix Management & Performance

Digital Equipment Corporation		(612) 837-4826 Telephonw
7831 Glenroy Rd, # 250			(612) 837-4801 Fax
Bloomington, MN 55439-3132		Sheldon.Smith@Digital.com
------ PGP keyid 1024/48710315 1996/05/07 <ssmith@galina.enet.dec.com> -------
   PGP Key fingerprint =  B9 A6 6F 00 24 C0 5E B8  DB 8A 9A DE D3 DA 2B B4


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

Date: Fri, 16 Jan 1998 20:39:50 +0100
From: tobez@plab.ku.dk
Subject: Re: Help tokenizing strings w/ embedded quoted strings
Message-Id: <34BFB786.228B@plab.ku.dk>

Sheldon E. Smith wrote:

> I have several paragraphs that I want to break into words. Splitting on
> white-space seems the obvious choice. The problem is the paragraphs have
> embedded quoted strings, and I'd like the entire quoted string as a single
> element.

Assuming that the whole paragraph is in $_ and that things like
"A \"quoted\" string" are not allowed,

   @words = m{[^\s\"]+|\"[^\"]*\"}g;

Hope this helps,

Anton.


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

Date: 16 Jan 1998 19:54:32 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: How to find timezone?
Message-Id: <qz$9801161418@qz.little-neck.ny.us>

Steven Smith  <steves@wco.com> wrote:
> How do you determine what timezone you're in.

The name or just the offset? The name is probably locale dependent, the
offset is not too hard to find.

> The closest I've found is
> use POSIX tzname;
> @tz = POSIX::tzname();
> 
> but this returns GMT, which implies that the timezone isn't
> getting set on my host.  The only other option I see is to

I dunno. What do the docs for that say it should do?

Offhand, I'd probably get an offset with something like:

#!/usr/bin/perl -w

$time = time;

# ($sec,$min, $hour, $mday,$mon, $year,$wday,$yday, $isdst) =
(undef, $lmin,$lhour,undef,undef,undef,undef,$lyday,$lisdst) =
						localtime($time);

(undef, $gmin,$ghour,undef,undef,undef,undef,$gyday,$gisdst) =
						gmtime($time);

 $min = $lmin-$gmin; # handle non-standard offsets
$hour = $lhour-$ghour; 

$offset = (100 * $hour) + $min; # yes, really use 100

if ($lyday != $gyday) { # we are a day off
 ....
}
if ($lisdst != $gisdst) { # different opinions on daylight savings
 ....
}
__END__

Elijah
------
or look into the time modules


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

Date: 16 Jan 1998 18:55:45 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: HTTP post
Message-Id: <69oafh$fmn@fridge.shore.net>

Smith and O'Halloran (inwap@best.com) wrote:

: That should be
: 	print S "POST /cgi-bin/test.cgi HTTP/1.0\n";
: 	print S "Content-Length: 18\n\n";
: 	print S "string=teststring\n";
: The blank line comes AFTER Content-Length, not before.

What's wrong with using LWP?  Or if you're going to do it this way, a
here doc?

print SOCK <<THIS;
POST http://myhost.domain.com/cgi-bin/do_post HTTP/1.0
User-Agent: We-hate-Windows-NT
Content-Length: 12
Content-Type: application/x-www-form-urlencoded

twelve=chars

THIS

--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov


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

Date: Fri, 16 Jan 1998 14:52:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HTTP post
Message-Id: <comdog-1601981452080001@news.panix.com>
Keywords: just another new york perl hacker

In article <69oafh$fmn@fridge.shore.net>, nvp@shore.net (Nathan V. Patwardhan) posted:


 
> print SOCK <<THIS;
> POST http://myhost.domain.com/cgi-bin/do_post HTTP/1.0
> User-Agent: We-hate-Windows-NT
> Content-Length: 12
> Content-Type: application/x-www-form-urlencoded
> 
> twelve=chars
> 
> THIS

i think you meant

 print SOCK <<THIS;
POST /cgi-bin/do_post HTTP/1.0
Host: myhost.domain.com
User-Agent: We-hate-Windows-NT
Content-Length: 12
Content-Type: application/x-www-form-urlencoded
 
twelve=chars
THIS

-- 
brian d foy                                 <http://computerdog.com>


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

Date: 16 Jan 1998 14:03:24 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: inverse cosine?
Message-Id: <69oats$1k1$1@stok.co.uk>

In article <0ojsG0200YUd02MOM0@andrew.cmu.edu>,
Michael D Sohn  <msda+@andrew.cmu.edu> wrote:

>Is there a command or an easy way of getting the inverse cosine?

You can, if you're using a recent perl, use the acos routine from the
POSIX module e.g.

  use POSIX qw/acos/;

  $rads = acos $n;

Otherwise it's back to basics which I have forgotten :-(

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: 16 Jan 98 19:28:37 GMT
From: mgscheue@bermuda.io.com (Mark G. Scheuern)
Subject: Re: inverse cosine?
Message-Id: <mgscheue.884978917@bermuda.io.com>

Michael D Sohn <msda+@andrew.cmu.edu> writes:


>Is there a command or an easy way of getting the inverse cosine?

POSIX::acos()

Mark



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

Date: Fri, 16 Jan 1998 15:10:57 -0500
From: john -r s <johnrs@dc.net>
Subject: Re: once again print SOCK "Whatever";
Message-Id: <34BFBED1.F8B3DD14@dc.net>

Toby You are suffering from deadlock? You should follow my posting and
see if anyone can help both of us!

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




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

Date: 16 Jan 1998 19:34:29 -0000
From: chrisb@jesmond.demon.co.uk (Chris Benson)
Subject: Re: perl -- a language for LEARNING programming?
Message-Id: <69oco5$a34@jesmond.demon.co.uk>

In article <see-1601981206440001@pri03-031.oldcity.dca.net>,
Steve Linberg <see@my-sig.com> wrote:
>
>$strVeryLong = "This is a VERY long string. " x 100000000000000000;
>
>No error code is returned.  Does it crash the machine?  Does it use up
>every available byte of memory and then fail quietly?  Does it preserve a
>certain amount of free space and then fail?  It makes me nervous.  There
>are many examples like this that I could think of where Perl's behavior is
>undefined in extreme circumstances.

$ perl -e '$strVeryLong = "This is a VERY long string. " x 100000000;<STDIN>;'
panic: realloc at -e line 1.
$ perl -e '$strVeryLong = "This is a VERY long string. " x 1000000;<STDIN>;'

$

(but it took most of my swap :-)
$ free
             total       used       free     shared    buffers     cached
Mem:         47048      46332        716       6648        380       5052
-/+ buffers:            40900       6148
Swap:        67556      52692      14864
-- 
Chris Benson


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

Date: 16 Jan 1998 18:45:05 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl build error on Solaris w/ gcc
Message-Id: <69o9rh$fmn@fridge.shore.net>

Deepak Khosla (dkhosla@compaq.com) wrote:

: I looked thru' the README and it mentioned about fixinc being the problem.
: I could not run fixinc - it appeared it was more for
'cross-compiling' or

If I'm correct, fixincludes should have been automatically run when
you were building gcc.  Did you build gcc with cc or did you compile
gcc against a pre-compiled binary?  Or, did you just install a
pre-compiled binary?  If not, grab a pre-compiled gcc and build the
same version with the p/c version.

: getting binaries and installing them. I am at a loss - is there a Solaris
: specific FAQ or has someone experienced the same? If not, any place I can
: get binaries?

There is a Solaris FAQ.  I believe that you can find it at
rtfm.mit.edu.

--
Nathan V. Patwardhan



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

Date: Fri, 16 Jan 1998 14:02:02 -0600
From: tom_endyke@hmco.com
Subject: Perl on NT server 4.0
Message-Id: <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


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

Date: Fri, 16 Jan 1998 15:19:33 -0500
From: "Thriveni Bhakta" <thriveni@prodigy.net>
Subject: Perl5 and Oraperl on AIX
Message-Id: <69ofn4$ivq$1@newssvr08-int.news.prodigy.com>

    To be able to use Oraperl with Perl5, it was given in Oraperl.pm that
the following invocation needs to be added to the perl script.

    eval 'use Oraperl; 1' || die $@ if $] >= 5;

    But, on running the script, I got the error message :
----
Can't find loadable object for module DBI in @INC (/usr/local/llib/perl5 )
BEGIN failed--compilation aborted at /usr/local/lib/perl5/Oraperl.pm line
25.
BEGIN failed--compilation aborted at (eval1) line1.
-----

    Line 25 in /usr/local/lib/perl5/Oraperl.pm is
    use DBI 0.84;

    There is a DBI.pm module existing in the directory where Oraperl.pm
exists.   I dont know what the 0.84 stands for.

     If anybody has any suggestions, please reply.

Thanx,
Thriveni





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

Date: 16 Jan 1998 19:06:23 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Problem running HTML Processor script
Message-Id: <qz$9801161355@qz.little-neck.ny.us>

Terry Lecander <terry@rednickel.com> wrote:
> I am fairly new a implementing Perl scripts and am no programmer. I am
> trying to make use of a script that is ment to insert HTML fragments
 ...
> perl ../cgi_bin/htmlproc.pl test.base
> /^\b*(\w*)=(.*)/: regexp *+ operand could be empty at
> ./cgi_bin/htmlproc.pl line 192.
 ...
> 192                   if (/^\b*(\w*)=(.*)/)
                             ^^^^

That would seem to be your error:

:r! perl -wce '$_="foo"; /^\b*(\w*)=(.*)/ '
/^\b*(\w*)=(.*)/: regexp *+ operand could be empty at -e line 1.

:r! perl -wce '$_="foo"; /^\b(\w*)=(.*)/ '
-e syntax OK

Since \b is a zero width assertion, putting a "*" after it is a bad thing.
Earlier versions of perl probably didn't complain about this and that's
how it snuck through.

Elijah
------
would have used /^(\w+)=(.*)/ himself


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

Date: Fri, 16 Jan 1998 15:50:46 -0500
From: Jerry Chen <jerry_chen@mitel.com>
Subject: problem with POST method for NT
Message-Id: <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.

Here is the HTML page:

<!-- --- html begin --- -->
<html>
   <head>
      <title>Test Perl CGI</title>
   </head>
   <body>
   <h2>Test Perl CGI</h2>

   <form method=POST action="/cgi-bin/cgitest.pl?hello">
      Radio Buttons<br>
      <input type="radio" name="rating" value="1" checked> 1<br>
      <input type="radio" name="rating" value="2"> 2<br>
      <input type="radio" name="rating" value="3"> 3<br>
      <input type="radio" name="rating" value="4"> 4<br>
      <input type="radio" name="rating" value="5"> 5<br><br>

      <input type="hidden" name="hiddenfield" value="hidden value">
      <input type="SUBMIT" value=" Submit "> 
   </form>
   
</html>
<!--  --- html end --- -->

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 --- #


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

Date: 16 Jan 1998 19:04:20 GMT
From: Edward Henigin <ed@texas.net>
Subject: select() on a file?
Message-Id: <69oavk$d3u$1@news3.texas.net>

	I'm working on a program which is going to have multiple
UNIX domain sockets open, along with a plain file.  I'd like to 
select() on all of them at once.

	The problem I'm encountering is that the plain file is
*always* being flagged as having data ready to be read from it.
Right now, as I'm working on it, it's a zero-byte file.  When
I go to sysread() from it, it always returns 0 bytes read.
This makes the program chew cpu, because I'm depending on the
timeout on select() to pause the program for me, and since
the plain file always thinks there's something to be read...
well you know, my select loop is always running, never waiting.

	Anyone done anything like this before?

	Thanks..

	Ed


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

Date: Fri, 16 Jan 1998 15:09:28 -0500
From: john -r s <johnrs@dc.net>
Subject: Sockets and Perl and Deadlock
Message-Id: <34BFBE78.51755008@dc.net>

Can anyone help me understand how to prevent deadlock in a simple
client-server app using perl? I have used examples from the FAQ's and
from all over the  WEB but I have yet to find a single example that will

allow a one time 2 way conversation between the client and server. They
all talk about it and how to prevent deadlock but I have not found a
single example.  My problem is this:
I need to send the name of a directory to the server. The server must do

an ls and return a list of the files it finds to the client. The
application will save me from having to wais index files that are
associated with documets on my server that live on different server.

Any help is appreciated.



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




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

Date: 16 Jan 1998 20:47:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: source into binary code
Message-Id: <69oh1s$jvf$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
:If writing perl code were the way I wanted to make a living, I guess I
:couldn't do very well at it by giving it away, now could I? 

That's entirely wrong.  They are simpy hired to write something, under
condition that it be giveawayable, or reusable by the writer.  You get
paid for a service: writing the code.

Think of it as an freelance author publishing a story or article.
It's still his story -- they just have right of first publication.

I know both individuals and entire many(>50)-person companies who operate
this way.  It's perfectly viable.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "It is easier to port a shell than a shell script."
		--Larry Wall


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

Date: Fri, 16 Jan 1998 15:15:29 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: system call from within a cgi script
Message-Id: <comdog-1601981515290001@news.panix.com>
Keywords: just another new york perl hacker

In article <884963970.1086259211@dejanews.com>, sherman amsel <sherman@cdg.stsv.seagate.com> posted:

> i've got a question about making a system call from with a perl cgi
> script.  i'm gathering a bunch of fields of data via an html form, and
> sending it to a cgi script for parsing.  this part works just fine. 
> then, i'd like to make system calls to various utilities or other scripts
> using this data.  making the system call seems to cause "internal server
> errors", or else nothing at all happens.

remember that the script has an environment that may be different
than your login environment (i.e. different PATH and so on).  taking
care of these differences should clear up the problem.  one trick is
to massage your login environment to look like the server
environment then test the script from the command line.

you may also want to read the references in the CGI Meta FAQ [1]

good luck :)

[1] <URL:http://computerdog.com/CGI_MetaFAQ.html>

-- 
brian d foy                                 <http://computerdog.com>


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

Date: Fri, 16 Jan 1998 15:17:03 -0500
From: john -r s <johnrs@dc.net>
Subject: Re: system call from within a cgi script
Message-Id: <34BFC03F.B076C4FD@dc.net>

You can make system calls from cgi.  Try an experiment and do something
like:

$current_dir = `pwd`;
chop $current_dir;
print "current directory is $current_dir\n";

remember - experiment and give yourself diagnostic output. try placing
the code in different parts of your script and see what happens.

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




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

Date: Fri, 16 Jan 1998 15:03:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using SetUID
Message-Id: <comdog-1601981503110001@news.panix.com>
Keywords: just another new york perl hacker

In article <69ns1l$iku$1@morse.news.easynet.net>, matthew@ukonline.co.uk posted:


> I have spent the last few hours looking through the manual pages 
>for perl, and the reference book I have.  (Perl 5, How too..) and 
>can't seem to shed any light on this problem.

some things to read:

   the chmod man page
   the perlsec man page

   the WWW Security FAQ [1]

most things that you need to know are in there.  if you have 
questions on a particular issue that you read about, ask a more
specific question.

good luck. :)

[1] see the CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>

-- 
brian d foy                                 <http://computerdog.com>


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

Date: 16 Jan 1998 14:28:47 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Wanted: generic macro/include pre-processor
Message-Id: <69ocdf$1n6$1@stok.co.uk>

In article <slrn6bv312.fr5.pd@world.std.com>,
Peter Davis <pd@world.std.com> wrote:
>So, does anyone know of a macro processor that could be used for this?
>It would basically have to expand macros and nested macros, include
>files, and, perhaps handle conditionals.

Does m4 handle nested macros?  If not there are perl modules which allow
you to do simple template like operations available on CPAN which might
be the basis for a tool.

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: 16 Jan 1998 11:53:37 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Matthew Eldridge <eldridge@graphics.stanford.edu>
Subject: Re: Why does Perl5.0004 use a "Configure" script
Message-Id: <8c90sgntce.fsf@gadget.cscaper.com>

>>>>> "Matthew" == Matthew Eldridge <eldridge@graphics.stanford.edu> writes:

Matthew> Hi-
Matthew> I've come to know and love the gnu autoconf stuff.  Nothing finer
Matthew> than typing "./configure" and having it race through, figuring
Matthew> out everything under the sun.

Matthew> Without starting a religious war, or stepping on too many toes,
Matthew> why does Perl5 use "Configure" which spends a huge amount of
Matthew> time answering questions it could trivially answer itself?
Matthew> I mean the wheel needn't be reinvented, just use autoconf,
Matthew> right?

Perl's Configure derives from rn's Configure, which pre-dates GNU's
autoconf by, ohh, about 10 years or so. :-) Also, Configure runs in
more environments than autoconf (although some of those environments
are probably long dead :-).

And if you want default answers to everything, just do what I do:

	gtar xfz perl5.004_04.tar.gz
	cd perl5.004_04
	./Configure -ders -Dcc=gcc -Dprefix=$HOME && make test all install

There.  Three commands.  No interaction required.  Put'em in a script
if you want. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 227 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: Fri, 16 Jan 1998 14:59:22 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: WWWBoard Help
Message-Id: <comdog-1601981459220001@news.panix.com>
Keywords: just another new york perl hacker

In article <34BF6AEE.781277EC@mindless.com>, "Jon A." <jonsa@mindless.com> posted:

> I am trying to get a WWWBoard running, but when i try to post i get the
> error:
> 
> Method Not Allowed
> 
> The requested method POST is not allowed for the URL
> /~anotherpunk/cgi-bin/wwwboard.pl.

sounds like the appropriate scripts don't have execute permissions.
however, you might find other problems by going through the steps
in the Idiot's Guide to Solving Perl CGI problems, as referenced
in the CGI Meta FAQ. [1]

[1]
<URL:http://computerdog.com/CGI_MetaFAQ.html>

-- 
brian d foy                                 <http://computerdog.com>


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

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

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