[7192] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 817 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 6 18:17:23 1997

Date: Wed, 6 Aug 97 15:08:47 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 6 Aug 1997     Volume: 8 Number: 817

Today's topics:
     "Runtime exception' error in perl using Win32::ODBC <sbedberg@ucdavis.edu>
     ... file updates & flock (Bill Hliwa)
     Re: all subs in one file or many? speed differences <gwhassan@prodigy.net>
     Re: Buy any Perl book in print <sibsib@hotmail.com>
     Re: Buy any Perl book in print <merlyn@stonehenge.com>
     Re: Buy any Perl book in print <tom@mitra.phys.uit.no>
     Re: Buy any Perl book in print (Ira Krakow)
     C++ source code parsing module <Jean-Francois.Ripouteau@ansf.alcatel.fr>
     Clearing browser screen before sending HTML code to bro <schmitz@sunydutchess.edu>
     Re: Create E-mail with perl-script (Doran Barton)
     Re: Creating a lynx -dump script? <rootbeer@teleport.com>
     Criteria for file locking over other methods (Dianna Laakso)
     execution with parametres <vhebbeli@vub.ac.be>
     File locking <a.cox@rbgkew.org.uk>
     Re: File locking <merlyn@stonehenge.com>
     Re: Help with a Password Script <g4dom@cdf.toronto.edu>
     help: "easy" select distinct routine... (Jvrgen Gustafsson)
     Re: how do I get rid of line feeds from string? <ghost@ghost.neosoft.com>
     Re: html --> perl (Jim Michael)
     Re: Interfacing with hardware...? (Andrew M. Langmead)
     Re: List of variables (Eric Bohlman)
     LWP / WebMirror and Password Boxes <clark@s3i.com>
     Re: LWP::Simple proxy <aas@bergen.sn.no>
     Mail::Send question <garry@pp.nsw.gov.au>
     mapping output to specific xterm (Teebu Philip)
     Re: Perl for Windows 95 <jpm@iti-oh.comNOSPAM>
     perl install (2) (Suzan)
     Perl5.00401 on Cray J90?? <jheck@merck.com>
     Re: Read ahead in file <sfairey@adc.metrica.co.uk>
     Re: Reading from pipes (Topher Eliot)
     Re: rounding <rootbeer@teleport.com>
     sleep not mixing well with other signal handlers <shimpei@socrates.caltech.edu>
     Re: SMTP interface for Perl? <Jacqui.Caren@ig.co.uk>
     Re: Sorting a password file (Bob)
     Still confused in flock() land (J. Paul Reed)
     Re: Still confused in flock() land (Mike Heins)
     Re: Telnet module in Win32 (Bob)
     Re: Text formatting <rootbeer@teleport.com>
     textarea - Script not producing line feeds?? (Burt Lewis)
     WEB ARCHITECT <cgaston@lds.com>
     Re: [Q]: Use a Variable to Provide $vars to Split? (Tad McClellan)
     Re: How to execute remote Perl script from Perl? (Adam Rogoyski)
     Re: Mail::Send question (Nathan V. Patwardhan)
     problems building under sinix? (Vicka Corey)
     Range operator question (Heinrich Mislik)
     Re: Running Perl under Windows - No NFS (Tim  Smith)
     Sockets and SIGCHLD (kuehne)
     Word Wrap and Novell Perl5 <ralst37+@pitt.edu>
     Re: [Q] Converter between ELM filter-rules file to proc <usenet-tag@qz.little-neck.ny.us>
     Re: Can filehandles be stored in a hash? (Bart Lateur)
     Commandline arguments <knoblich@scr.siemens.com>
     Re: Embedding perl 5.004_01 into a Visual Basic program <dougm@osf.org>
     Re: File::Find and maxdepth? <rootbeer@teleport.com>
     Getting Missing File Title return when executing script (FREAKSHO)
     Re: MS-DOS port of the Perl programming language <jhi@alpha.hut.fi>
     PID <dq@leland.Stanford.EDU>
     Re: Super Newbie Question <zlzxkv@echidna.stu.cowan.edu.au>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 05 Aug 1997 05:55:01 -0700
From: Steve Edberg <sbedberg@ucdavis.edu>
Subject: "Runtime exception' error in perl using Win32::ODBC
Message-Id: <33E722A5.1AE6@ucdavis.edu>

I have a Perl program executed from an HTML form that uses ODBC to
generate reports from a Visual dBase database. Everything works when I
use the statement:

  if ($O->Sql("insert into $temp2
	       select
		treegenus as Genus, treespecie as Species, count(*) as NumFail
	       from $DataTable
	       $whereclause
	       group by $group_by"
     )       )
	{ $Failed{'Fill file: Temp2'} = "Sql(): " . $O->Error(); }

However, I would like to make the sort on treegenus & treespecie
case-insensitive. To test, I replaced
	treegenus as Genus
with
	UCASE(treegenus) as Genus

and got an 'Error: runtime exception'. I got no other error messages;
the program aborted immediately.

The same thing happened when I replaced UCASE(treegenus) with
	UPPER(treegenus) ,
	{fn UCASE(treegenus)} ,
and	{fn UPPER(treegenus)} ;
I also tried all lowercase versions of the above. According to the
(minimal) Microsplot documentation, the
	{fn UCASE(treegenus)}
form should be correct.

For your information, I am using:
	Microsoft Internet Info Server 1.0 on NT 3.51
	Microsoft ODBC drivers v. 2.50
	Visual dBase v 5.0
	Activeware Perl 5.001
	Dave Roth's Win32::ODBC version 96.10.16

I seem to get the runtime exception error on any function, including
garbage names (eg; GLERFNOP(...)). Aggregate functions, such as
count(*), work fine.

Any ideas??
	-steve

 ...........................................................
 . Steve Edberg                       sbedberg@ucdavis.edu .
 . Computer Consultant     University of California, Davis .
 . (916)753-7605                                           .
 ...........................................................


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

Date: 05 Aug 97 13:19:38 
From: bill@medtechnet.com (Bill Hliwa)
Subject: ... file updates & flock
Message-Id: <493_9708051335@medtechnet.com>

What is the proper way to uniquely update a file from perl?  For example, if I
have a program like this (in pseudo-code):
 
   open some.file for input
     flock(some.file,2)
     stuff = contents of some.file
     flock(some.file,8)
   close some.file
 
   update stuff
 
   open some.file for output
     flock(some.file,2)
     some.file = stuff
     flock(some.file,8)
   close some.file
 
Another process can read the file while I'm "updating stuff" and write out it's
update after the first process finishes writing its update, effectively
overwriting the update from the first process.
 
How do you keep file access locked between closing a file in input mode and
opening again in output mode?

---
 | Bill Hliwa, E-Mail: bill@medtechnet.com
 | Med TechNet: Clinical Laboratory Continuing Education
 | Modem : 1-716-688-1552
 | Voice : 1-800-836-0720
 | FAX   : 1-716-636-8235
 | WWW   : www.medtechnet.com
 | telnet: bbs.medtechnet.com


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

Date: Mon, 04 Aug 1997 20:37:34 -0500
From: Greg Hassan <gwhassan@prodigy.net>
To: dboorstein@ixl.com
Subject: Re: all subs in one file or many? speed differences
Message-Id: <33E683DE.3747E766@prodigy.net>

Dan Boorstein wrote:

> hello all,
>
> i have a good size script (=~ 1200 lines) which contains about 75
> subroutines. i am wondering how this affects start up time
> on the script. since any single execution of the script only calls
> 10 - 15 of the subs, is there considerable extra overhead during
> compiling and initialization due to the 60 - 65 unused subs?

I usually do  if statements with require's for only the necessary code.
when scripts start to get too big.  I think it makes a difference in
load time
but I have not run any time tests.

You just need to think about it, perl doesn't have to read in/parse
those extra
lines of text so it should be faster.  I like it because I can work on
part of the
script without breaking the whole thing.

-Greg
--
===============================================================
                   Greg Hassan, Web Developer
      The Independent Solution (CGI, Java, C, Perl, Oracle)
             http://www.hassan.com/, 1-701-235-3239
===============================================================
        Need a cool gift? http://www.hassan.com/cooie/
Or add your favorite url here: http://www.hassan.com/urlsaver/
===============================================================




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

Date: Tue, 05 Aug 1997 15:10:53 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: Buy any Perl book in print
Message-Id: <33E77ABD.A230CD6B@hotmail.com>

Clark Dorman wrote:
> 
> The really weird part about this is that the list of books there all
> point to amazon.com ?!  Does this mean that this Ira Krakow person has
> some sort of "in" with amazon, so that if he is able to steer people
> to thim that he gets a commission?  Very odd.  On the other hand, it
> means that amazon keeps their hands clean while this guy can spam.
> Kind of slimy if you ask me.

Clark - 

It's no special "in" with Amazon.  It's an advertised program called
"Associates" which is supposed to let people create their own lists of
books which visitors to their sites might want to buy.  At the point
when the visitor clicks, (s)he is taken to Amazon, which handles all
ordering, shipping and billing as usual.  In return, Amazon pays a
referral fee of up to 5-15% of the book's price to the initiating site. 

I think that, in general, it's a good idea; however, like anything else,
people can use it in annoying / slimy ways.

Just my 120 roubles.

Scott

-- 
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net


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

Date: 04 Aug 1997 07:02:46 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: ikrakow@shore.net (Ira Krakow)
Subject: Re: Buy any Perl book in print
Message-Id: <8cg1squjuh.fsf@gadget.cscaper.com>

>>>>> "Ira" == Ira Krakow <ikrakow@shore.net> writes:

Ira> You can buy any Perl book in print at:
Ira> http://www.shore.net/~ikrakow/perlbooks.html

Yes.  Just like you can buy any Perl book in print at amazon.com and
half-dozen other online bookstores.  And you can buy nearly all the
better Perl books (:-) via www.ora.com.

Say, would this be some sort of covert *advertisement* from which
*you* make money?  Note for the future: please don't do that again.
Them's against company policy.  Usenet is *not* for direct commercial
ads.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 393 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@ora.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: 04 Aug 1997 14:16:51 +0000
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Buy any Perl book in print
Message-Id: <nqog1sqf2y4.fsf@mitra.phys.uit.no>


This is just too good to let by:

Randal Schwartz <merlyn@stonehenge.com> writes:

> >>>>> "Ira" == Ira Krakow <ikrakow@shore.net> writes:
> Ira> You can buy any Perl book in print at:
> Ira> http://www.shore.net/~ikrakow/perlbooks.html

> Say, would this be some sort of covert *advertisement* from which
> *you* make money?  Note for the future: please don't do that again.
> Them's against company policy.  Usenet is *not* for direct commercial
> ads.

But just before, he writes

> Yes.  Just like you can buy any Perl book in print at amazon.com and
> half-dozen other online bookstores.  And you can buy nearly all the
> better Perl books (:-) via www.ora.com.

Say, would this be some sort of covert *advertisement* from which
*you* make money?  Note for the future: please don't do that again.
Them's against company policy.  Usenet is *not* for direct commercial
ads.

For the humour impaired: That's supposed to be a little joke.  You
know, funny like.  Feel free to giggle quietly to yourself now.

> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: 4 Aug 1997 14:59:42 GMT
From: ikrakow@shore.net (Ira Krakow)
Subject: Re: Buy any Perl book in print
Message-Id: <5s4qou$g9l@fridge-nf0.shore.net>

  OK.  Which Perl books are the best?

Ira


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

Date: Tue, 05 Aug 1997 14:52:07 -0700
From: Jean-Frangois RIPOUTEAU <Jean-Francois.Ripouteau@ansf.alcatel.fr>
Subject: C++ source code parsing module
Message-Id: <33E7A087.1620@ansf.alcatel.fr>

Hi, 

Just wandering if there's a C++ source code parsing module somewhere.
I'd like to extract classes, methods and so forth from source code.

Sorry if that's another RTFM...

Thanks,
Jean-Francois.


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

Date: Mon, 04 Aug 1997 13:41:51 -0400
From: Steve Schmitz <schmitz@sunydutchess.edu>
Subject: Clearing browser screen before sending HTML code to browser.
Message-Id: <33E6145F.66E4@sunydutchess.edu>

I have a PERL script that is sending the output from a COBOL program to
the browser screen.  While the program is running, I display a message
at the top of the screen telling the person to "please wait" for the
output from my program.

The problem is that when my PERL script sends the output to the browser,
instead of the output starting at the top of the screen, it follows the
"please wait" message that I already have on the screen.  I would like
for the "please wait" message to be overwritten at this point.

Can anyone help me with this.


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

Date: 4 Aug 1997 13:55:23 GMT
From: fozz@cray.com (Doran Barton)
Subject: Re: Create E-mail with perl-script
Message-Id: <5s4n0b$689$1@walter.cray.com>




>Laurijssen Dirk <laurijsd@se.bel.alcatel.be> wrote in article
><33DDF96F.2588@se.bel.alcatel.be.brol>...
>> I'm trying to send a message upon pushing a "send" button on a
>> HTML-page.
>> For now I use a perl-script to do so. 
>> The problem is that I write HTML-statements to the message but when I
>> receive the message these statements aren't processed. (The tags stay
>> visible).
>> In order to do so I could try to convince the Mail-tool that these
>> statements are attached, but how ? Any other (Javascript/Perl)solutions

"james" <jamesc@geoaccess.com> writes:
>I believe it's your e-mail software that has the problem.  It will simply
>display the HTML tags, not interpret them.

I think what's going on here is not a Perl problem, but rather that
Laurijssen does not understand how MIME encoding of e-mail messages works.
When you get an e-mail message, say, in Netscape's mail reader and it is
formatted in HTML, it is not just simply a text message with HTML tags in
it, it is MIME-encoded HTML. Which means, if you're going to generate
MIME-encoded HTML mail messages, you need to know how to generate the
appropriate MIME headers. While I'm not an expert in this, I know you will
need the following:

Content-type: text/html

I suspect e-mail messages are "multipart" as you can attach multiple files
and formats to a message.

- -Fozz


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: http://www.c2.org/~bryce/Niche.html 'BAP' Easy-PGP v1.1b2

iQB1AwUBM+XfR/IhuztZRO8lAQEtOwL/UcoRaAzmMiLs6LRaAo6zp+/miFEplFlb
Qqzop5Wr0oMZ4hEQt7h/vLDk5Ss7xBI40cRc5a7xlGnTofQTZ2TtO1aA+DgnO24f
hFhSUfF+BtswAPCWUbdHkqU+HmJ+0/45
=YcUU
-----END PGP SIGNATURE-----
--
"Even the most mild mannered person could suddenly turn into a glue-sniffing 
  anti-spammer."  -- From a spam selling lists of addresses for spamming

Doran L. Barton -- fozz@cray.com -- Interning at Cray Research, Eagan, MN


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

Date: Mon, 4 Aug 1997 09:00:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Lois Patterson <lpat@unixg.ubc.ca>
Subject: Re: Creating a lynx -dump script?
Message-Id: <Pine.GSO.3.96.970804085957.27878G-100000@kelly.teleport.com>

On 3 Aug 1997, Lois Patterson wrote:

> What I would like to know how to do is to be able to
> run a script so that I could do something like
> 
> lynx -dump http://www.someserver.com/fileK.html >fileK
> 
> for a large group of files ranging from 1 to N without having
> to run the command each time.

I think you want to use system() documented in perlfunc(1). Hope this
helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 5 Aug 1997 14:28:10 GMT
From: dianna@jove.acs.unt.edu (Dianna Laakso)
Subject: Criteria for file locking over other methods
Message-Id: <5s7d9q$7ng@hermes.acs.unt.edu>

I'm rewriting an application in Perl; currently it takes requests
and stores the requests in separate files. The requests are
merged into a single file periodically.

I rewrote it to write the requests to a single file, and I'm using
flock() to lock the file while a request is being written.

Is there a trade-off? Typically the number of requests per day are 300, 
but could be as many as 1000. What criteria do you use to decide whether
to use file locking, or go to separate files per request?
This is really more of a software engineering question, but it does
have something to do with flock()'s performance.

Thanks,
Dianna
dianna@unt.edu
-- 
 Dianna Laakso                   UNIX Systems Administrator 
 University of North Texas       Academic Computing Services
 Voice: 940.565.4898             E-mail: dianna@unt.edu 
 Fax:   940.565.4060             URL: http://people.unt.edu/~dianna 


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

Date: 4 Aug 1997 11:25:43 GMT
From: Vincent Hebbelynck <vhebbeli@vub.ac.be>
Subject: execution with parametres
Message-Id: <5s4e7n$shn@rc1.vub.ac.be>

I ld like to execute my script passing some parametres.
ex scr.pl a b c
with the parametres a b c 

Is it possible? i guess it is.
how can i do it?


thanks

vincent


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

Date: Mon, 4 Aug 1997 09:34:41 GMT
From: "Tony Cox" <a.cox@rbgkew.org.uk>
Subject: File locking
Message-Id: <EEDuKz.Mtr@news.rbgkew.org.uk>



Could someone help me with a file locking problem on our sparc...



I'm trying to get a perl script to lock a file to prevent multiple
concurrent access. Perl apparently uses the flock() system call but it
returns a "not implemented on this platform" error.

Being a bit of a sun novice could someone tell me if this is a "feature" of
suns or else something that has to be implemented by me..?


many thanks

Tony

*******************************************************************
Dr. Tony Cox                         email: a.cox@rbgkew.org.uk
Jodrell Laboratory                  http:  www.rbgkew.org.uk
Royal Botanic Gardens       tel:   (44)-181-332-5360
Kew, U.K.                           fax:   (44)-181-332-5310
*******************************************************************





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

Date: 04 Aug 1997 06:59:15 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Tony Cox" <a.cox@rbgkew.org.uk>
Subject: Re: File locking
Message-Id: <8ciuxmuk0c.fsf@gadget.cscaper.com>


[comp.lang.perl is dead.  Please don't use it in headers.]

>>>>> "Tony" == Tony Cox <a.cox@rbgkew.org.uk> writes:

Tony> I'm trying to get a perl script to lock a file to prevent multiple
Tony> concurrent access. Perl apparently uses the flock() system call but it
Tony> returns a "not implemented on this platform" error.

Most relatively modern versions of Perl emulate flock using lockf
or fcntl on systems that don't have flock(2) in the library.

You didn't say which version of Perl you were running, or which
"sparc" unix you were running either, so it's a little hard to be more
specific.  May I also add that *every* version of Perl prior to 5.004
(which came out this spring) has an active CERT-ifiable security hole,
so it's wise to upgrade anyway if you consider your data to be
valuable.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 393 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@ora.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: Tue, 5 Aug 1997 06:08:14 GMT
From: Dominic Wen <g4dom@cdf.toronto.edu>
Subject: Re: Help with a Password Script
Message-Id: <33E6C34E.64DA@cdf.toronto.edu>

Tom Phoenix wrote:
> 
> On 4 Aug 1997, Wayne Stone wrote:
> 
> > I have just started learning Perl and need to create a simple
> > password checker.
> 
> If you're doing something with a web server, then your server can probably
> do this itself, saving you a lot of time and trouble. You can check the
> server's docs for more info.
> 
> > All I want it to do is see is the password associated with the id
> > submitted is the same as the password associated with the matching id in
> > the data file and return a message if not.
> 
> If you must do this in Perl, you could use the crypt() function,
> documented in perlfunc(1). Hope this helps!
> 
> --
> Tom Phoenix           http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
> Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/

Assume that you manage to get a working PERL program to do all of the
above and even write to the system's password file, and then have the
program interface with a web page on a secure server.  How are you going
to allow the web server to access the system's password file, which only
'root' has privilege to?  I've looked into CGI wrapper programs, but
most of them only allow the web server to run as the owner of the
script.  However, even suEXEC doesn't allow the web server to run as
root.

------------------------------------------------------------------------
D. Wen						   g4dom@cdf.toronto.edu
------------------------------------------------------------------------


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

Date: Mon, 04 Aug 1997 08:46:52 GMT
From: jorgen.gustafsson@emw.ericsson.se (Jvrgen Gustafsson)
Subject: help: "easy" select distinct routine...
Message-Id: <33e590e4.7311873@news>

Hello, can someone help me out with a "select distinct" routine:
Guess that this is pretty simple (but not simple enough for me...)
My "infile.txt" containing the following:


121.1.224.14,row1  
121.1.224.14,row2
22.14.156.67,row3
54.89.23.63,row4
54.89.23.63,row5
54.89.23.63,row6

wan't to do a select distinct on the IP-Adress column and save the
result to a new file like below (all other lines discarded):


121.1.224.14,row1
22.14.156.67,row3
54,89,23,63,row4



(Please reply by email if possible...)

/Jorgen



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

Date: Mon, 04 Aug 1997 08:02:21 -0500
From: Mark Allman <ghost@ghost.neosoft.com>
Subject: Re: how do I get rid of line feeds from string?
Message-Id: <33E5D2DD.2870@ghost.neosoft.com>

Bruce Spedding wrote:
> 
> I need to filter out LFs (0A hex) from a string
> I'd appreciate some suggestions
> regards
> Bruce

$lf = pack( "c", 0x0a );
$theStringWithLF =~ s/$lf//g;

-- Mark Allman
-- Sr. Engineer, McDonnell Douglas Aerospace, allman@pat.mdc.com
-- Allman Professional Consulting, http://www.neosoft.com/~ghost/


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

Date: Tue, 5 Aug 1997 21:36:21 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: html --> perl
Message-Id: <genepoolEEGMoL.AEx@netcom.com>

Tom Halligan (tomh@u1.abs.net) wrote:
:   Hi does anyone know a sharwware or freeware program for converting html
: to perl

Let me take a stab at trying to decipher your question. Are you asking: 
Is there a program which will convert html into a perl script which 
produces the same html? Or are you thiking that html is a programming 
language which has equivalent functions in perl?

Cheers,

Jim


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

Date: Mon, 4 Aug 1997 15:47:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Interfacing with hardware...?
Message-Id: <EEEBvE.399@world.std.com>

[the previous version of this article mis-named linux's /dev/port as
/dev/io]

"Adam Ellsworth" <ellswora@alpha.dsu.edu> writes:

>I admit I'm only a few months into my Perl experience, but I have looked
>many places and haven't found an answer for this particular Q yet, so here
>it is:

>I'm looking for an example of a routine to read the status (as in
>individual pin values, ultimately) of a physical port, either a serial
>port, printer port, or preferably, an actual bus card, and then generate
>some HTML based on that. If there's a generic way to access any port [ Like
>;-) BASIC's "Variable=INP(PortAddress)" ] that would be exactly perfect.
>(or so I like to think... ;-)   )

Since perl was developed mainly on Unix operating systems, you don't
tend to find much in direct hardware access. In Unix, most of that
functionality is done in the operating system and accessed through
system calls. You have a couple of options though.

1. If your operating system allows direct access to its underlying
hardware, you (or someone who knows C) can make a perl extension
module that will perform the needed function. See the perlxs and
perlxstut man pages for details.

2. If your operating system is linux, you can open the /dev/port
device, seek to the appropriate port number, and read your data.

3. Write a device driver that will access your I/O port, then use
perl's syscall() to get data from your driver.
-- 
Andrew Langmead


-- 
Andrew Langmead


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

Date: Tue, 5 Aug 1997 22:01:32 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: List of variables
Message-Id: <ebohlmanEEGnuL.8q@netcom.com>

Linda Littleton (lrl@psu.edu) wrote:
: Is there a way in Perl to get a list of all currently defined variables
: within a program? What I'm looking for is something like a function call
: that would return a list of the names of all current variables. Thanks.

Yes, but it will take a little bit of work.  I'd suggest reading the 
section entitled "Symbol Tables" on pp.281-2 of the new Camel.



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

Date: 05 Aug 1997 09:27:50 -0400
From: Clark Dorman <clark@s3i.com>
Subject: LWP / WebMirror and Password Boxes
Message-Id: <dk9i0kbe1.fsf@s3i.com>


Greetings,

	I have been using WebMirror with the --checklinks to check out my
webpage and make a backup from work.  My work people have noticed this, and
they would like to make a mirror of their web site on another machine for
historical and backup purposes, and so that people at another site don't have
to point to the main site to get copies of things.

	The problem:  one of the pages has a pop-up netscape password box
that has to be filled in.  Has anyone used the authorization capabilities of
LWP in cooperation with WebMirror?  It says in LWP that:

     o   The credentials provide a way to set up user names and
        passwords that is needed to access certain services.

but I cannot figure out how to use this, and especially don't want to muck
around in WebMirror 

	If LWP is not compatible with the type of pop-up authorization window
that is being used, it can be changed.  Does someone here have suggestions
for authorization techniques that will work with LWP and specifically
WebMirror? 

-- 
Clark



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

Date: 04 Aug 1997 17:17:52 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: LWP::Simple proxy
Message-Id: <hoh7e3rkv.fsf@bergen.sn.no>

Kenneth LO <kenlo@hk.super.net> writes:

> Is there any way to set proxy while using LWP::Simple ? I suppose I can
> set $ENV{http_proxy}at the very beginning so that when LWP::Simple call
> $ua->env_proxy the correct proxy value can be set. It does not however
> work.

Try to import the $ua reference from LWP::Simple and call the proxy
method directly (or put your $ENV{http_proxy} inside a BEGIN block).

  use LWP::Simple qw(get $ua);
  $ua->proxy(https => 'http://proxy/');

  print get "https://www.xyzzy.com/";

-- 
Gisle Aas <aas@sn.no>


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

Date: Tue, 05 Aug 1997 16:01:55 +1000
From: Garry Optland <garry@pp.nsw.gov.au>
Subject: Mail::Send question
Message-Id: <33E6C1D3.41C6@pp.nsw.gov.au>

Does anyone have an example of how add headers like "Content-Type:"
using Mail::Send?

I have tried $msg->set and $msg->add but I don't seem to be able to get
it to work.

-- 
Regards,
	 Garry.

--------------------------------------------------------------------
Garry Optland             phone: +61 2 9268 6160, mobile: 0418490365
Email: garry@pp.nsw.gov.au                      fax: +61 2 9268 8094
Pacific Power, Park & Elizabeth Streets, Sydney, NSW  2001 Australia
--------------------------------------------------------------------


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

Date: 4 Aug 1997 14:02:22 GMT
From: tphilip@bnr.ca (Teebu Philip)
Subject: mapping output to specific xterm
Message-Id: <5s4nde$iuf@brtph500.bnr.ca>


I would like to map input provided by a user as input to a specific xterm
that I have spawned from my perl script.  A pointer to where in the FAQ or
in the camel book or a code fragment would be appreciated.

-- 
Teebu Philip         EMAIL: tphilip@nortel.ca
NORTEL (RTP Lab)     XPM Diagnostic Development, Dept. 3X41
35 Davis Dr.         Voice: (919) 991-2602    ESN: 294-2602
RTP, NC  27709       FAX:   (919) 991-4126    ESN: 294-4126


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

Date: 4 Aug 1997 12:18:44 GMT
From: "Joshua Marotti" <jpm@iti-oh.comNOSPAM>
Subject: Re: Perl for Windows 95
Message-Id: <01bca0d0$80959660$36601ec6@bach>

I haven't seen anything like that...
Many people often ask for an editor that recognizes perl, and the answers
never include an entire developing suite.  If you do find one, please
notify me... I'd like to use it.

-- 
Josh,
Gavin Dragon...
Remove NOSPAM from address...



James Atkin <James.Atkin@Phase.Com> wrote in article
<870692605.28938.0.nnrp-2.c2d93022@news.demon.co.uk>...
> Hi there,
> 
> I am trying to identify a Perl Development Tool for Windows95.
> The sort of thing I am after is the following :
> 
>   * Windows (95) application
>   * On-line Help
>   * Run/Test Script
>   * Plus all the normal tools of a Windows Development Suite.
> 
> Does anyone know if a product such as this is currently available 
> on the market ?
> 
> Thanks for any help,
> 
> James Atkin
> (James.Atkin@Phase.Com)
> 
> 


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

Date: Mon, 04 Aug 1997 14:33:57 GMT
From: yquem@hotmail.com (Suzan)
Subject: perl install (2)
Message-Id: <33e5e843.7534302@news.hol.fr>

Is it possible to install perl5 on a win95 system?



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

Date: Mon, 04 Aug 1997 10:22:51 -0400
From: "James J. Heck" <jheck@merck.com>
Subject: Perl5.00401 on Cray J90??
Message-Id: <33E5E5BB.2781@merck.com>

Has anyone successfully built Perl version 5.00401 on a Cray J90.  The
following is the output from a "uname -a":

	9.2.0.01 pur.2 CRAY J90

I have tried to compiling it but get the following errors:
	CHMOD in segldr failed: Not owner
	 ldr-133 cc: WARNING 
	     Unsatisfied external references have been encountered.
	
	 Unsatisfied external references
	 Entry name      Modules referencing entry 

	 Perl_deprecate  perly$c  op$c
	 Perl_hoistmust  op$c  pp_ctl$c
	 Perl_lex_end    pp_ctl$c
	 Perl_lex_start  perl$c  pp_ctl$c
	 Perl_pmflag     regcomp$c
	 Perl_scan_num   perly$c
	 Perl_start_subparse  perl$c  perly$c  sv$c
	 Perl_yyerror    perly$c  op$c
	 Perl_yylex      perly$c

	 ldr-112 cc: WARNING 
	     Because of previous errors, file 'miniperl' is not 	executable.
	Make: "cc  -L/usr/local/lib -o miniperl miniperlmain.o libperl.a 	-lnsl
-lc -lcrypt ": Error code 1


	Any help with this would be great.  TIA.
James
--------------------
James J. Heck
jheck@acm.org
http://www.bucknell.edu/~jheck


       The contents of this message express only the sender's opinion.
       This message does not necessarily reflect the policy or views of
       my employer, Merck & Co., Inc.  All responsibility for the statements
       made in this Usenet posting resides solely and completely with the
       sender.


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

Date: Mon, 04 Aug 1997 17:40:28 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: Mark Guz <mguz@sol.co.uk>
Subject: Re: Read ahead in file
Message-Id: <33E605FB.1F8442DC@adc.metrica.co.uk>

Mark Guz wrote:

> I have a file that I have opend as a filehandle into an array and am
> stepping through it ia while loop.
>

Why not store it in an array:  my @Whole_File = <FILE>;

> What I would like to do is at one point in the loop is look at the
> next line in the file and compare it with the current line: see pseudo
>
> code
>
> while(<FILE>){
>

Then you could do:  for( $i = 0; $i <= $#Whole_File; $i++ ) {

>         if ( current $array[0] ne next $array[0]){
>

Finally:  if( $Whole_File[$i] ne $Whole_File[$i+1] );

>         do something
>
>         }
>
> }
>
> Anyone help?
>
> Mark Guz
> Scotland On Line
> http://www.scotland.net

This could potentially be memory intensive ( storing the whole file )
and slow ( subscripting is never the fastest of options ).

You could read the next line in the file from within the while() loop,
rather than wait for the next iteration:

while( <FILE> ) {
  print "\nCurrent line is: $_";
  $next_line = <FILE>;
  print "\nNext line is: $next_line";
}

You must remember though that by doing this each iteration of the while
loop will actually be giving you every second line ( because you are
sucking in an extra line in the loop ), so if this is likely to cause a
problem then you will have to code round it.

Hope this gives you some ideas.

Simon



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

Date: 05 Aug 1997 14:19:44 GMT
From: eliot@kern1.dg.com (Topher Eliot)
Subject: Re: Reading from pipes
Message-Id: <ELIOT.97Aug5101944@kern1.dg.com>

   "Ron L. Helms" <helmrl@aur.alcatel.com>:
    >Is there a way to timeout the process (hopefully not SIGS{}) or test the
    >pipe to see if there is data on it before I call $fh->getline?

   Take a look at IO::Select, which seems to be able to do exactly what you
   want.

								     robert
Watch out, though.  The word "select" has another, rather different meaning
in Perl.  Don't get the two meanings mixed up.

Topher Eliot                           Data General Unix Core Development
(919) 248-6371                                        eliot at dg-rtp.dg.com
Obviously, I speak for myself, not for DG.
Visit misc.consumers.house archive at http://www.geocities.com/Heartland/7400
"Do you digest water?"  Peter, age 5


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

Date: Tue, 5 Aug 1997 10:29:17 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: michael james mangino <mangino@cis.ohio-state.edu>
Subject: Re: rounding
Message-Id: <Pine.GSO.3.96.970805102602.29887C-100000@kelly.teleport.com>

On Tue, 5 Aug 1997, michael james mangino wrote:

> Subject: rounding

> Is there any way to find out the length (i.e. number of characters) in a
> scalar variable? 

Yes, and if you look for the word 'length' in the perlfunc manpage you'll
probably find it. You must have missed it when you checked the
documentation before you posted. :-)

> I am writing a cgi-script that averages some data and I
> want to chop off a lot of the trailing characters. 

You may want substr. But if you're trying to do mathematical rounding, you
may want to see the entry about it in the FAQ. 

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

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 5 Aug 1997 17:13:25 GMT
From: Shimpei Yamashita <shimpei@socrates.caltech.edu>
Subject: sleep not mixing well with other signal handlers
Message-Id: <5s7mvl$3np@gap.cco.caltech.edu>

As I understand from perlfunc man pages, sleep should not be used
along with signal handlers for SIGALRM, but there shouldn't be any
problems installing signal handlers for other signals, right?

#! /usr/bin/perl

$SIG{CHLD}=\&hee;

if ( ($child=fork) < 0 ) {
    die "Error: could not fork!\n";
} 
if ( ($child > 0) ) {
    sleep 2;
    kill "STOP", $child;
    print "suspension done\n";
    sleep 10;
    print "sleep done\n";
} else {
    for($i=0;$i<99999999;$i++) {
	print;
    }
}

sub hee {
    if (kill 0, $child) {   
	print "$child suspended\n";
    } else {
	print "$child dead\n";
	wait;
    }
}

Eventually I'd like to write code in which the parent will
periodically suspend the child, do some stuff, and turn the child back
on. Right now the code should just let the child run amok for two
seconds before the child gets suspended, after which the parent
sleeps for 10 seconds and exits (upon which the children should
die also).

The problem is that the second "sleep 10" statement is not being
honored: after two seconds, the program prints

suspension done
<some number> suspended
sleep done

all at once and exits. If I take out the kill statement, it works just
as expected. What gives? I'm pretty new at this signals programming
business, so it is possible that I'm doing something entirely wrong.
I'd appreciate some help.

This is on perl 5.004_01. I've run the script on Linux 2.0.30 (Intel
and PowerPC) and Solaris 2.5.1 (SPARC) with identical results, so
I don't think it's a quirk in a particular OS.

-- 
Shimpei Yamashita                <http://www.patnet.caltech.edu/%7Eshimpei/>


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

Date: Mon, 4 Aug 1997 14:42:51 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: SMTP interface for Perl?
Message-Id: <EEE8vI.8F2@ig.co.uk>

In article comp.lang.perl.misc:<Pine.GSO.3.96.970712170724.3712C-100000@kelly.teleport.com>, Tom Phoenix <rootbeer@teleport.com> writes:
>On 12 Jul 1997, Doug Jacobs wrote:
>
>> I know how to use the SMTP port...but that requires telnet and I'm not
>> quite sure how to get Perl to talk to the port...  Sockets?  
>
>Unless you have your heart set on reinventing a thoroughly-debugged wheel,
>you'll probably want to use one of the modules on CPAN for this. Good
>luck!

using the Net::SMTP modules still requires some significant error checking.

To make your life even easier the Mail::* modules use the MIME::*
and Net::SMTP modules to allow easier composition and delivery of
mail...

It makes email a three liner.

Of course if you want an OO interface to SMTP for VRFY etc.
then use Net::SMTP (libnet*) direct.

>-- 
>Tom Phoenix           http://www.teleport.com/~rootbeer/
>rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
>Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
>

Jacqui
-- 
Jacqui Caren                    Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group               Fax: +44 1483 419 419
140A High Street                Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom



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

Date: Tue, 05 Aug 1997 19:06:08 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: Sorting a password file
Message-Id: <33eb78f0.64217919@netnews.voicenet.com>

paries@advicom.net wrote:
>Hello,
>
>I have a file that is : delimited
>uname:passwd:group:auth
>
>what I am trying to do is order by group and load it into a array of
>arrays fot one particular group or auth.
>
>Thanks for any help or pointers to doc.

Probably really buggy but:

@grpsort = sort { (split /:/,$a)[2] <=> (split /:/,$b)[2] } @unsorted;
--
          - Bob
          http://www.voicenet.com/~bbell
          xxbbell@voicenet.com
          remove x's to reply


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

Date: 5 Aug 1997 06:43:50 GMT
From: preed@psd.k12.co.us (J. Paul Reed)
Subject: Still confused in flock() land
Message-Id: <5s6i36$atk$1@mercury.psd.k12.co.us>

Hey perl people!

I'm still confused about one thing about the flock() function call.

If I do this:

1. Open file
2. Issue flock(FH, LOCK_EX);
3. Continue with the script
4. Close the FH,

what will happen if the exact same script (with a different PID, of
course) tries to do number 2 above if the first process is at step 3.

Will the second script calling for a flock() die, wait until number 4 and
then issue it's own flock(), or what?! 

I never understood this one (pretty important) part.

Thanks for the help!

Later,
Paul
   -------------------------------------------------------------------
   J. Paul Reed                 preed@psd.k12.co.us || paul@619pro.com
   Such a noble creature; a quality we sometimes lack...
   				--Borg Queen; Star Trek: First Contact
   Geek Code and various other frivolities at www.psd.k12.co.us/~preed


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

Date: 5 Aug 1997 07:28:43 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Still confused in flock() land
Message-Id: <5s6knb$it8$1@vixen.cso.uiuc.edu>

J. Paul Reed (preed@psd.k12.co.us) wrote:
: Hey perl people!
: 
: I'm still confused about one thing about the flock() function call.
: 
: If I do this:
: 
: 1. Open file
: 2. Issue flock(FH, LOCK_EX);
: 3. Continue with the script
: 4. Close the FH,
: 
: what will happen if the exact same script (with a different PID, of
: course) tries to do number 2 above if the first process is at step 3.
: 
: Will the second script calling for a flock() die, wait until number 4 and
: then issue it's own flock(), or what?! 

It depends on what you want it to do -- it can do either.

The way that most people want to use it is in a blocking fashion,
i.e. when step 3 is reached the second process waits for the lock
to be released then receives lock and continues.

This is the default -- to get it to die, you will have to
or in the non-blocking LOCK_NB flag.

-- 
Regards,
Mike Heins

This post reflects the
opinion of my employer.


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

Date: Tue, 05 Aug 1997 18:57:27 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: Telnet module in Win32
Message-Id: <33e9777a.63844410@netnews.voicenet.com>

"Sergio Stateri Jr" <serginho@alpha.hydra.com.br> wrote:
>Hi! I installed Telnet module in my Win'95 system, and when I try to run a
>testp Script, it tell me :
>
>C:\DOWN\Testes>perl teste.pl
>Can't locate object method "new" via package "Net::Telnet" at teste.pl line
>8.
>
>What's happening ? In Telnet docs is written that it doesn't need of any
>module...

	Pray tell, what is reported by a "perl -v"?
--
          - Bob
          http://www.voicenet.com/~bbell
          xxbbell@voicenet.com
          remove x's to reply


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

Date: Tue, 5 Aug 1997 08:49:25 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Troy Poppe <troy@sba.miami.edu>
Subject: Re: Text formatting
Message-Id: <Pine.GSO.3.96.970805084359.10855R-100000@kelly.teleport.com>

On Mon, 4 Aug 1997, Troy Poppe wrote:

> Im using the format NAME = ... structure to generate some HTML tags,

If you're using formats to make HTML, you're probably trying too hard. :-)
Formats are used to produce fixed-format reports, but HTML is (mostly)
free-format. You probably want to simply print the output you want,
although you may want to use (s)printf in places.

If you really need to use formats, you can use sprintf to format a
variable with the text you want. But you'll probably be better off without
formats altogether. 

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 4 Aug 1997 14:52:23 GMT
From: Burt lewis@ici.net (Burt Lewis)
Subject: textarea - Script not producing line feeds??
Message-Id: <5s4qb7$lar$1@bashir.ici.net>

In my Perl scripts I have:

print "<TR><TD><textarea Rows=8 Cols=65 name=\"body\" 
wrap=\"physical\"></textarea></TD></TR>\n";

Problem is that I need line feeds after each line that is wrapping and 
I'm not getting any.  The input is coming out as one long string with 
no breaks.

Any ideas or suggestions is appreciated.

Burt Lewis
burt@ici.net



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

Date: Mon, 04 Aug 1997 12:39:20 -0400
From: Chris Gaston <cgaston@lds.com>
Subject: WEB ARCHITECT
Message-Id: <33E605B8.1628FAE4@lds.com>

Logical Design Solutions, a leader in the design and development of
Interactive Business Communications has an immediate full-time opening
in their Morristown, NJ office for a Web Architect.

Job Description:
In this visible role, the ideal candidate will possess experience in
configuration of Internet technologies as part of a multi-tiered
information technology architecture.  Keeping up-to-date with
current technology trends is essential, as is the ability to evaluate
appropriate technology components for development and delivery
environments.  This individual must also have the ability to integrate
application support technologies with preexisting client IT
infrastructure.  Experience with C/C++, Perl, HTML, Java, CGI and
knowledge of Internet protocols and standards is required.
Knowledge of Active X a plus.

Send resume with cover letter and salary requirements or contact:

Technical Recruiter
Logical Design Solutions
Phone: (201) 971-0100
Fax:   (201) 971-0103
email: recruiter@lds.com

For further info:   http://www.lds.com




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

Date: Tue, 5 Aug 1997 08:32:01 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [Q]: Use a Variable to Provide $vars to Split?
Message-Id: <h0a7s5.0f1.ln@localhost>

Holly Henry-Pilkington (hollyhp@nospam.one.net) wrote:

: Would you believe (she said in best Maxwell Smart voice) there's no
: perlref mapage on my server?


Oh. So you pester the system administrator with all of your Perl questions.

They will eventually get the docs installed as self defense ;-)


Guidelines for (as frequent as possible) emails to the sysadmin:

1) Include lots of code

2) Include at least 5 embedded sub-questions

3) Mention that someone on the perl newsgroup said your question could
   be easily answered by referring to the docs that were included with
   the perl distribution, but you cannot find them on the system.

4) Invoke the name of the highest level manager that you think you can
   get away with (or remind them what the 'S' in ISP stands for)

5) Tell them that you must have the answer TODAY!

6) Resubmit the question if it is not answered in one hour.


;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 6 Aug 1997 18:21:46 GMT
From: ifqa242@spice.cc.utexas.edu (Adam Rogoyski)
Subject: Re: How to execute remote Perl script from Perl?
Message-Id: <5safbq$mei$4@geraldo.cc.utexas.edu>

David Estornell (destornell@ProbityITC.com) wrote:
: Is it possible to execute a remote Perl script from Perl? I would like
: to 'capture' the output from the remote Perl script and have it appear
: in-line with the output of the parent script.

: For example, say the URL for remote.pl is
: http://abcdefg.net/cgi-bin/remote.pl. This script executes the following
: command:

:   print 'World';

: Now, say I am running my script parent.pl:

:   print 'Hello ';
:   # What is the real Perl code to do this?
:   execute 'http://abcdefg.net/cgi-bin/remote.pl';
:   exit;

: Is there a perl command (or group of commands) that I could use in
: parent.pl to replace the line beginning with 'execute' so that the final
: output of parent.pl will be 'Hello World'?

   I think the do() command is what you want
   do "remote.pl";


--
           __/\__.           [-Temperance-]              .__)\__
      !    \ oO /         . :[Adam Rogoyski]: .           \ oO /    !
      .    /_\/_\       .  :[ apoc@laker.net ]:  .        /_\/_\    . 
             \/    .  :[ http://www.laker.net/apoc ]:  .    \/


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

Date: 5 Aug 1997 21:22:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Mail::Send question
Message-Id: <5s85j3$nvg@fridge-nf0.shore.net>

Garry Optland (garry@pp.nsw.gov.au) wrote:
: Does anyone have an example of how add headers like "Content-Type:"
: using Mail::Send?

I think that you can fool with the %headers hash and/or tell
Mail::Send to use sendmail instead of mail.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 5 Aug 1997 18:12:41 -0400
From: vicka@zax.whoville.leftbank.com (Vicka Corey)
Subject: problems building under sinix?
Message-Id: <5s88gp$nnf@zax.whoville.leftbank.com>
Keywords: perl sinix pyramid r4000


i've been trying to build perl (first 5.003, then 5.004_01 with the
same results) on a SINIX-N 5.43 r4000 pyramid box.  both under sh
and csh, i get the same results: configure runs ok (near as i can
tell, anyway), but then when i go to run make, i get bunches of
errors: 

 ./makedepend: /dev/null: cannot execute
 ./makedepend: -f: not found
Usage: rm [-firR] file ...
cp: Incorrect usage
cp: Usage: cp [-f] [-i] [-p] f1 f2
                      cp [-f] [-i] [-p] f1 ... fn d1
                      cp [-f] [-i] [-p] [-r | -R] [-e extent_op] d1 d2
 ./makedepend: test: argument expected

 ...and the whole thing keels over.

near as i can tell, this happens because assorted variables such
as $cat aren't getting interpreted properly in files such as 
makedepend.  there is a line "cat='cat'" in config.sh, and replacing
"$cat" with "cat" in makedepend gets me past at least that error,
but the twain do not seem to meet of their own accord....? 

any clues gratefully accepted....

--vicka corey					vicka@leftbank.com
         "more fun than a barrel of monkey wrenches!"


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

Date: 6 Aug 1997 10:23:25 GMT
From: Heinrich.Mislik@univie.ac.at (Heinrich Mislik)
Subject: Range operator question
Message-Id: <5s9jat$1ock@www.univie.ac.at>

Hello,

I have a problem understanding the range operator. I want a range operator 
always starting with true and ending on some condition. Here is some 
demonstrationcode (tested with perl, version 5.004_01):

#!/bin/perl -w

$x = "a";

# Works as supposed as long as the loop's startvalue doesn't change 
# (Prints 1234)
foreach(1 .. 10) {
   print if $_ == 1 .. $_ == 4;
}

print "\n------------\n";

# ???? (Prints 12345678910)
foreach(1 .. 10) {
   print if $x .. $_ == 4;
}

print "\n------------\n";

# ???? (Prints nothing)
foreach(1 .. 10) {
   print if "a" .. $_ == 4;
}

Any help ?

Thanks
-- 
__________________________________________________________________________
Heinrich Mislik                     Tel: +43 1 40 65 822 455 direct line
Vienna University Computer Center   Fax: +43 1 40 65 822 170
Universitaetsstrasse 7
A-1010 Vienna,  Austria/Europe      Email: Heinrich.Mislik@univie.ac.at
__________________________________________________________________________



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

Date: 5 Aug 1997 15:29:10 -0700
From: trs@azstarnet.com (Tim  Smith)
Subject: Re: Running Perl under Windows - No NFS
Message-Id: <5s89fm$62n@web.azstarnet.com>

In article <t47bZGAps05zEw72@connected.demon.co.uk>,
Jerry Pank  <jerryp.usenet@SPAMconnected.demon.co.uk> wrote:
>Whilst I don't expect the cgi stuff to run I guess there must be some
>form of emulator about.

perl -c scriptname.pl can check syntax stuff quite easily.  I don't
know if you can run Lynx on a Win95 PC, but if you can it can be set
up to run CGI's directly, no need for a web server.

Tim



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

Date: 6 Aug 1997 13:27:16 -0500
From: kuehne@ccwf.cc.utexas.edu (kuehne)
Subject: Sockets and SIGCHLD
Message-Id: <5safm4$qfd@piglet.cc.utexas.edu>

I've run into some socket weirdness that might be of interest to those
who are using PERLIPC documentation as a basis for writing socket servers.
Back in perl 5.002 beta1g, the PERLIPC page gives a nice example of a
simple socket server. The heart of this script is

for ( $waitedpid = 0; ($paddr = accept(CLIENT,SERVER)) || $waitedpid;
      $waitedpid = 0, close CLIENT)
{
      next if $waitedpid;
      ...
}

Why the "next"? Because catching a SIGCHLD would cause a blocking
accept() to produce an immediate error-return, at least on SunOS4.1.1.
Checking $waitedpid got around this.

Now, in perl5.004 under IRIX 6.1 or HP-UX 10.20, this script is busted
because catching SIGCHLD doesn't blast you out of a blocking accept().
After handling the SIGCHLD you go back into the accept(). The result is,
this script only works every other client-connection because the "next"
sees a non-zero $waitedpid every other connection.

So, for perl5.003 and higher, it seems that handling SIGCHLD doesn't
blast you out of accept(): if you're waiting on an accept() and catch
a SIGCHLD, you handle SIGCHLD, and return quietly to the accept().
The new PERLIPC server example fixes this by also checking $paddr, while
retaining all the old checking of $waitedpid.  That way, the script will
work in 5.002 and 5.004. If you're using 5.004, you don't need the "next"
and all the checking and setting of $waitedpid.

IS this little change to the interaction between accept() and SIGCHLD
documented anywhere in more detail?

-john kuehne


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

Date: Tue, 05 Aug 1997 15:21:46 -0400
From: Robert Luscombe <ralst37+@pitt.edu>
Subject: Word Wrap and Novell Perl5
Message-Id: <33E77D4A.5073@instadv.alumni.pitt.edu>

I am writing a CGI script for our Novell web server v3.1, and I need
to wrap the text of a string at 65 columns.  Text::Wrap does
exactly what I need, but the Perl5.nlm that comes with this
web server does not have any of the standard libraries.

Does ANYONE know how I can use modules with Novell Perl?

If not, what would the best way to wrap the text in a string be?
I am not simply concerned with formatted output (I could use format
for that), but I need the actual string to be divided into appropriate
length lines without breaking in the middle of words.

Thanks much,
--bob


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

Date: 6 Aug 1997 20:48:25 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: [Q] Converter between ELM filter-rules file to procmailrc file?
Message-Id: <eli$9708061645@qz.little-neck.ny.us>

Martin Ramsch <ramsch@forwiss.uni-passau.de> wrote:
> A most probably incomplete first version is at:
>   http://www.forwiss.uni-passau.de/~ramsch/Software/elmfilter2procmail.txt
>   (to view the source)
>   http://www.forwiss.uni-passau.de/~ramsch/Software/elmfilter2procmail.perl
>   (to download)
> 
> I'd love to get some feedback on it to be able to improve the script.

Here is a patch to fix some obvious problems with it (sent seperately
by email to Martin).

Elijah
------
--- elmfilter2procmail.original	Wed Aug  6 09:21:39 1997
+++ elmfilter2procmail.pl	Wed Aug  6 09:49:35 1997
@@ -98,10 +98,15 @@
 
                 unless ($linesdefined) {
                     $linesdefined = 1;
+                    # Size conditions would probably better handled in
+                    # strictly scoring recipes, but that would be more
+                    # difficult to code.
                     print "\n# Calculate length of mail body in lines\n";
-                    print ":0Bcw\n";
-                    print '* 1^1 ^.*$', "\n"; # '
-                    print '{ LINES = $= }', "\n";
+                    print "\n# Assignment out of the braces so zero works.\n";
+                    print ":0\n";
+                    print '* B ?? 1^1 ^.*$', "\n"; # '
+                    print "{ }\n";
+                    print 'LINES = $=', "\n";
                     print "\n";
                 }
             }
@@ -109,8 +114,20 @@
                 # It's a header field condition!
                 ($header, $op, $value) = ($1, $2, $3);
 
-                $header = "^\u${header}:[ \t]*";
+                # "Sender" is not a useful header for this concept.
+                $header =~ s/^sender$/from/i;
 
+                # For "To" use procmail's special ^TO token.
+                if ( $header =~ /^to$/i ) {
+
+                    $header = "^TO";
+
+                } else {
+
+                    $header = "^\u${header}:[ \t]*";
+
+                }
+
                 if ($op eq '!=') {
                     $op = '='; $not = ! $not;
                 }
@@ -131,7 +148,7 @@
                     # Plain string comparison.
 
                     # Escape all pattern meta characters in $value.
-                    $value =~ s/([][$^.?+*()|])/\\$1/g;
+                    $value =~ s/([][\$^.?+*()|])/\\$1/g;
 
                     $procCondition .= $header . '.*' . $value;
                 }



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

Date: Wed, 06 Aug 1997 17:14:22 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Can filehandles be stored in a hash?
Message-Id: <33e8b04d.32691195@news.tornado.be>

>Michael Borowiec (mikebo@MCS.COM) wrote:

> I have a script which will open many hundreds out output files.
> I would like to be able to do an open, then store the filehandle
> in a hash, indexed by a component of the filename, like so:
>
>> unless (defined($openhash{$filename})) {
>> 	open($handle, "> $dbdir/$filename") ||
>> 		die("Cannot open $dbdir/$filename: $!");
>> 	$openhash{$filename} = $handle;
>> }

> I tried using scalar() around the de-referenced filehandle, but I get
> the same error. Suggestions?

>> print(scalar($openhash{$filename}) "some stuff\n");
> Argh!

This last thing could be written as

	select ($openhash{$filename});
	print "some stuff\n";	

In this case the handle may be just a string.

HTH,
Bart.


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

Date: Wed, 6 Aug 1997 19:45:14 GMT
From: Ulf Knoblich <knoblich@scr.siemens.com>
Subject: Commandline arguments
Message-Id: <33E8D44A.857@scr.siemens.com>

Hello

I'm just doing some Perl programming and have the task to compare two
files and write the output to another file. the problem is that the
script may get wildcards in the commandline like

dif *.d *.d2

(that means it should compare all files with the suffix .d to the
equivalent ones with the suffix .d2)

how can i parse this?
when i do it as one might think, i get as arguments teh first two
matching files for the first expression.

Does anyone know a solution?

Thanks in advance for taking the time to read my posting :)

Ulf Knoblich


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

Date: Tue, 05 Aug 1997 23:30:34 -0400
From: Doug MacEachern <dougm@osf.org>
To: "Dr. Tilmann Hdberle" <Tilmann.Haeberle@sap-ag.de>
Subject: Re: Embedding perl 5.004_01 into a Visual Basic program
Message-Id: <33E7EFDA.FDD@osf.org>

Dr. Tilmann Hdberle wrote:
> 
> I tried to call the perl.dll from 32 bit Visual Basic, following the
> instructions in "perlembed" similar to doing it from C.
> There are some obstacles in doing that. Some of them I could solve, but I'm
> stuck with the last one. Maybe someone having a clearer insight into the
> perl win32 source code than me can help me out.
> 
> Embedding is for me more favourable than starting perl in a separate
> process since I would like to call some perl functions from VB after
> loading my script.
> 
> Since I have encountered several posts in the usenet asking for that kind
> of embedding, we should make it work. I'd like to contribute, but currently
> I need some help.[...]
> Huh, that was a long post. But I'm looking forward to your help.

Yes, a long post, here's the short answer :-)  Wait for perl5.004_02.  It 
fixes the pIOSubSystem initialization problem, along with other fixes for 
loading Perl.dll from some_other.dll.  If you're not familar with mod_perl 
(http://perl.apache.org/), the dll version works like a charm with 
5.004_02-tobe, it had some of the same problems you saw with 
5.004_01.  5.004_02 should be available RSN.  

-Doug


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

Date: Wed, 6 Aug 1997 13:17:25 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Clark Dorman <clark@s3i.com>
Subject: Re: File::Find and maxdepth?
Message-Id: <Pine.GSO.3.96.970806130702.4651C-100000@kelly.teleport.com>

On 6 Aug 1997, Clark Dorman wrote:

> I cannot find a man page for find2perl (though it does exist for s2p and
> a2p), I cannot do a "perldoc find2perl", there is not a readme in the
> x2p directory where I found find2perl, and find2perl is not even
> mentioned in the FAQ. 

You're right; somebody should document find2perl, and what options it uses
which are noticeably different than the corresponding find command. If
_you_ are that person, write to <perlbug@perl.com> and volunteer your
services for the purpose. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 6 Aug 1997 16:31:46 GMT
From: FREAKSHO@mail.carnivore.net (FREAKSHO)
Subject: Getting Missing File Title return when executing script..
Message-Id: <5sa8ti$7jb$1@yakuza.fc.net>

Could someone give me some insight why my script is returning a Missing File 
title when executing a script?
I have other scripts running within the same cgi-bin...
I'm using NT 4.0 with IIS
Thanks in advance.


-- 
Nuroagony
freaksho@carnivore.net
"Hey everybody,  there's a shitcloud comin' run for your lives"



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

Date: 06 Aug 1997 15:30:53 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: MS-DOS port of the Perl programming language
Message-Id: <oee3eonze6a.fsf@alpha.hut.fi>


Again, the same claim ("latest MS-DOS port") by the same people.
Again, the same false claim.

Ah well, I better tell them they are not telling the truth.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Wed, 6 Aug 1997 12:59:37 -0700
From: Qiang Dai <dq@leland.Stanford.EDU>
Subject: PID
Message-Id: <Pine.GSO.3.96.970806125652.20561A-100000@epic12.Stanford.EDU>

How do I get the process ID for a process created by
the open statement like this?

open(FIN, './myprog |');

Is it possible to communicate with the process created
this way?

Thanks. John



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

Date: Wed, 6 Aug 1997 12:35:12 +0800
From: "Justin Brown" <zlzxkv@echidna.stu.cowan.edu.au>
Subject: Re: Super Newbie Question
Message-Id: <5s8v6a$9lm$1@brumby.cowan.edu.au>

 Have you tried specifying the file size, such as ,30000 for the number of
bytes.  Yo u may never use this much space, but if you specify the size at
least Perl can create a memory environment for it!

Cheers.

JB

Darin Burleigh wrote in article <33E10689.29F7@hackberry.chem.niu.edu>...

>Lars Luthman wrote:
>>
>> I've just started using macPerl, and I have a problem:
>>
>> when I try to open script files larger than a few K, a dialog box pops
>> up:"This file is too large to be edited with MacPerl."
>> I can't even run the script! There is probably a very simple solution to
>> this, but I haven't been able to find it.
>>
>> ll
>
>I'd guess its a Mac problem, not a Perl problem.
>maybe it needs more memory, or you have to turn
>off some stuff.
>
>--
>==========================================================
> - darin
>burleigh@hackberry.chem.niu.edu
>\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
> '2 kinds of green, look out!' - dieter rot




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

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

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