[10779] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4380 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 8 14:07:31 1998

Date: Tue, 8 Dec 98 11:00:20 -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           Tue, 8 Dec 1998     Volume: 8 Number: 4380

Today's topics:
    Re: $|=0 <jeromeo@atrieva.com>
        & om7@cyberdude.com
    Re: 3 perl cgi questions... (Bart Lateur)
    Re: Access a database on a other server jon@amxstudios.com
    Re: Beginner Book? (Erik)
    Re: Code Bash: File Include <merlyn@stonehenge.com>
    Re: Does LWP/libwww module work with Win32 Perl? (Randy Kobes)
    Re: Does LWP/libwww module work with Win32 Perl? dturley@pobox.com
    Re: file creation in Perl jon@amxstudios.com
        Getting Perl Modules to work on ISPs that don't allow s rna16s@usa.net
        Help!  Possible permissions problem? (Abe)
    Re: Help!  Possible permissions problem? (brian d foy)
    Re: Hey look! Im an expert too dturley@pobox.com
        In which directory does the 'sqlnet.log' file get creat <bhewitt@orca.akctr.noaa.gov>
        Interpreting Multipart encoding <r2-d2@REMOVEbigfoot.com>
    Re: MySQL or PostGresSQL or ??? (with Linux 5.2/Apache/ jon@amxstudios.com
        on-topic commercial followups are not spam! (was Re: To <Russell_Schulz@locutus.ofB.ORG>
    Re: Perl examples (Mark-Jason Dominus)
        Perl Script and HTML rmaglich@my-dejanews.com
        Problem running Perl CGI's on NT in SuiteSpot <bwduggan@DONTSPAMbear.com>
    Re: Random integer numbers (1,2,3,4,5....,.....) HOW??? <rkirch@SPAMOFF.torsel.alcatel.com>
        Redirecting STDIN <jrifkin@mail.ims.uconn.edu>
    Re: shift. (Tad McClellan)
        simple regular expression problem esiyuri@my-dejanews.com
    Re: simple regular expression problem (Sean McAfee)
    Re: simple regular expression problem (Brand Hilton)
    Re: VRML Tools for Unix (in Perl?) jon@amxstudios.com
        Y2K bug in pod2man script <Steve.Waltner@symbios.com>
    Re: Y2K bug in pod2man script <Allan@due.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 08 Dec 1998 08:09:13 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: $|=0
Message-Id: <366D4F29.DC3145D@atrieva.com>

om7@cyberdude.com wrote:
> 
> Can someone please tell what $|=0 does.
> I've read it up, and understand that it flushes the buffer or something.
> [Is that correct?]
> And why would you need to use it?


The perlvar manpage says:
$|

If set to nonzero, forces a flush right away and after every write or
print on the currently selected output channel.  Default is 0
(regardless of whether the channel is actually buffered by the system or
not; $| tells you only whether you've asked Perl explicitly to flush
after each write). Note that STDOUT will typically be line buffered if
output is to the terminal and block buffered otherwise. Setting this
variable is useful primarily when you are outputting to a pipe, such as
when you are running a Perl script under rsh and want to see the output
as it's happening. This has no effect on input buffering. (Mnemonic:
when you want your pipes to be piping hot.) 

You can read all about perl's predefined in variables in the perlvar
documentation, included with your documentation.

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Tue, 08 Dec 1998 17:40:06 GMT
From: om7@cyberdude.com
Subject: &
Message-Id: <74jo9m$5r4$1@nnrp1.dejanews.com>

I have the following code...

sub qwerty(&)
{
     my $var_name = shift;

 ........................
 .... declare and use two file handles, called $f1 and $f2, say .......
 ..................................
 .... $f2 is for reading from ....
 .................................
 .... $f1 is for writing to ..........
 .................................

     &$var_name($f1, $f2);

 ....................................
 ....................................


What is the & in "sub qwerty(&)" used for??

And what is "&$var_name($f1, $f2);" doing??


THANKS.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 17:56:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: 3 perl cgi questions...
Message-Id: <366f6712.2763496@news.skynet.be>

Christian H. Knudsen wrote:

>1) Is it possible for a cgi perl script to check if a file
>on a remote server server exists? Check the size?

>$exists = -e "http://www.blah.com/images/image.gif";
>$size = -s "http://www.blah.com/images/image.gif";

Look into LWP::Simple. I haven't used it myself (yet), but I bet that's
the way to go.

>2) Is it possible to check the dimensions of an image
>file (width x height)?

Yes. Check the module Image::Size on CPAN.

>3) How do you make a script that first reads/writes to
>some files, then reloads a new page?
>
>Ex.:
>open (FILE, "...");
>.
>close (FILE);
>print "Location: http://www.blah.com";
>
>When I run this I get a "Premature end of script headers" error.

You forgot the two newlines at the end.

   HTH,
   Bart.


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

Date: Tue, 08 Dec 1998 18:06:29 GMT
From: jon@amxstudios.com
To: marcov@ctrl-v.nl
Subject: Re: Access a database on a other server
Message-Id: <74jpr3$7d5$1@nnrp1.dejanews.com>

In article <366BD783.CB8B96DF@ctrl-v.nl>,
  Marco Vlemmings <marcov@ctrl-v.nl> wrote:
> Hi all
>
> I have a question.
> I want to make a perl script which will work on a webserver.This script
> will access a database,but the database is on an other server.How can  i
> retrieve data from the database server to my webserver?

The standard way to connect to a database with Perl is to use the DBI
module(s) with one or more DBD drivers. DBI works across any machines on a
TCP/IP network.

DBI uses familiar concepts of pass-through SQL and recordsets. If these
concepts are not familiar - you have your work cut out!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 8 Dec 1998 18:52:26 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Beginner Book?
Message-Id: <74jsha$dfo$1@news.cyberhighway.net>

[Posted and mailed]

In article <36705353.3866761@news.centuryinter.net>,
	nnickee@nnickee.com (Nnickee) writes:
> Might I suggest "Perl 5 for Dummies" without fear of 32 camels showing
> up to take a dump on my front lawn?

I doubt it...Perl 5 for Dummies is technically inaccurate in several points.
Refer to Tom Christiansen's review of it:

CAPSULE REVIEW: Barely achieving its two camels, this book is not only
made for dummies, it's guaranteed to keep you one.  But hey, if you like
to have your competence and intelligence insulted everywhere from the title
to the text, then this is the book for you.  This book can't figure out
the difference between an array and a list, thinks there's a \v escape,
screws up the CGI form decoding (why does everyone do this?), doesn't
understand the difference between programs and libraries, massively screws
up quoting on Win32 paths, spreads FUD about $_, omits $!, and relegates
the true heart and soul of Perl, pattern matching and hashes, way to the
end, in the chapters 14 and 15 respectively.  So, it's technically screwed
up, has hard-to-read style, does nearly everything the hard way, hides
the good stuff where you won't find it, and likes to put its readers
down.  Even more so, it revels in showing disrespect to anyone who seems
to enjoy or be good at programming.  Perhaps this makes dummies feel good.

I guess this just goes to show you that the old adage about avoiding books
with numbers in their titles is right.

End quote.

For more reviews, and probably a much better way of determining what books
to buy, check out http://language.perl.com/critiques/index.html

> Perl is my first language too (not counting html which just barely
> (IMO) counts as a language) and P5FD was my first choice.  Easy to

HTML is a formatting specification, not a programming language by any
stretch of the imagination.

> understand and work with, and comes with a CD with the various perls
> for whatever OS you're running.

It includes severely outdated versions of Perl, which have many known
problems with them.

> Now I'm looking for my second book, something with a little more meat
> in it, geared towards win32.  Suggestions?  (Yes, I've read the faq, I
> want opinions now :)

Read the critiques page pointed to above.

Now, as much as I hate to point money to people who don't need it, I hate
to point money to people who are completely incompetent even more.
That said, with three very good books by people who have had direct ties
to the core Perl development team for years out there (published by
O'Reilly), why on Earth would you want to throw money at a bunch of
people with no real understanding of the language writing books just
to make an easy buck on the next big Internet phenomenon?  I really can't
understand why you would buy a book from someone who is not respected 
or even particularly well known in the Perl community, when the alternative
is to buy a book written by people who are very well known in the
community, and whose technical support skills (as seen on this group) and
technical competence are well-known and respected.

I don't know, maybe people buy the books because they reflect what those
people consider themselves to be.  If that's the case, then might I suggest
a good psychiatrist rather than a book on perl.  I'm just waiting for
"Perl 5 for Neurotic Technophobic Drooling Morons" to come out.  I'm
guessing it'll be a huge success.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Bell Atlantic. If telecommunications were a prison, BA would be the 300-pound
inmate who takes a certain..."liking" towards you.
             -- Isaac-Lew in a.s.r.


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

Date: Tue, 08 Dec 1998 18:17:34 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Code Bash: File Include
Message-Id: <8c3e6q33dc.fsf@gadget.cscaper.com>

>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:

Uri> so a challenge for you would be a one liner that would also exit the
Uri> @ARGV loop with an error message.

{ local *ARGV; @ARGV = @list; die "cannot read one of these: @ARGV" if grep ! -r, @ARGV; print while <>; }

:-)

-- 
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: 8 Dec 1998 16:58:40 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Does LWP/libwww module work with Win32 Perl?
Message-Id: <slrn76qn7c.m76.randy@theory.uwinnipeg.ca>

On Tue, 08 Dec 1998 15:45:12 GMT, tyrosine@usa.net <tyrosine@usa.net> wrote:

>  I was wondering if anyone knows if the LWP/libwww perl module is
>compatible with the Active State win32 Perl? 

Hi,
   Yes, they're compatible - you can install them using 
ActiveState's ppm (perl package manager), or else manually
using CPAN.pm or by grabbing the source and installing it
according to the standard perl Makefile.PL; make; make test;
make install sequence (where 'make' is either nmake or dmake).

>						If it is compatible can
>it be used locally (in an ISP user account) situations by modifying
>the @INC in such a way...
>
>'********* Obtained from newsgroup posting **********
>BEGIN {
>  push( @INC, "/mymodules");
>}
>to modify @INC.
>'************************************************************

Yes, but this needs to be done only if you install a module
in a non-standard place (eg, in your home directory if you
don't have the right permissions). In this case, you can
specify the install directory in
	perl Makefile.PL PREFIX=/my/private/dir
In your script, you could then use
	use lib '/path/to/my/private/lib';

>Is their a site/resource that might list those modules that are
>compatible with win32? Thank you for any assistance.

Check out http://www.connect.net/gbarr/cpan-test/, which
describes an initiative to test CPAN modules on a wide
variety of platforms.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: Tue, 08 Dec 1998 18:13:14 GMT
From: dturley@pobox.com
Subject: Re: Does LWP/libwww module work with Win32 Perl?
Message-Id: <74jq7o$7jb$1@nnrp1.dejanews.com>

In article <366d47dc.1532316244@news.randori.com>,
  tyrosine@usa.net wrote:
> Hello,
>
>   I was wondering if anyone knows if the LWP/libwww perl module is
> compatible with the Active State win32 Perl?

HINT 1:What did you find when you looked at the ActiveState site?
HINT 2: What happened when you tried to run a script that uses the module?

> Is their a site/resource that might list those modules that are
> compatible with win32? Thank you for any assistance.
>

HINT 3: http://www.activestate.com


David Turley
dturley@pobox.com
http://www.binary.net/dturley/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 18:15:10 GMT
From: jon@amxstudios.com
Subject: Re: file creation in Perl
Message-Id: <74jqbb$7sp$1@nnrp1.dejanews.com>

In article <74gcjv$8f1$1@nnrp1.dejanews.com>,
  iron_fist@my-dejanews.com wrote:
> Hiya Peoples
>
>    I am learning PERL atm. I decided to get off my butt and learn CGIs.
>
> 	I know how to write to a file and open etc. What I cannot figure out is
how
> to create one.

>From the perlfunc manual page:

               If the filename begins
               with '>', the file is truncated and opened for
               output, being created if necessary. If the
               filename begins with '>>', the file is opened for
               appending, again being created if necessary.

thus:

open(OUT, ">output.txt") || die "can't open file output.txt for writing: $!";

will create a filehandle 'OUT' that writes to the file 'output.txt', which
will be erased if it already exists, and created if it doesn't. If for some
reason it can't be created or erased (file permissions, perhaps), you script
will die, giving the error message (which Perl puts in $!).

If, like me, you find man pages a pain, then do yourself a favour - buy the
Perl books from O'Reilly (all of them, llama, camel, panther, in that order)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 18:00:42 GMT
From: rna16s@usa.net
Subject: Getting Perl Modules to work on ISPs that don't allow shell access
Message-Id: <366d67da.5673578@news.randori.com>

In order to use a Perl module does one have to have shell access? I
have seen many postings that say that you must use "perl makefile.pl
PREFIX=/my/dir" but I am unable to do this since I do not have shell
access to my ISP. Can the module be placed inside a directory and then
just referenced from the script making use of it? I am using two ISPs,
one is UNIX and one is WinNT. Thanks.

-David


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

Date: Tue, 08 Dec 1998 18:27:38 GMT
From: abe@abe.com (Abe)
Subject: Help!  Possible permissions problem?
Message-Id: <uceb2.1593$Bs.4222983@news4.atl>

OK, I've written a Perl script that when run, will read a number from a 
data file, create a directory off of the main directory using that 
number, increment the number, and write it back to the data file.  For 
the most part, it works fine.  However, I think there is a permissions 
problem somewhere.  I use:

system( "mkdir $dir/$num" );

The directory creation works without a hitch.  I also make the directory 
world-writable with:

chmod 777, '$dir/$num';

I've been having some problems, however.  When I FTP in to the server, 
it will not allow me to alter or delete anything in the new 
subdirectory, nor will it allow me to upload anything to that directory, 
set permissions on anything in the directory, or even set permissions on 
the directory itself.   Everything still works fine with every directory 
other than the one created by the script.  Other scripts that I have 
written can alter data in this directory, but I can't do it myself.  Is 
this a permissions problem?  Help!

Oh, and abe@abe.com is a spamfoiler so please post your comments here.  
I understand that there is some poor guy named Abe getting email that is 
meant for me! ;)


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

Date: Tue, 08 Dec 1998 13:41:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help!  Possible permissions problem?
Message-Id: <comdog-ya02408000R0812981341490001@news.panix.com>

In article <uceb2.1593$Bs.4222983@news4.atl>, abe@abe.com (Abe) posted:

> system( "mkdir $dir/$num" );

why not use the builtin mkdir()?

> The directory creation works without a hitch.  I also make the directory 
> world-writable with:
> 
> chmod 777, '$dir/$num';

are you sure that worked?  did you check the resulting permissions?

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Tue, 08 Dec 1998 18:05:46 GMT
From: dturley@pobox.com
Subject: Re: Hey look! Im an expert too
Message-Id: <74jppo$7cp$1@nnrp1.dejanews.com>

In article <74i2s3$n86$1@fir.prod.itd.earthlink.net>,
  "S. Mart Alleck" <smart@lleck.com> wrote:

> (Its easy being an expert)

But you apparently still can't do it.

I've asked dozens of questions here and have never not received an answer
within a day.

Perhaps if you lose the attitude and not be so chicken-shit that you fake your
name, you'd get an answer too.

(Okay, I know he's trolling...)
--
David Turley
dturley@pobox.com
http://www.binary.net/dturley/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 8 Dec 1998 09:15:16 -0800
From: Bob Hewitt <bhewitt@orca.akctr.noaa.gov>
Subject: In which directory does the 'sqlnet.log' file get created? (fwd)
Message-Id: <Pine.SGI.3.95.981208090222.9320A-100000@orca.akctr.noaa.gov>

(Already posted this to comp.databases.oracle.*)

I run sqlload from a perl program. It loads data into an Oracle database
which is located on another computer on the same subnet. Today, the remote
Oracle database was not available and an 'sqlnet.log' file was created. 
The directory in which the 'sqlnet.log' file was created was not the
directory from which data were being loaded. Is that file created in the
current working directory? (Can I choose the directory in which the
'sqlnet.log' file is created?)

I would appreciate hearing if anybody has had experience with an
sqlnet.log file getting created when running Oracle programs from perl 
(perl 4, in this case.)

Thanks, Bob Hewitt

       [ Bob Hewitt - bhewitt@orca.akctr.noaa.gov, (206)526-4208 ]





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

Date: Tue, 8 Dec 1998 17:19:50 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Interpreting Multipart encoding
Message-Id: <74jn4o$kr3$1@plug.news.pipex.net>

Hi all

How can you have a CGI script Interpret the Multipart Encoding type?  I have
a form that has both normal text fields and a file upload field and need to
be able to interpret the encoded text fields.

Thanks for any help
Artoo




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

Date: Tue, 08 Dec 1998 17:56:46 GMT
From: jon@amxstudios.com
To: psmith01@mindspring.com
Subject: Re: MySQL or PostGresSQL or ??? (with Linux 5.2/Apache/Perl/DBI)
Message-Id: <74jp8t$6qs$1@nnrp1.dejanews.com>

In article <366B88A6.D1319ADC@mindspring.com>,
  Peter Smith <psmith01@mindspring.com> wrote:
> I'm about to write a web-to-database ecommerce application.  I plan on
> using Apache web server with Perl to access the database.  Which
> database is better, MySQL or PostGresSQL??  Are there others I missed??
> The cheaper the database, the better!

There is a new newsgroup aimed specifically at web databse integration:

comp.infosystems.www.databases

that said - both have good support for DBI. MySQL also has a mature non-DBI
interface if you want to be different. MySQL is very very fast. PostgreSQL
has a richer subset of SQL, including nested SELECTs, and some object
oriented database features.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 8 Dec 1998 10:28:14 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: on-topic commercial followups are not spam! (was Re: Tool to reverse engineer perl code)
Message-Id: <19981208.102814.0S2.rnr.w164w_-_@locutus.ofB.ORG>

"Steven Morlock" <newspost@morlock.net> writes:

> SPAM!

and yet for some reason, he quoted it all; I'll summarize:

first, the questions:  (why are half the people quoting incorrectly...?)

>>> I was just searching for the same thing -- a tool for analyzing perl
>>> application -- required files, sub-routines & data members, inputs,

>>>> Has anyone on this list come across a reverse engineering tool that
>>>> will take perl code as input and generate data diagrams, process
>>>> diagrams (flowcharts), etc. I know that there are lots of software

the posted answer:

>> It should be possible to use WithClass 98 to do this.  WithClass is a
>> UML design tool with a VBA scripting language built in that has
>> support for reverse engineering in any language and also the ability
>> to automate the drawing of diagrams. If you send us a sample of the
>> type of code you want reversed we would be excited to try to write an
>> automation script that would allow the drawing of a diagram from
>> Perl. (object, state, activity).  We will then post the script here.

now who in their right mind can claim this individual, non-broadcast,
on-topic, requested info is spam?
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 8 Dec 1998 12:26:42 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl examples
Message-Id: <74jngi$5ta$1@monet.op.net>

In article <366C1ACB.4F2750E8@hp.com>, Pep Mico  <pep_mico@hp.com> wrote:
>Where can I found Perl Examples? 


http://www.perl.com/CPAN/scripts/


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

Date: Tue, 08 Dec 1998 18:06:00 GMT
From: rmaglich@my-dejanews.com
Subject: Perl Script and HTML
Message-Id: <74jpq6$7cv$1@nnrp1.dejanews.com>

I have written a perl script that accepts the contents of a form, but the HTML
that is supposed to be displayed after the form processing is completed is not
being returned to the client.  The code is as follows (noting modifications):


#!/usr/local/bin/perl
print "Status: 200\nContent-type: text/html\n\n";

%cgivars= &getcgivars ;  #  getcgivars is a parser--  and it works correctly
$OURFILE = `/usr/local/bin/tempname temp`;  #  creates a temporary file name

 open(OURFILE, ">$OURFILE");
 foreach (keys %cgivars)
 {
         if ("$_" eq 'signature')          # signature is a field of the form
         { print OURFILE ("$cgivars{$_}\n");  }
 }
  close(OURFILE);
 `chmod 777 $OURFILE > /dev/null`;

 print <<"EOF";
     <HTML><HEAD><TITLE>Testing Script</TITLE>
     <SCRIPT language="JavaScript">
         var newWin = null
         newWin =
window.open("http://<IP address>/cgi-bin/wspd_cgi.sh/login.w", "tmwin",


"directories=no,menubar=yes,status=yes,toolbar=no,location=yes,scrollbars=yes,re
 sizable=yes")
         self.name = "pretmwin"
         self.blur()
         newWin.focus()
         </SCRIPT>
         </HEAD>
         <BODY>
         <CENTER>
         <h1>Welcome</h1>
         <h2>Copyright 1998</h2>
         <h1>Use the other window.</h1>
         </CENTER>
         </BODY></HTML>
 EOF
 exit;

It works from the command line, but when the form is submitted the HTML is not
returned to the client machine.  Any help would be greatly appreciated......

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 17:47:57 GMT
From: Bryan Duggan <bwduggan@DONTSPAMbear.com>
Subject: Problem running Perl CGI's on NT in SuiteSpot
Message-Id: <366D667A.720981EA@DONTSPAMbear.com>

Hi,

Apologies if this is the wrong newsgroup, I Hoping for some help on this
Nestacpe Perl problem.

I am running SuiteSpot on a NT machine and I want to evaluate some perl
scripts for a web site. I have installed Perl for NT and I can run perl
programs from the command line, just by typing the program name. I have
also set up the CGI bin directory for the server and I can run NT Batch
file CGI's through the browser no problem. However, whenever I try and
run a Perl CGI through the browser, I get the following message
returned:

Server Error

This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfiguration.
Please ask the administrator to look for messages in the server's error
log.

This is the message in the server's error log:

[08/Dec/1998:16:46:26] failure: for host 165.168.134.55 trying to GET
/cgi-bin/test.pl, send-cgi reports: could not send new process (Error
Number is unknown)
[08/Dec/1998:16:46:26] failure: cgi_send:cgi_start_exec
D:\Netscape\SuiteSpot\cgi-bin\test.pl failed

The perl I am trying to run runs from the command line no problem. It's
just:

print "Content-type: text/html\n\nHello";

Any help would be greatly appreciated!

Thanks,

Bryan

--
Remove the DONTSPAM to get my email address
Unite For Java! - http://www.javalobby.org




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

Date: Tue, 8 Dec 1998 11:30:54 -0500
From: "Richard Kirchknopf" <rkirch@SPAMOFF.torsel.alcatel.com>
Subject: Re: Random integer numbers (1,2,3,4,5....,.....) HOW???
Message-Id: <74jjs9$evd@vu101.vansel.alcatel.com>

Marcel Ouwendijk wrote in message <747183$lop$1@sun4000.casema.net>...
>I know that there is a function 'rand(value)' but it returns floating point
>numbers. But i need a whole integer nummer somwhere between 1 and 15.

OK, I am new to perl, but the following appears to work

$_ = int(rand(15));         #  random number between 0 and 14
$_++;                          #  now between 1 and 15


Richard Kirchknopf
Alcatel Canada Inc. Transport Automation
1235 Ormont Drive, Toronto  M9L 2W6




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

Date: Tue, 08 Dec 1998 13:32:35 -0500
From: Jon Rifkin <jrifkin@mail.ims.uconn.edu>
Subject: Redirecting STDIN
Message-Id: <366D70C3.D75DD1DA@mail.ims.uconn.edu>

I want to my script to read an input file OR STDIN when the 
input file name is '-'.  How can I do that?

I tried

if ($ARGV[0] eq '-')
	{
	open (INFILE, STDIN);
	}
else
	{
	open (INFILE, $ARGV[0]);
	}

But that doesn't work.  

Also, for
   open (INFILE, STDIN);
I tried
   open (INFILE, "|");
and
   open (INFILE, "STDIN")

They don't work either.

So what does work?

Thanks in advance.

J. Rifkin


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

Date: Tue, 8 Dec 1998 10:46:02 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: shift.
Message-Id: <a4lj47.tss.ln@magna.metronet.com>

om7@cyberdude.com wrote:
: Can someone please tell me what the following does

: my $variablename = shift;

: It's being called inside a sub routine.


   It does what it says it does in the description for shift()
   in the 'perlfunc' man page.

   Please let us know what part you didn't understand so that
   the standard docs can be made more understandable.



-----------------------
=item shift ARRAY

=item shift

Shifts the first value of the array off and returns it, shortening the
array by 1 and moving everything down.  If there are no elements in the
array, returns the undefined value.  If ARRAY is omitted, shifts the
C<@_> array within the lexical scope of subroutines and formats, and the
 ...
-----------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 08 Dec 1998 17:04:17 GMT
From: esiyuri@my-dejanews.com
Subject: simple regular expression problem
Message-Id: <74jm6g$3oi$1@nnrp1.dejanews.com>

Hi,

can anybody help me with the following regular expression problem...
I have a string variable that contains some text with embedded newline
characters and I want to extract just some of the text.  I'm very new
to perl, so please forgive me if this is a stupid question, but I have
spent ages looking through the documentation & just can't see how to do
it.  Here's a demo script...
--------------------8<---------------------8<---------------------
#!perl
my $text = "Name: Fred Jones\nTel: 12345 6789\nFax: 34343 3434\n";
print "=== before ===\n";
print $text;
(my $tel = $text) =~ s/^Tel: //m;
print "=== after ===\n";
print $tel;
--------------------8<---------------------8<---------------------

This produces:

=== before ===
Name: Fred Jones
Tel: 12345 6789
Fax: 34343 3434

=== after ===
Name: Fred Jones
12345 6789
Fax: 34343 3434

What I want is *just* the telephone number, ie "12345 6789".  Since the text
is often in a different format (it is extracted from an HTML page using the
rather excellent "HTML::TokeParser" module) the solution can only rely on the
"Tel:" marker being on the same line...  the other fields may be absent.

Thanks for reading...

--
Regards
Yuri McPhedran  (mailto:esiyuri@my-dejanews.com)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 17:21:07 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: simple regular expression problem
Message-Id: <7edb2.577$4w2.2734996@news.itd.umich.edu>

In article <74jm6g$3oi$1@nnrp1.dejanews.com>,  <esiyuri@my-dejanews.com> wrote:
>can anybody help me with the following regular expression problem...
>I have a string variable that contains some text with embedded newline
>characters and I want to extract just some of the text.

>my $text = "Name: Fred Jones\nTel: 12345 6789\nFax: 34343 3434\n";

>What I want is *just* the telephone number, ie "12345 6789".  Since the text
>is often in a different format (it is extracted from an HTML page using the
>rather excellent "HTML::TokeParser" module) the solution can only rely on the
>"Tel:" marker being on the same line...  the other fields may be absent.

You need to use a match operator, not a substitute operator:

$text =~ /^Tel: (.*)/m;
my $tel = $1;

Or, to use a shorter idiom,

(my $tel) = $text =~ /^Tel: (.*)/m;

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 8 Dec 1998 17:23:37 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: simple regular expression problem
Message-Id: <74jnap$at2@mercury.adc.com>

In article <74jm6g$3oi$1@nnrp1.dejanews.com>,  <esiyuri@my-dejanews.com> wrote:
>Hi,
>
>can anybody help me with the following regular expression problem...
>I have a string variable that contains some text with embedded newline
>characters and I want to extract just some of the text.  I'm very new
>to perl, so please forgive me if this is a stupid question, but I have
>spent ages looking through the documentation & just can't see how to do
>it.  Here's a demo script...
>--------------------8<---------------------8<---------------------
>#!perl
>my $text = "Name: Fred Jones\nTel: 12345 6789\nFax: 34343 3434\n";
>print "=== before ===\n";
>print $text;

my ($tel) = $text =~ /^Tel: (.*)$/m;

>print "=== after ===\n";
>print $tel;
>--------------------8<---------------------8<---------------------

If that line isn't obvious to you, read the perlop man page regarding
what m// returns in list context.

Enjoy!

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Tue, 08 Dec 1998 18:01:30 GMT
From: jon@amxstudios.com
To: Alun.Moon@ncl.ac.uk
Subject: Re: VRML Tools for Unix (in Perl?)
Message-Id: <74jphp$70d$1@nnrp1.dejanews.com>

In article <366BB817.843E57FD@ncl.ac.uk>,
  Alun Moon <Alun.Moon@ncl.ac.uk> wrote:
> I'm looking for some tools that I can run under Unix (possibly in Perl?) that
> can manipulate VRML files.
>
> Specifically I'm looking for 	Vrml 1.0 --> Vrml 2.0 Translators
> 				IGES --> Vrml 2.0 Translators

on CPAN there are currently these modules available with VRML in their names:

Module          PDL::Graphics::TriD::VRML (LUKKA/PDL-1.99989.tar.gz)
Module          PDL::Graphics::VRML (LUKKA/PDL-1.99989.tar.gz)
Module          PDL::Graphics::VRML::Protos (LUKKA/PDL-1.99989.tar.gz)
Module          VRML::Base      (HPALM/VRML-1.04.tar.gz)
Module          VRML::Browser   (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::CU        (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Color     (HPALM/VRML-1.04.tar.gz)
Module          VRML::GLBackEnd (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::JPEG      (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::JS        (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::OpenGL    (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::PNG       (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Parser    (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Quaternion (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Scene     (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Text      (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::URL       (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::VRML1     (HPALM/VRML-1.04.tar.gz)
Module          VRML::VRML1::Standard (HPALM/VRML-1.04.tar.gz)
Module          VRML::VRML2     (HPALM/VRML-1.04.tar.gz)
Module          VRML::VRML2::Standard (HPALM/VRML-1.04.tar.gz)
Module          VRML::VRMLFunc  (LUKKA/FreeWRL-0.14.tar.gz)
Module          VRML::Viewer    (LUKKA/FreeWRL-0.14.tar.gz)

One or more of these may help you.
If the concept of 'CPAN' is alien to you, visit www.perl.com and read about
it:-)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 11:09:34 -0600
From: Steve Waltner <Steve.Waltner@symbios.com>
Subject: Y2K bug in pod2man script
Message-Id: <366D5D4E.68C1152B@symbios.com>

In our Y2K audit, we uncovered a Y2K bug in the pod2man script that
ships with Perl. The problem is that the script uses the array output of
localtime() but doesn't add 1900 to the year before spitting it out to
the man page that the script is generating. I have included a context
diff with the fix for the script. This problem is in the 5.005_02
disctibution that I downloaded this morning. How does a bug like this
get reported back to the development team? E-mail responses prefered.


*** pod2man.PL  Thu Jul 23 23:01:57 1998
--- pod2man.y2k Tue Dec  8 10:46:09 1998
***************
*** 330,335 ****
--- 330,336 ----
  sub makedate {
      my $secs = shift;
      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($secs);
+     $year += 1900;
      my $mname = (qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov
Dec})[$mon];
      return "$mday/$mname/$year";
  }


--
Steve Waltner             | Steve.Waltner@symbios.com
LSI Logic                 | Phone: (316) 636-8498
3718 N. Rock Road         | FAX:   (316) 636-8889
Wichita, KS 67226         |


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

Date: Tue, 8 Dec 1998 12:51:16 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Y2K bug in pod2man script
Message-Id: <74jolj$60h$1@camel18.mindspring.com>

Steve Waltner wrote in message <366D5D4E.68C1152B@symbios.com>...
>In our Y2K audit, we uncovered a Y2K bug in the pod2man script that
>ships with Perl. The problem is that the script uses the array output of
>localtime() but doesn't add 1900 to the year before spitting it out to
>the man page that the script is generating. I have included a context
>diff with the fix for the script. This problem is in the 5.005_02
>disctibution that I downloaded this morning. How does a bug like this

>get reported back to the development team? E-mail responses prefered.

It has been reported, see thread
pod2man and Y2K
in clpm started by Morten Welinder 1998/11/19

AmD

[mailed at request and posted]




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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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