[7225] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 850 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 12 01:07:20 1997

Date: Mon, 11 Aug 97 22:00:26 -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           Mon, 11 Aug 1997     Volume: 8 Number: 850

Today's topics:
     Re: ?Portable file name separator? (Andrew M. Langmead)
     Re: [BUG?] Perl 5.004_1 fails @ perl -nea 'print' (Danny Aldham)
     Re: Best way to connect to PostgreSQL 6.1.1 (Danny Aldham)
     Re: Bidirectional Communication, Comm.pl (Eric Arnold)
     Re: Buy any Perl book in print (Tad McClellan)
     Re: changes between unix and NT (Danny Aldham)
     Re: changing passwd with perl (UNIX) <cphillip@kerr.phys.utas.edu.au>
     Re: changing passwd with perl (UNIX) (Danny Aldham)
     Com Port Module <jmscott@ainet.com>
     DLL problem with perl installation (Kevin)
     HELP NEEDED (David Torre)
     Re: Help with Security <rootbeer@teleport.com>
     Hex in ascii to ascii: what module ? (Michael Kagalenko)
     Re: Hex in ascii to ascii: what module ? <rootbeer@teleport.com>
     Re: How do I get started with win95? (Danny Aldham)
     How to ID File Path under Windows NT? <VikR@aol.com>
     Re: How to use uninstalled packages? (Faust Gertz)
     Re: Is there a perl IDE? (Chris Adams)
     Re: Is there a perl IDE? (Danny Aldham)
     Pattern matching problem <cpt@cvd.com.tw>
     Re: Pattern matching problem <rootbeer@teleport.com>
     Re: Perl and Windows NT (Danny Aldham)
     Re: perl libraries (Danny Aldham)
     Re: Perl mail interface <friedman@uci.edu>
     Re: Sharing Variables <rootbeer@teleport.com>
     Re: sleep for a few hundrad milli seconds (Jim Trocki)
     Re: Sorting this file is killing me <rootbeer@teleport.com>
     Where is the file data after open? (Scott Card)
     Re: Where is the file data after open? <rootbeer@teleport.com>
     Re: Where is the file data after open? (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 11 Aug 1997 23:08:56 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: ?Portable file name separator?
Message-Id: <EEruyw.DJo@world.std.com>

Bill Courington <billc@forWord.com> writes:

>Is there a portable way to specify a file name separator 
>(e.g., /, \, :)?  

>Alternatively, does anyone know what $OSNAME returns for 
>NT and W95?  (I know about solaris and MacOS.)  If I know 
>the main OSNAME values, I can create a hash of OSNAME-separator.  

You might want to take a look at the File::Basename module that will
parse a file specification into its components. It comes with the
standard perl distribution.

Even if it doesn't do what you want, you might be able to crib some of
the actions fileparse_set_fstype() function does based on various
operating systems.

-- 
Andrew Langmead


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

Date: 11 Aug 1997 21:14:02 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: [BUG?] Perl 5.004_1 fails @ perl -nea 'print'
Message-Id: <5sonua$q25$1@lennon.postino.com>

Nicholas J. Leon (nicholas@neko.binary9.net) wrote:
: I recently installed the new Perl 5.004_1. When I started playing with
: it, I found this (potential) bug.

: The following log illustrates the issue, I believe:
: > ls | ~/perl/bin/perl -nea 'print'
: Can't open print: No such file or directory

Hmmm. Fails on my machine too, but if I use perl -ane  it works.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 11 Aug 1997 21:18:40 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Best way to connect to PostgreSQL 6.1.1
Message-Id: <5soo70$q6j$1@lennon.postino.com>

Andrzej =?US-ASCII?Q?Bagi=F1ski?= (abagi@coral.idk.com.pl) wrote:
: What is the best way to work with PostgreSQL database using Perl?

I think the best way is to use the Postgress Modules, which are
availiable from any CPAN site. They work great on Linux RH4.1 .

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 12 Aug 97 03:23:46 GMT
From: eric.arnold@sun.com (Eric Arnold)
Subject: Re: Bidirectional Communication, Comm.pl
Message-Id: <ERIC.97Aug12032346@m-e-ir1.sun.com>


I just uploaded version 1.7 to CPAN (misc. minor changes for platform
support, mostly).  However, you didn't include the details of your
problem, such as what platform/environment you are using, what you
tried, and how exactly it failed.

-Eric


In article <5smmdo$d2i$1@esmeralda.zdv.Uni-Mainz.DE>
	knappen@iphcip1.Physik.Uni-Mainz.DE (J%org Knappen) writes:

>In an application I have to do bidirectional communication to a shell
>programm. Unfortunately I cannot apply the usual trick 
>`echo $arguments > command|`
>
>since the arguments must not be visible by the ps command (they contain 
>unencrypted passwords).
>
>So I tried the Comm.pl module as described on page 345 of the blue camel book.
>However, on the Stuttgart CPAN mirror I found Comm.pl_1.5beta of 1995; and
>this does not work as the example given in the book. Is there a newer version
>of Comm.pl available which works as described in the book?
>
>--J"org Knappen


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

Date: Mon, 11 Aug 1997 21:59:21 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Buy any Perl book in print
Message-Id: <9ijos5.pri.ln@localhost>

Marjorie Roswell (roswell@umbc.edu) wrote:
: On Mon, 11 Aug 1997 22:30:24 GMT, roswell@umbc.edu (Marjorie Roswell)
: wrote:

: >"Yes, TIMTOWTDI, but why present that one? "

: Okay, I figured it out: There Is More Than One Way To Do It!


It is covered in the very first part of the Perl FAQ under:

   "Is Perl difficult to learn?"




How about:


   WYBMABIITY  ???


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


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

Date: 11 Aug 1997 21:25:16 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: changes between unix and NT
Message-Id: <5soojc$q71$1@lennon.postino.com>

Jeremy D. Zawodny (zawodny@hou.moc.com) wrote:
: [cc'd to original author]
: Oh, let's see. First, PLEASE TURN OFF HTML in your news client. At
: least I'm using one of the more tolerant newsreaders, but most folks
: aren't.

This is worth repeating. Turn of your HTML.

: Some basic rules of thumb:
: - fork() isn't implemented.

If you use a version of perl5 made with Cynus' gnuwin32 gcc dev kit,
fork IS supported.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Tue, 12 Aug 1997 12:14:33 +1000
From: Chris Phillips <cphillip@kerr.phys.utas.edu.au>
To: stoffer@netcetera.dk, ifqa242@spice.cc.utexas.edu
Subject: Re: changing passwd with perl (UNIX)
Message-Id: <Pine.GSO.3.94.970812120836.18261B-100000@kerr.phys.utas.edu.au>

On 11 Aug 1997, Adam Rogoyski wrote:
> Gustav Kristoffer Ek (stoffer@netcetera.dk) wrote:
> : What is the easiest way to change a password from within a perl script? I
> : have looked at setpwent() but I dont know if its the right thing to do.

>    You could always open a pipe to passwd like this:
>    open OUTPUT_PIPE, "|/usr/bin/passwd";
>    print OUTPUT_PIPE "[oldpass]\n";
>    print OUTPUT_PIPE "[newpass]\n";
>    print OUTPT_PIPE "[newpass]\n";
> 

This WILL not work (at least on Solaris and Linux). passwd does
not read from STDIN on these machines. You would need to play
around with pty's I believe.

Try 
	> echo fred | passwd 
from the command line. "fred" is ignored

Cheers
Chris Phillips



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

Date: 11 Aug 1997 21:29:16 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: changing passwd with perl (UNIX)
Message-Id: <5sooqs$qb6$1@lennon.postino.com>

Adam Rogoyski (ifqa242@spice.cc.utexas.edu) wrote:
: Gustav Kristoffer Ek (stoffer@netcetera.dk) wrote:
: : What is the easiest way to change a password from within a perl script? I
: : have looked at setpwent() but I dont know if its the right thing to do.
: : I would really appreciate an example.

:    You could always open a pipe to passwd like this:
:    open OUTPUT_PIPE, "|/usr/bin/passwd";
:    print OUTPUT_PIPE "[oldpass]\n";
:    print OUTPUT_PIPE "[newpass]\n";
:    print OUTPT_PIPE "[newpass]\n";

This wont work. You are better off to generate your new password with
crypt and write it straight to the password or shadow file. But be careful. :-)
 
--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Mon, 11 Aug 1997 17:59:56 -0700
From: "Joseph M. Scott" <jmscott@ainet.com>
Subject: Com Port Module
Message-Id: <33EFB58C.CDB@ainet.com>

I thought that I recalled seeing a module for talking to com ports. 
I've got the perl/win32 working fine, but I'm not familiar with com port
communications.  If anyone knows of such a module, or can point me in
the right direction please drop me a note.

	Thanks...

	-=joseph
		jmscott@ainet.com=-

PS - I did check out CPAN, but nothing seemed to fit com port
communications.


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

Date: Tue, 12 Aug 1997 01:28:48 GMT
From: question@nospamwebnet.ie (Kevin)
Subject: DLL problem with perl installation
Message-Id: <33efb028.63161089@news.iol.ie>

Hi,

	I've just installed pw32i307 on NT 4 (IIS 2.0) it seems to
have installed properly as i can run a perl script from the command
line.  But when I try and run it from a web browser I get

Http/1.0 500 server error (a dynamic link library (dll) initialization
routine failed)

I've looked in the registery and there is a entry for a pl extension
going to the correct path c:\perl5\bin\perl.exe.  I've also mapped a
virtual directory in IIS to c:\perl5\bin\ but when I try to access
this I get the above error.

I've also tried installing piisi307 but this has not helped.

Any Ideas?

Regards,

Kevin




Limerick City & County Web Page  -  http://www.webnet.ie/limerick/
Clare Against Boundary Extension -  http://www.webnet.ie/cabe/
Siobhan O'Brien                  -  http://www.webnet.ie/siobhan/
Dublin Simon Community		 -  http://www.iol.ie/~dubsimon/


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

Date: Mon, 11 Aug 1997 23:58:18 GMT
From: rrenaud@uniserve.com (David Torre)
Subject: HELP NEEDED
Message-Id: <33ef9f42.31226839@news2.uniserve.com>

L'ASSOCIATION MONDIALE DES ENTREPRENEURS (WORLD WIDE ENTREPRENEURS
ASSOCIATION) would like to borrow assets such as Treasury Bills,
stocks, bonds, etc., as enhancements for our financial statement.

The assets would not be traded, sold, pledged, or in any way
encumbered.

If you could help us, please send an e-mail to "amde@citenet.net" with
some details.  Also include a phone number and time you could be
reached if you don't mind.

Thank you,

L'ASSOCIATION MONDIALE DES ENTREPRENEURS


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

Date: Mon, 11 Aug 1997 18:18:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Richard Allen Parks <rapark1@pop.uky.edu>
Subject: Re: Help with Security
Message-Id: <Pine.GSO.3.96.970811181511.1727B-100000@julie.teleport.com>

On 11 Aug 1997, Richard Allen Parks wrote:

Newsgroup: comp.lang.perl

If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.

> Can anyone please tell me whether or not perl will let me read a file
> from another server?  

If the server is willing to send it, Perl is able to read it!

> Does anyone know how to get perl to readin html?  

It's not hard. Just type some HTML when Perl is expecting input. :-)  But
you probably want the LWP module, which lets Perl request files from
webservers. You can get LWP from CPAN.

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

> I am interested in just writing a script as an exercise to check html
> syntax. 

Do you mean that you want to write an HTML syntax checker? That's a pretty
challenging exercise. :-)

> Having the user input a url is easy, but reading the html at that url is
> beyond me. 

Not after you see the manpage for LWP. :-)  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: 11 Aug 1997 22:03:59 -0400
From: mkagalen@lynx.dac.neu.edu (Michael Kagalenko)
Subject: Hex in ascii to ascii: what module ?
Message-Id: <5sogaf$4j4@lynx.dac.neu.edu>

Is there standard module that would convert hex codes (in ascii form,
not binary)
into their ascii equivalent ?




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

Date: Mon, 11 Aug 1997 20:22:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Kagalenko <mkagalen@lynx.dac.neu.edu>
Subject: Re: Hex in ascii to ascii: what module ?
Message-Id: <Pine.GSO.3.96.970811201800.3816B-100000@julie.teleport.com>

On 11 Aug 1997, Michael Kagalenko wrote:

> Is there standard module that would convert hex codes (in ascii form,
> not binary)  into their ascii equivalent ? 

Could you perhaps want CGI.pm, which will decode URL-encoded strings like
'%34+%24'? (And it does lots more than that. If you're writing a CGI
script, you should either use CGI.pm or some of the related modules.) 

CGI.pm comes with Perl 5.004, or you can get it through CPAN. 

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

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: 11 Aug 1997 21:22:31 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: How do I get started with win95?
Message-Id: <5sooe7$q6o$1@lennon.postino.com>

SJK (knetsch@golden.net.no.spam) wrote:
: Help is at hand my poor fellow lost soul.  Do not despair!
: Actually, I went through the same problem when I was looking for the Win32 build
: of Perl.  After exhaustively searching through the web for over an hour using
: the search engines, I found the web site.  Then someone conveniently mentioned
: the web site address the next day in this newsgroup in one of their posts.
: Ahhhh, such is life.

: Find the actual compiled version for Windows 95 on Intel based machines at
: http://www.perl.hip.com/

This port is no longer supported. In fact, I don't think they even 
have it on their server anymore. Check at www.activeware.com for the
latest binary, or at ftp.cdrom.com/pub/perl/CPAN/ports/nt/Gurusamy_Sarathy
for a binary that includes MakeMaker & a bunch of modules. Better choice.
Or, you can roll-your-own perl5.04_01 with Cyngus' gnuwin32 gcc dev kit.


--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Mon, 11 Aug 1997 17:19:09 -0800
From: Vik Rubenfeld <VikR@aol.com>
Subject: How to ID File Path under Windows NT?
Message-Id: <33EFBA0D.D3C9BDF4@aol.com>

My PERL script needs to know the path name to a given folder on the web site
it is in. Under Unix, you can Telnet in and use the pwd command to find out a
path name:

		shell8: {5} cd secure
		shell8: {6} pwd
		/webadmin/home/web1/test/public_html/secure

How do you find out a path name like this if the server is running under
Windows NT?

Thanks very much in advance to all for any info.

- Vik


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

Date: Tue, 12 Aug 1997 00:02:01 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: How to use uninstalled packages?
Message-Id: <33f09f8a.12817407@news.wwa.com>

On 11 Aug 1997 21:25:19 GMT, rootbeer@-snip-enteract.com (Rootbeer)
wrote:

>There are a few packages that I'd like to use, but have not been
>installed at my site.  Would anyone be willing to give me a few pointers
>towards how to use them myself, given that I have the *.pm file?

Need more data!  Most of the time, the documentation which comes with
the module answers this kind of question.  If you couldn't find it in
the documentation, you should have tried looking in the perlfaq.
Here, I'll quote it for you.

>How do I install a CPAN module? 
>
>The easiest way is to have the CPAN module do it for you. This module comes with perl version 5.004 and later. To manually install
>the CPAN module, or any well-behaved CPAN module for that matter, follow these steps: 
>
>   1.Unpack the source into a temporary area. 
>
>   2.    perl Makefile.PL
>
>   3.    make
>
>   4.    make test
>
>   5.    make install
>
>If your version of perl is compiled without dynamic loading, then you just need to replace step 3 (make) with make perl and you
>will get a new perl binary with your extension linked in. 

If the problem is that you don't have suffient privileges to install
the modules in the aformentioned way, another possible answer is 
to ask your system administrator to install the modules.  If that
doesn't work, save the module and try typing:

     use lib '/path/in/which/the/module/is/saved';
     use module;

or, if you are using pre-5.002 perl (in which case you should ask your
system administrator to install 5.004) or NT perl:

     BEGIN {
          unshift (@INC, '/path/in/which/the/module/is/saved');
     }
     use module;


HTH

Faust Gertz
Philosopher at Large


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

Date: 12 Aug 1997 00:11:30 GMT
From: cadams@ro.com (Chris Adams)
Subject: Re: Is there a perl IDE?
Message-Id: <5so9ni$ple$1@news.ro.com>

John Dallman <jgd@cix.compulink.co.uk> wrote:
>Read the license agreement. You can't sell perl for money.

But a perl IDE wouldn't be _just_ perl.  The license allows you to sell
a program with perl embedded in it for whatever you want.  An IDE could
be written that has perl embedded it (that would be the best way to do
it if you write the IDE in another language, since new versions of perl
could be integrated easier).  If you write the IDE in perl, then it is
your code and you can sell it too.
-- 
Chris Adams - cadams@ro.com
System Administrator - Renaissance Internet Services
I don't speak for anybody but myself - that's enough trouble.


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

Date: 11 Aug 1997 21:03:27 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Is there a perl IDE?
Message-Id: <5sonaf$pr7$1@lennon.postino.com>

John Dallman (jgd@cix.compulink.co.uk) wrote:

: Read the license agreement. You can't sell perl for money.

I hope this is wrong. Certainly not my take on the license agreement.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 12 Aug 1997 01:50:36 GMT
From: "CPT" <cpt@cvd.com.tw>
Subject: Pattern matching problem
Message-Id: <01bca6c3$2c052720$1003010a@stfa116.cvd.com.tw>

Hi ,
I have encountered a pattern matching problem like below.
I have two file.One is a department file.One is a mail log file.
I want to calculate mail usage.

Department file:
mgr
mgrsec
mis .....

Mail log file:
sma001  .........  mis1851805nick  102 203  1022 7 Jul 97

My Program:
open (DEPT,"dept");
open (LOG,"maillog");

 while (<DEPT>) {
     $send_total_letter=0;
     $send_total_bytes=0;
     chomp $_;
     $dept=$_;
   
     while (<LOG>) {
         if ($_ =~ /$dept/) {
               print "OK","\n";
             } 
                
Result:
It won't print any OK.But I change $dept to mis .It works fine.
Could you tell me what's wrong with my code.
Thanks!

-Nick  


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

Date: Mon, 11 Aug 1997 20:17:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: CPT <cpt@cvd.com.tw>
Subject: Re: Pattern matching problem
Message-Id: <Pine.GSO.3.96.970811200705.3816A-100000@julie.teleport.com>

On 12 Aug 1997, CPT wrote:

> open (DEPT,"dept");
> open (LOG,"maillog");

It's important to check that open succeeded. It's extra important when
your script isn't doing that you want it to do!

>  while (<DEPT>) {
>      $send_total_letter=0;
>      $send_total_bytes=0;

Why are you setting those to zero inside the loop? (Putting good comments
into your code can help when trying to find bugs.) 

>      chomp $_;
>      $dept=$_;
>    
>      while (<LOG>) {

This is unusual (to say the least) to start reading the second file while
you're still in the middle of the first one. It's probably not what you
want. Maybe you want to read the first one into an array?

>          if ($_ =~ /$dept/) {

Did you mean to use the data read from the first file as a regular
expression? Your code would be safer if you use index, if that will do
what you need. (A badly-formed regular expression could crash your
program. And this is slower and less efficient than using index.) But
since I don't know what you're trying to do, I can't say exactly what you
should do. 

>                print "OK","\n";
>              } 

Where's the rest of the code? You've opened two loops which haven't
completed. And unless you do something interesting in the part you haven't
shown us, you're going to loop through the entire log file before you go
on to the second line of the department file. Then you'll be at
end-of-file and evaluate <LOG> again. That's not what you want. 

> Result:
> It won't print any OK.

That's what I would have expected. :-)

> Could you tell me what's wrong with my code.

Nothing, if you want it to do what it's doing. :-)  But I hope that my
suggestions will help you to re-do the logic of the program, so that it
will be closer to doing what you want. Good luck!

-- 
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: 11 Aug 1997 21:07:08 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Perl and Windows NT
Message-Id: <5sonhc$psb$1@lennon.postino.com>

Barry Andre (bandre@xs4all.nl) wrote:
: I want to implement CGI-Scripts for receiving forms in webpages on my
: webserver.
: But I do not know how to do this.

Buy yourself a book like "Learning Perl", install perl5 , and
away you go.

: How must I install Perl on my Windows NT 4.0 Server ?
: Where can I get ready to use CGI-scripts for my server ?

Yes, install perl and then enable script mapping.  Do a web search
for scripts. Look for Matt's stuff, lots there to get you started.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 11 Aug 1997 20:42:04 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: perl libraries
Message-Id: <5som2c$pid$1@lennon.postino.com>

Suzan (yquem@hotmail.com) wrote:
: I am novice with perl. I got a cgi script and wanted to test it on my
: system. Nothing happens. I presume I have not the required libraries.
: How is it possible to get them?

You don't say what libraries you are looking for. Try the command:
#perl -V 
This will tell you tons, including where your perl expects to find 
libraries. The end of the output should be something like:

Characteristics of this binary (from libperl): 
  Built under sco_sv
  Compiled at Jul  9 1997 22:01:28
  @INC:
    /usr/local/lib/perl5/i386-sco_sv/5.00401
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/i386-sco_sv
    /usr/local/lib/perl5/site_perl
    .


--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: 12 Aug 1997 00:26:56 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Perl mail interface
Message-Id: <5soakg$fjr@news.service.uci.edu>

In article <33ef7f17.0@oit.umass.edu>,
RD Web Design <rdweb@wilde.oit.umass.edu> wrote:
<email.  I can handle all the sending stuff, but the receiving part has me 
<perplexed.  I don't want to have to have to create new unix accounts for 
<all the users, just to get a mail spool for them.  Could they go through 
<a single account, and be filtered efficiently?  I am more worried about 

Investigate procmail.  You could use it to filter incoming mail into
individual folders, one per user.  

HTH,
Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Mon, 11 Aug 1997 18:31:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Arielle Sumits <arielle@mit.edu>
Subject: Re: Sharing Variables
Message-Id: <Pine.GSO.3.96.970811183134.1727D-100000@julie.teleport.com>

On 11 Aug 1997, Arielle Sumits wrote:

> How can I share variables across several perl scripts?

There are some good suggestions in the perlipc(1) manpage. 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: 12 Aug 1997 04:36:38 GMT
From: trockij@transmeta.com (Jim Trocki)
Subject: Re: sleep for a few hundrad milli seconds
Message-Id: <5sop8m$8is$1@palladium.transmeta.com>

In article <33EF1B5D.167E@cig.mot.com>,
Syam P. Aribindi <aribindi@cig.mot.com> wrote:
>Can anybody help me:
>
>I need to routine which allows a sleep time of less of 1 second. The
>sleep time must be a configurable one, just like the one we have for
>sleep in seconds.
>sub msleep {
>
>	$sleep_time = @_;
>        ...
>	...
>}
>
>Thanks in advance.

>From "perldoc -f select":

> You can effect a sleep of 250 milliseconds this way:
> 
>     select(undef, undef, undef, 0.25);

-- 
Jim Trocki
Computer System and Network Engineer
Transmeta Corporation
Santa Clara, CA trockij@transmeta.com


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

Date: Mon, 11 Aug 1997 18:29:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Sorting this file is killing me
Message-Id: <Pine.GSO.3.96.970811182211.1727C-100000@julie.teleport.com>

On Tue, 12 Aug 1997, Thomas Wernitz wrote:

> chomp(@source = <DATA>); # slurp in the file
> 
> map {push @sorted, [split /\|/,$_]} 
>   sort {(split(/\|/,$a))[1] <=> (split(/\|/,$b))[1]} @source;

(See information below about using map and grep in a void context.) It's
very inefficient to split each line so many times! (If you have 100 lines,
you're calling split approximately five times for each line!) Try this
instead. (It may be clearer to understand if you start from the bottom
and work up.) 

    @sorted = 
	sort { $a->[1] <=> $b->[1] } 	# Sort numerically by field 2
	map { [ split /\|/ ] }		# Split fields on |
	@source;			# From @source

> grep {print "$_->[0] : $_->[1]"} @sorted; 

It's not good to use grep in a void context either. (Use foreach instead.)
And don't forget the newline!

    foreach (@sorted) {
	print "$_->[0] : $_->[1]\n";
    }

Or, if you want, you could do this.

    print map "$_->[0] : $_->[1]\n", @sorted;

Or even this combined form, if you only need the printout (and not the
sorted data kept in memory).

    print
	map "$_->[0] : $_->[1]\n",	# Converted to print format
	sort { $a->[1] <=> $b->[1] } 	# Sort numerically by field 2
	map { [ split /\|/ ] }		# Split fields on |
	@source;			# From @source	

That last could make for a very short program! 

> Hey Tom why is it so bad to use map in a void context. If it does what you 
> want, how can it be wrong? 

Well, (at the risk of starting another debate on this subject :-) I'll
just say that using foreach is a better way all around. It's like using
goto LABEL, in that it's not a good way to write code, even when it works.
It can make your code harder to understand and maintain. Since we have
foreach, there's no reason that you would have to use the void context map
or grep. 

Others are welcome to write dissenting opinions, and I'm welcome to ignore
them. :-)

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: Tue, 12 Aug 1997 02:10:59 GMT
From: ils@pipcom.com (Scott Card)
Subject: Where is the file data after open?
Message-Id: <33efc5ed.855127@news.pipcom.com>

How do you access the file stats - size, date, etc after using the
open command?

Thanks


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

Date: Mon, 11 Aug 1997 20:25:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Scott Card <ils@pipcom.com>
Subject: Re: Where is the file data after open?
Message-Id: <Pine.GSO.3.96.970811202305.3816C-100000@julie.teleport.com>

On Tue, 12 Aug 1997, Scott Card wrote:

> How do you access the file stats - size, date, etc after using the
> open command?

You can get that information before or after opening a file with the
curiously-named stat() function, documented in the perlfunc(1) manpage.
(Or, if you need only some of that information, the -X filetests may do
the job.) 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: Mon, 11 Aug 1997 21:54:31 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Where is the file data after open?
Message-Id: <79jos5.pri.ln@localhost>

Scott Card (ils@pipcom.com) wrote:
: How do you access the file stats - size, date, etc after using the
: open command?

You don't.

You access the file stats with... would you believe stat()?

It's all there in a perlfunc man page near you...


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


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

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

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