[7125] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 750 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 21 01:07:53 1997

Date: Sun, 20 Jul 97 22:02:20 -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           Sun, 20 Jul 1997     Volume: 8 Number: 750

Today's topics:
     Re: Inserting/deleting scalars into arrays? (Clay Shirky)
     Re: Learning Perl ..Help?? (M. muPe)
     Re: Looking for a routine to trim white space (like VB  (Clay Shirky)
     Re: Mail management via web <p.luca@macronet.it>
     Re: Mail management via web <rootbeer@teleport.com>
     Re: Making a matrix... (Albert W. Dorrington)
     Re: Making a matrix... (Steffen Beyer)
     Re: Multiple Line Pattern Matching <rootbeer@teleport.com>
     Re: Multiple Line Pattern Matching <rootbeer@teleport.com>
     Re: Multiple Line Pattern Matching <bkyan@mindcast.com>
     Re: Need some help... (Tad McClellan)
     New RDB module: RDB Interactive (rdbi) <hobbs@rand.org>
     Re: Newbie:  How do you call gzip from perl? <rootbeer@teleport.com>
     Re: Newbie:  How do you call gzip from perl? <kistler@erdw.ethz.ch>
     Re: Null file handle: Is it the angle operator's ignora (M.J.T. Guy)
     Re: Perl Editors (No perl content) (M. muPe)
     Re: Perl for win 95 ? (Nathan V. Patwardhan)
     Re: Perl for win 95 ? <rootbeer@teleport.com>
     Perl Scripts and Windows NT <bja109@mail.usask.ca>
     Re: Perl with MULTIPLICITY -- does it work? <dougm@osf.org>
     Q: perl ver of fflush(STDOUT) (Eric Heft)
     Re: Q: perl ver of fflush(STDOUT) <rootbeer@teleport.com>
     Re: References and Objects <zenin@best.com>
     Re: request.pm ???! (Nathan V. Patwardhan)
     Re: Running CGI-Perl Scripts Locally (Matthew Burnham)
     Re: Silly Newbie Question about time <dres@dimensional.com>
     socket.ph problem with libwww-perl-0.40 <tramark@choice1.com>
     Re: Source multiple line perl file (M.J.T. Guy)
     Re: Source multiple line perl file <rootbeer@teleport.com>
     Re: splitting a list of strings? (Michael Fuhr)
     Re: String Comparison (Magnus Bodin)
     Test Message <brulej@dos.nortel.com>
     Testing shift for true or false (dave)
     Re: Testing shift for true or false (dave)
     Re: Timed (hourly) execution of a perl script (Matthew Burnham)
     Re: Using varaibles from a template file <rootbeer@teleport.com>
     Re: What happens when.... <rootbeer@teleport.com>
     Re: What is--->>  19.483u 0.216s 0:12.71 154.9% 0+0k 0+ <ariels@mangal.cs.huji.ac.il>
     zombie processes <MoNoLiTH+@CMU.EDU>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 Jul 1997 12:47:06 -0400
From: clays@panix.com (Clay Shirky)
Subject: Re: Inserting/deleting scalars into arrays?
Message-Id: <5qtfea$scs@panix2.panix.com>

>I don't know very much about Perl (yet), but I'm thinking about making
>an ed/sed-like editor in Perl. 

What next - an MS-DOS-like shell for UNIX? what on earth could a
sed-like interface do for you that perl straight no chaser couldn't do?

> ...So should I use an array to hold the
>file being edited (it'll be mostly small files), which each line in
>the file being a scalar in the array? And if so, is there an easy way
>to insert / delete scalars (lines) into/from an array?

yes, several

man perlfunc, you want to look at push, pop, shift, unshift and splice

>On a different note, I've read some short tutorials on perl, but they
>weren't very extensive. And the man pages are more of a reference
>manual, and therefore hard to learn from for a newbie. So, could
>anyone direct me to a fairly extensive perl tutorial / doc / whatever,
>from which I can learn a bit more? I have a lot of programming
>experience in other languages, so I don't usually have a problem with
>these things. *cough cough*

get O'Reilly's Llama book for a structured tutorial, and the turquoise
(as opposed to pink) Camel book for a good overview.

www.perl.com also has lots of good stuff.

--
Clay Shirky



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

Date: Sat, 19 Jul 1997 17:56:53 GMT
From: mupe@desk.nl (M. muPe)
Subject: Re: Learning Perl ..Help??
Message-Id: <5qqrvv$nq6$1@news2.xs4all.nl>

In article <5qnvqe$62v@angel.uunet.ca>, davet@angel.uunet.ca (Dave Till) wrote:
>In article <5qlhe6$pv7@mimsy.cs.umd.edu>, Charles Lin <clin@cs.umd.edu> wrote:
>>|| Not to sound like  I am sucking up, but the PERL book is one of the best
>>|| computer books ever written. I hate those learn anything in 7 days
>>[...]
>>
>>    Which PERL book is that?   There are two by O'Reilly (publishing).
>>
>>    Anyway, the reason there are so many "learn blah in 7 days" is 
>>precisely because people learn differently.
>
>And also because they have differing levels of experience.  I don't
>think it's possible for one computer book to satisfy all readers:
>beginners would get confused by such a book, and experts would get bored.
>

And there is also the point; the natural language of the reader.
Maybe someone has no problem with understanding the lyrics of the
Rolling Stones. But when it comes to learning a first programme language;
A 'go for guru' book might lack 'kindergarten' examples which visualize the
english math and programming terms.  

Anyhow it is allways fun, when someone asks in an international newsgroup; 
which book for Bla? Maybe one day someone will ask what kind of dinner
he/she should eat.

Mathilde muPe




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

Date: 19 Jul 1997 22:02:50 -0400
From: clays@panix.com (Clay Shirky)
Subject: Re: Looking for a routine to trim white space (like VB trim$)
Message-Id: <5qrrka$mfo@panix2.panix.com>

In <5qpggv$597$1@newsource.ihug.co.nz> pk@flexsol.co.nz (pk) writes:


>I am looking for a routine like the Visual Basic trim$() to trim leading and 
>trailing spaces from a string.  

>It must not remove embeded white space.  Looking at the Perl manual there does 
>not seem to be one.

>Has anyone written such a beast and if so could they either post it or e-mail 
>me a copy.

>Thanks.

s#^\s*(.*?)\s*$#$1#s; should do it. 



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

Date: Sat, 19 Jul 1997 16:20:10 +0200
From: "Luca" <p.luca@macronet.it>
Subject: Re: Mail management via web
Message-Id: <5qqim7$d3f$1@news.flashnet.it>

OOPS 
my mail!! p.luca@macronet.it
 Luca ha scritto nell'articolo <5qqiig$cs6$1@news.flashnet.it>...
>I'm looking for a perl script to manage my mail via web.
>I would like to check for mail, delete messages and to do all other
actions
>I can make with Eudora but..... via web!
>Is it possible??? can anyone help me ??????
>Please answer me in mailbox.
>
>
>
>
>
> 




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

Date: Sat, 19 Jul 1997 08:23:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Luca <p.luca@macronet.it>
Subject: Re: Mail management via web
Message-Id: <Pine.GSO.3.96.970719082233.254F-100000@kelly.teleport.com>

On Sat, 19 Jul 1997, Luca wrote:

> I'm looking for a perl script to manage my mail via web.  I would like
> to check for mail, delete messages and to do all other actions I can
> make with Eudora but..... via web! 

There are modules on CPAN which should make it possible to write this.

    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: 17 Jul 1997 16:22:37 -0500
From: awdorrin@ictest.delcoelect.com (Albert W. Dorrington)
To: Guilherme Braz de Carvalho <gbraz@dcc.ufmg.br>
Subject: Re: Making a matrix...
Message-Id: <5qm2et$dkk@ws051eng.ictest.delcoelect.com>


In article <Pine.SOL.3.96.970711104820.14486A-100000@turmalina>, Guilherme Braz de Carvalho <gbraz@dcc.ufmg.br> writes:
:> 
:>  Can I create a matrix in Perl ?  It would be a array into a array , all
:> right ? Can can it be ? like this ?
:> 
:> @curse =($semester,@teaches,$hours);
:> 
:> How can I make reference to an element of curse[0], teaches[1], would it
:> be like   $curse[0][1][1]  ?
:> 
:> Can I find some help like this in Programming Perl ? Where ? 
:> 

Yes, you can create a matrix in Perl - Chapter 4 of the 2nd edition of
 'Programming Perl' has a good explanation of all this.

You almost have it correct above, instead it would be:

@semester = [ "fall", "spring", "summer" ];
@teaches = [ "Math", "Science", "Writing", "Programming" ];
@hours = [ 1, 2, 3, 4, 5 ];

@course = ( @semester, @teaches, @hours);


$course[0][2] is element "summer"

$course[1][1] is element "Science"

$course[2][0] is '1'



Good Luck,

	Al


-- 
Al Dorrington                               awdorrin@ictest.delcoelect.com 
Delco Electronics - IC CIM                  Database & Unix Administrator
Kokomo, Indiana, USA                        Phone: 765.451.9655


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

Date: 20 Jul 1997 08:09:36 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Making a matrix...
Message-Id: <5qsh40$e77$1@en1.engelschall.com>

Albert W. Dorrington <awdorrin@ictest.delcoelect.com> wrote:

> In article <Pine.SOL.3.96.970711104820.14486A-100000@turmalina>,
> Guilherme Braz de Carvalho <gbraz@dcc.ufmg.br> writes:
> :> 
> :>  Can I create a matrix in Perl ?  It would be a array into a array , all
> :> right ? Can can it be ? like this ?
> :> 
> :> @curse =($semester,@teaches,$hours);
> :> 
> :> How can I make reference to an element of curse[0], teaches[1], would it
> :> be like   $curse[0][1][1]  ?
> :> 
> :> Can I find some help like this in Programming Perl ? Where ? 

> Yes, you can create a matrix in Perl - Chapter 4 of the 2nd edition of
>  'Programming Perl' has a good explanation of all this.

As does the Perl FAQ and the perllol, perldsc etc. manpages...

> You almost have it correct above, instead it would be:

> @semester = [ "fall", "spring", "summer" ];
> @teaches = [ "Math", "Science", "Writing", "Programming" ];
> @hours = [ 1, 2, 3, 4, 5 ];
> @course = ( @semester, @teaches, @hours);

> $course[0][2] is element "summer"
> $course[1][1] is element "Science"
> $course[2][0] is '1'

Well, you got it almost correct above... :-)

It works, but assigning a single reference to an array of its own
looks like a waste to me:

  $semester = [ "fall", "spring", "summer" ];
  $teaches = [ "Math", "Science", "Writing", "Programming" ];
  $hours = [ 1, 2, 3, 4, 5 ];
  @course = ( $semester, $teaches, $hours );

*** OR ***

  $course = [ $semester, $teaches, $hours ];

  $course[0][2] is element "summer"
  $course[1][1] is element "Science"
  $course[2][0] is '1'

*** OR ***

  $course->[0]->[2] is element "summer"
  $course->[1]->[1] is element "Science"
  $course->[2]->[0] is '1'

(But that's against the programmer's virtue "lazyness" :-) )

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Sat, 19 Jul 1997 10:01:40 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Joseph June <jjune@miday.uchicago.edu>
Subject: Re: Multiple Line Pattern Matching
Message-Id: <Pine.GSO.3.96.970719095927.5345C-100000@kelly.teleport.com>

On Sat, 19 Jul 1997, Joseph June wrote:

> I'm not sure how to do a pattern match on strings that are multiple
> lines... 

This FAQ entry may be of some help. If not, please let us know just what
you're trying that isn't doing what you want. Good luck!

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

-- 
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: Sat, 19 Jul 1997 20:13:17 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Benjamin Kyan <bkyan@mindcast.com>
Subject: Re: Multiple Line Pattern Matching
Message-Id: <Pine.GSO.3.96.970719200413.5095H-100000@kelly.teleport.com>

On Sat, 19 Jul 1997, Benjamin Kyan wrote:

> > On Sat, 19 Jul 1997, Joseph June wrote:
> > 
> > > I'm not sure how to do a pattern match on strings that 
> > > are multiple lines...
> 
> 	Use:
> 		s/$multi_line_text/$string_to_match/s;

I find some fault with that answer.

You have put the $string_to_match in the wrong place. I think you want a
pattern where you have the $multi_line_text. If that's right, then it's
not necessarily the case that you'll want the /s modifier; that depends
upon the pattern. When the pattern is contained in a variable, you may
well want the /o modifier. And, of course, what you have there is a
substitution, instead of the requested pattern match.

I'd like to say something positive about your answer, so I'll point out
that it's syntactically correct Perl, and it has nice symmetry. :-) 

Fortunately, all of this is covered in the docs and FAQs. 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: Sun, 20 Jul 1997 00:37:50 -0700
From: Benjamin Kyan <bkyan@mindcast.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Multiple Line Pattern Matching
Message-Id: <33D1C04E.4CFEB80@mindcast.com>

Tom Phoenix wrote:
> 
> On Sat, 19 Jul 1997, Benjamin Kyan wrote:
> 
> > > On Sat, 19 Jul 1997, Joseph June wrote:
> > >
> > > > I'm not sure how to do a pattern match on strings that
> > > > are multiple lines...
> >
> >       Use:
> >               s/$multi_line_text/$string_to_match/s;
> 
> I find some fault with that answer.
> 
> You have put the $string_to_match in the wrong place. I think you want
> a pattern where you have the $multi_line_text. If that's right, then
> it's not necessarily the case that you'll want the /s modifier; that
> depends upon the pattern. When the pattern is contained in a variable, 
> you may well want the /o modifier. And, of course, what you have there 
> is a substitution, instead of the requested pattern match.

	Ooops...  Too many beers, today...  ;)

	I meant to say: (really!)

		$multi_line_text =~ s/$string_to_match/$replacement/s;

	Here's I'm assuming that we're talking about a search
	and replace operation.  Otherwise, try the FAQ, as Tom
	suggests.  :)
	
-- 

Best Regards,
Benjamin Kyan
bkyan@mindcast.com

==========================  ========================  ==============
Clickstream Communications  9101 W. Sahara, #105-183  T 404.685.0852
(website) www.mindcast.com  Las Vegas, Nevada  89117  F 404.685.0853
==========================  ========================  ==============


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

Date: Sat, 19 Jul 1997 19:02:30 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Need some help...
Message-Id: <mikrq5.p33.ln@localhost>

James Lovette (jlovettte@mhv.net) wrote:

: Subject: Re: Need some help...

You also need an actual subject in your Subject header.

See the regular posting here about choosing good Subjects.


: Can anybody out there write a script for me?  

Sure.

Send money  ;-)


: I want it to be one where
: the visitor is given a list of choices and based on those a price is
: outputted, similar to customizing a computer system online like at
: http://www.vektron.com/quote/QMMS1.HTM


That type of thing is usually called a 'shopping cart'.

You may be able to find one already written that will work for you
by searching for that with your favorite search engine.


: I would really appreciate it, I have tried to learn perl for 5 months
: and it still makes no sense.  


I'm guessing (please excuse me if I have guessed wrong) that you are
actually trying to learn three separate things at the same time. You
might want to consider learning them one at a time (learn to crawl
before you walk):

   1) how to program in general
   2) how to program with Perl
   3) how to use the Common Gateway Interface (CGI)


Learning how to program is the hardest of the three. You might consider
taking an "Introduction to Programming" class at a local community
college.

Learning how to program is a significant investment in time and
intellectual effort. Most people who have made that investment hope
to be able to recoup it by charging for using the knowledge so
acquired.

If you do not wish to learn how to program, a viable alternative is
to hire someone to do it for you.


-----

How have you been trying to learn Perl?

Have you gotten "Learning Perl" by Randal Schwartz yet? (http://www.ora.com)

Have you read a few of the man pages that are included with the perl
distribution?

Have you read the Perl FAQ?

Do you monitor c.l.p.m regularly to see many common questions and their
solutions, as well as a bunch of example code?

Have you poked around at http://www.perl.com  ?


-----

As to learning CGI, that is off-topic for this newsgroup.

The newsgroup for CGI related questions is:

   comp.infosystems.www.authoring.cgi

Even though most uses of Perl are for NON web related things, there is
still help to be found in the Perl FAQ, which points out these helpful
URLs:

    http://www.perl.com/perl/faq/idiots-guide.html
    http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
    http://www.perl.com/perl/faq/perl-cgi-faq.html
    http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
    http://www.boutell.com/faq/


-----

: Please respond by e-mail, thank you.

Nope. 

Ask it here, get the answer here.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 20 Jul 1997 15:48:16 GMT
From: Walt Hobbs <hobbs@rand.org>
Subject: New RDB module: RDB Interactive (rdbi)
Message-Id: <5qtc00$1jl$1@nadine.teleport.com>

There is now an interactive analysis tool for RDB data tables (rdbtables)
called 'rdbi'. It is especially useful for rdbtables that were made from
spreadsheet data or outside sources of unknown content. Spreadsheet data
files are easily converted via 'repair -b spreadsheet_file'.

====>  NOTE, if you don't know what RDB is see the end of messge.  <=====

It basically utilizes other RDB modules (column, etbl, ptbl, reporttbl, row,
sorttbl, tbl2lst, summ, valid) to present a simple interface so one can
analyze and/or modify, or make new versions, of an rdbtable quickly.

The header information of a given rdbtable will be shown, which includes any
header comment lines, each column number, column name, and any column
documentation that may exist.

The rdbtable may be printed in column mode, in list mode (like that used by
etbl) or formatted (if a template file is available).

Online help is available at any time.

The use of a pager (LESS by default) is included which may be turned on or
off as needed.

Such actions as limiting or re-arranging columns, sorting by columns, or
selecting rows based on an expression are done with simple commands. Column
names or column NUMBERS may be used in several commands, to save typing. In
these cases temporary copies of the modified rdbtable are made, which may be
saved if desired; otherwise they are removed when the program is exited.

The summary information command (summ module output) shows the detailed
makeup of the columns and has proven to be very useful.

Commands to execute RDB modules that are not built into the interface, as
well as arbitrary UNIX commands, may be executed at any time via an escape
mechanism.

For more detail on the interactive commands for rdbi use 'rdbi -help'.

I like 'rdbi' much better than the old RDB Terminal Interface module 'rdb'
(which has been renamed to 'rdbt').

The tool 'rdbi' is available as a separate file, via anon ftp (this is
the primary RDB location) from:

    ftp://ftp.rand.org/pub/RDB-hobbs/

    file name:  rdbi

Walt Hobbs

PS My RDB mail list is way out of date; many bad returns. If you want 
to be on my RDB mail list (for occasional notices) please let me know.

 ......................................................................
What RDB is:

RDB is a fast, portable, Relational DataBase Management System without
arbitary limits, (other than memory and processor speed).

RDB uses the 'operator/stream' DBMS paradigm described in Unix Review,
March, 1991, page 24, entitled A 4GL Language.  The operators are UNIX
filters, i.e. they read STDIN and write STDOUT so they can be connected
by pipes (the '|' char).

The operators work with relational data in ascii files.  The fields in
each row are separated by a 'TAB' char and the row is terminated with
a 'NEWLINE' char.  The first section of rows (the header) contains the
names and data definitions for each column.  The header also contains
optional embedded documentation relating to the entire datafile and/or
each data column.  Subsequent rows (the body) contains the data values.
A file in this form is said to be an 'rdbtable'.  RDB is compliant with
the Relational Model.

These rdbtables are easily ported to and from spreadsheet programs on
Macintoshes or MSDOS computers.

All operators read an rdbtable via STDIN and most write a new rdbtable
via STDOUT. Exceptions are operators that produce output listings instead
of rdbtables (like 'ptbl' and 'reporttbl').

All operators and utilities take a '-help' option to print usage detail
and other information online.

There are currently 22 RDB modules (operators and utilities) written
in PERL.
 ......................................................................




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

Date: Sun, 20 Jul 1997 06:58:45 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David Sperling <rika@aloha.net>
Subject: Re: Newbie:  How do you call gzip from perl?
Message-Id: <Pine.GSO.3.96.970720065656.5855M-100000@kelly.teleport.com>

On Sun, 20 Jul 1997, David Sperling wrote:

> I'd like to know the code needed to run gzip from a perl script.

You could use qx// (documented in the perlop manpage) or system
(documented in perlfunc). Or, you could use a module from CPAN to do
compression. Hope this helps!

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

-- 
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: Sun, 20 Jul 1997 13:47:26 +0200
From: Per Kistler <kistler@erdw.ethz.ch>
Subject: Re: Newbie:  How do you call gzip from perl?
Message-Id: <33D1FACE.37304576@erdw.ethz.ch>

Hi David 

To run some unix command you can do:

$output = `command args`;

or

system("command args");

system 'command', 'arg1', 'arg2';

or

print <<`EOF`;
command args
command args
EOF


---
Per Kistler 
Programmer (Unix/Perl/C++)
kistler@erdw.ethz.ch    
http://www.erdw.ethz.ch/~kistler
Institute for Isotope Geology and Mineral Resources, ETH, Switzerland 
---------------------------------------------------------------------


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

Date: 19 Jul 1997 17:26:55 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Null file handle: Is it the angle operator's ignorance or mine?
Message-Id: <5qqtcv$ncf@lyra.csx.cam.ac.uk>

In article <5qo662$rc5@lyra.csx.cam.ac.uk>,
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>+foo works OK for me.    Perhaps your shell is doing something with the
>"+"?

Well, actually it doesn't work.    I happened to have a file "foo" as well
as "+foo" with similar contents ...


Mike Guy


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

Date: Sat, 19 Jul 1997 17:17:24 GMT
From: mupe@desk.nl (M. muPe)
Subject: Re: Perl Editors (No perl content)
Message-Id: <5qqplu$mp0$1@news2.xs4all.nl>

In article <lpu3hukbh9.pilchard_-_@meta.physics.ox.ac.uk>, Paul Stevenson <paul.stevenson@balliol.ox.ac.uk> wrote:

> He _did_ say "besides the famous unix editors". I'm sure he must have
>included emacs in here.
>Also Xemacs kinda has drag'n'drop support if compiled under the cde.
>
>Paul

Indeed I ment vi and emacs, as proffesional unix editors.
And only dared to mention other editors with dos/mac familiar key 
shortcuts  for sake of ease to start with. 

Mathilde muPe

!= Mathijs 



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

Date: 20 Jul 1997 18:11:39 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl for win 95 ?
Message-Id: <5qtkcr$rr0@fridge-nf0.shore.net>

Kazys Jocionis (kj.jl@klaipeda.omnitel.net) wrote:

: Today I have found Perl for win 32 on the Net. 

: Can I run it on my PC?

If you got the copy from www.activeware.com, you just run the install
scripts, reboot your machine and you're on your way.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Sun, 20 Jul 1997 08:49:49 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kazys Jocionis <kj.jl@klaipeda.omnitel.net>
Subject: Re: Perl for win 95 ?
Message-Id: <Pine.GSO.3.96.970720084918.10215B-100000@kelly.teleport.com>

On Sun, 20 Jul 1997, Kazys Jocionis wrote:

> Today I have found Perl for win 32 on the Net. 
> 
> Can I run it on my PC?

You'll never know until you try. :-)  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: Sun, 20 Jul 1997 08:54:11 -0600
From: Bobbi Arlett <bja109@mail.usask.ca>
Subject: Perl Scripts and Windows NT
Message-Id: <33D22693.22B5@mail.usask.ca>

Hi, I have written a perl script for windows NT and I cannot specify the
path for the resulting file to go to, it only works if the file is in
the CGI-bin directory.  Can anyone tell me how to specify the path in a
perl script?

Please respond via e-mail.

Thanks,
Bobbi Arlett
bja109@mail.usask.ca


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

Date: Sun, 20 Jul 1997 19:33:37 -0400
From: Doug MacEachern <dougm@osf.org>
To: News <rpang@us.oracle.com>
Subject: Re: Perl with MULTIPLICITY -- does it work?
Message-Id: <33D2A051.4EC9@osf.org>

News wrote:
> 
>  Hi Perl gurus,
> 
> Sorry for my cross-posting, but I am really stuck here.
> 
> I have been trying to use Perl 5.004 on Solaris 2.5.1 with MULTIPLICITY (and
> EMBED), i.e. running multiple instances of Perl interpreter in 1 process.
> It works to some degree and I am able to run Perl codes with perl_eval_sv.
> However, I have been getting warnings when it tries to free up memory (e.g.
> non-existent shared strings) and coredump when destroying the interpreter.

Do you have an example we can see?  Did you try the multiplicity.c example 
from perlembed.pod?  Does that work?
 
> Does anyone have any experience with Perl with MULTIPLICITY?  Does it work?
> I know that I have to switch the current interpreter with "curinterp =
> myperl".  Besides this, what else do I need to be aware of?

>From what I've seen it works quite well.  However, it is not thread-safe.  If 
you, say, create an interpreter per-thread, you must wrap any perl API call 
in a mutex lock/unlock.   

-Doug

> 
> Many thanks.
> 
> Robert Pang


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

Date: 20 Jul 1997 03:28:44 GMT
From: eheft@dnaco.net (Eric Heft)
Subject: Q: perl ver of fflush(STDOUT)
Message-Id: <5qs0lc$soo$1@pike.dnaco.net>

Hello,
   I'm trying to do something like this. I've tried the method 
outlined in the FAQ but can't seem to get it to work :( Heres 
the general loop structure.


print "Processing :";
for (@list)
{
    print ".";
##  Want to flush the buffer here.
    slowly_process($_);
}
print "Done!\n";

Thanks
Eric


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

Date: Sun, 20 Jul 1997 06:35:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Eric Heft <eheft@dnaco.net>
Subject: Re: Q: perl ver of fflush(STDOUT)
Message-Id: <Pine.GSO.3.96.970720063440.5855H-100000@kelly.teleport.com>

On 20 Jul 1997, Eric Heft wrote:

>     print ".";
> ##  Want to flush the buffer here.

Replace that with this.

    $| = 1;		# Flush upon output
    print ".";		# This will now flush.

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: 19 Jul 1997 22:55:37 GMT
From: Zenin <zenin@best.com>
Subject: Re: References and Objects
Message-Id: <5qrgl9$ca2$3@nntp2.ba.best.com>

Jeff Stampes <stampes@xilinx.com> wrote:
> Zenin (zenin@best.com) wrote:
> : 	push @{ $self->{eval_list}, [ $evaluation, $design ];

> MIssing something here Zenin?

	Duh!  Yes, that really should be:

	push @{ $self->{eval_list} }, [ $evaluation, $design ];
	                          /|\
	For those that can't       |
	tell, I was missing this---|

	Hey, you get what you pay for. :-)

-- 
-Zenin
 Quake Clan After Shock (Did you feel that?)
 The Bawdy Cast - Rocky Horror Picture Show (San Jose, CA)
 Zenin's Rocky Archive (http://www.best.com/~zenin/)
 zenin@best.com


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

Date: 21 Jul 1997 01:14:50 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: request.pm ???!
Message-Id: <5qud6a$oa2@fridge-nf0.shore.net>

RaNDoM (opx1@rocketmail.com) wrote:

: I read in a file that it is not needed to use all that parse_form shit as
: in perl4 (?)
: but that u can use a module called request.pm

It's possible that request.pm is part of the CGI or LWP modules which
you can find at:

http://www.perl.com/CPAN/modules/by-module/CGI/
http://www.perl.com/CPAN/modules/by-module/LWP/

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Sat, 19 Jul 1997 16:46:57 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Running CGI-Perl Scripts Locally
Message-Id: <33d63f82.1463587@194.72.192.4>

Simon <3dcc5@qlink.queensu.ca> wrote:

>Hello World,
>
>I wonder if this is possible: I would like to run Perl CGI-scripts 
>locall at home on my Win95 machine without being connected to the
>internet. I mean, have html files and .cgi files run locally at
>home..does anyone know where I can start to look to find out how to do
>this? I assume I'll have to install my own Win95 web server
>software..does anyone have any suggestions? Thanks in advance for all
>your help.

I'd suggest you use OmniHTTPd, it works very well for me, the only
problem being it prefers .pl files than .cgi ones :-(

I *think* the URL is http://www.fas.harvard.edu/~glau/httpd/ (definately
not sure about the httpd, and not entirely sure about the rest, but try
it and look on a search engine if it's not there).



-- 
Matthew Burnham, Manager, MindWeb | danew@enterprise.net
Commercial web design and hosting, reasonable rates
UKP24/Mb/Year for DIY space | mindweb@pobox.co.uk
FTP, CGI, password protection, etc. too!
http://www.mindweb.co.uk/


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

Date: 20 Jul 1997 09:13:51 -0600
From: James LewisMoss <dres@dimensional.com>
Subject: Re: Silly Newbie Question about time
Message-Id: <hhk9il7o3z.fsf@dres.elam.org>

>>>>> On Thu, 17 Jul 1997 09:46:23 -0400, squeak! <lyonsj@bgnet.bgsu.edu> said:

 lyonsj> I'm trying to write a few lines of a script to time something
 lyonsj> for a friend.  In order to do this, I have written the
 lyonsj> following:

 lyonsj> $start = time; print "$start\n";

 lyonsj> $count = 1; do {
 lyonsj> 	print "counting...\n"; ++$count;
 lyonsj> } while ( $count <=42 );

 lyonsj> $finish = time; print "$finish\n";

 lyonsj> $elapsed = ($finish - $start); print "$elapsed\n";


 lyonsj> The problem is, it returns the same time to both $start and
 lyonsj> $finish, meaning that I always come up with zero as the
 lyonsj> elapsed time.  No matter how much I have it do between the
 lyonsj> two calls of time, it does the same thing.  Any ideas?  I'd
 lyonsj> really like some help, even though I know it's a really silly
 lyonsj> question.

time only deals in seconds, so if the loop takes less than a second
(which at 42 it will) then it'll (almost always) give 0 as the
answer.  Bump up the count to 1000 or so and it'll give more than 0.
Look in section eight of the FAQ for 'How can I measure times less
than a second?'

Jim

-- 
@James LewisMoss <dres@dimensional.com> |  Blessed Be!
@    http://www.dimensional.com/~dres   |  Linux is cool!
@"Argue for your limitations and sure enough, they're yours." Bach


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

Date: Sat, 19 Jul 1997 21:18:15 -0700
From: Tracy Lotz <tramark@choice1.com>
Subject: socket.ph problem with libwww-perl-0.40
Message-Id: <33D19187.8AC748C5@choice1.com>

Anyone ever have any problems with the socket.ph file when hooking up
libwww-perl-0.40.....?  Its causing my "get" script problems with making
a socket connection and not returning the URL that it was suppose to
get.

THanks in advance.

TL



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

Date: 20 Jul 1997 13:29:45 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Source multiple line perl file
Message-Id: <5qt3s9$804@lyra.csx.cam.ac.uk>

Per Kistler  <kistler@erdw.ethz.ch> wrote:
>How would I source a perl file in the middle of a perl file
>if it contains multiple line commands?
>
>If the commands are single lined, I can do it like that:
>
>  if( -r $CONFIGFILE ){
>    open(CONF,"<$CONFIGFILE") or &myLogger("Cannot open $CONFIGFILE");
>    my @conf = <CONF>;
>    close(CONF);
>    map { eval } @conf;
>  }else{
>    open(CONF,">$CONFIGFILE") or &myLogger("Cannot open $CONFIGFILE");
>    close(CONF);
>  }
>
>But this works only for single line commands.

The obvious way to fix your code is to read the file as a single string:

     open(CONF,"<$CONFIGFILE") or &myLogger("Cannot open $CONFIGFILE");
     local $/ = '';
     eval <CONF>;
     close(CONF);

And you really ought to check $@ after doing the eval.

But what you're trying to do is already built-in in Perl.   See "do"
and "require" in the perlfunc man page.



Mike Guy


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

Date: Sun, 20 Jul 1997 07:52:05 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Per Kistler <kistler@erdw.ethz.ch>
Subject: Re: Source multiple line perl file
Message-Id: <Pine.GSO.3.96.970720075002.5855V-100000@kelly.teleport.com>

On Sun, 20 Jul 1997, Per Kistler wrote:

> $req = q!require $file if -r $file!;
> eval $req;

Wouldn't this be better?

    eval { require $file };

Of course, you should examine the value of $@ to see whether that shows
something undesirable has happened, but you'd need to do that anyway. 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: 19 Jul 1997 05:15:51 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: splitting a list of strings?
Message-Id: <5qq7l7$4b@flatland.dimensional.com>

psmith@baynetworks.com (Paul D. Smith) writes:

> I'm bummed that split doesn't take a list of things to split.  I want to
> do this:
>
>   map { ... } split /[ ,]/o, @strings;
>
> but of course that doesn't work :(

Perhaps I've misunderstood what you want, but is there some reason
you can't use map for the split?

    map { ... } map { split /[ ,]/ } @strings;

> Is there any faster way, that's not a lot more code, than doing
> something like:
>
>   map { ... } split /[ ,]/o, join(' ', @strings);
                           ^^^
Why the /o for a pattern that won't change anyway?

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Thu, 17 Jul 1997 07:13:27 GMT
From: magnus.bodin@tychonides.se (Magnus Bodin)
Subject: Re: String Comparison
Message-Id: <33cdc375.58022491@news1.telenordia.se>

"Ryan" <rmcguigan@ramresearch.com> wrote:
>Hello, I just need a little bit of help with a script I have to write.  The
>script has to edit all files in given directories, and all it has to do is
>cut and paste.  That's pretty simple, but I would like to be able to
>compare strings IGNORING CASE.  Any suggestions?

ignoring case, skipping whitespace, double characters and everything
else when searching is easiest if you put all the conformation in a
function and then does the compare like this:

if (&conform($a) eq &conform($b)) {
	
	la la la

}


sub conform {

		do the conformation here

}



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

Date: Sat, 19 Jul 1997 19:15:37 GMT
From: Jon R Brule <brulej@dos.nortel.com>
Subject: Test Message
Message-Id: <33D11259.4C0331FD@dos.nortel.com>

Test



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

Date: Sat, 19 Jul 1997 11:28:55 GMT
From: over@the.net (dave)
Subject: Testing shift for true or false
Message-Id: <33d0a394.2686216@news.one.net>

Hi,

I noticed that the loop in:

    sub ThisSub
    {
        while( $arg = shift ) {...}
    }

terminated if one of the args was an empty string ("").

I allowed empty strings by instead doing:

        while( defined( $arg = shift ) ) {...}


Might there be a better way?

Thanks,
Dave

|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Sat, 19 Jul 1997 11:33:33 GMT
From: over@the.net (dave)
Subject: Re: Testing shift for true or false
Message-Id: <33d0a56c.3158132@news.one.net>

over@the.net (dave) wrote:


>Might there be a better way?
>
Nevermind.  Funny how the obvious is so difficult to see sometimes --
"foreach $arg (@_) {...}" will probably work fine.


Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Sat, 19 Jul 1997 16:47:17 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: Timed (hourly) execution of a perl script
Message-Id: <33d7409b.1744930@194.72.192.4>

dico@peionline.com (Dico Reyers) wrote:

>I have a PERL file that goes out and grabs another html file from the
>net.  This file that it get updates itself on the hour, so I need my
>file to re-get this file every hour.  My question is, how can I get
>the file to do this?
>
>Currently I run the file by telneting in and typing
>
>> perl wwwgrab.cgi http://whateversite.com tempfile
>
>How do I get this command to execute every hour?

See if you can set up a 'cron' job, if not try setting up an 'at' job
somewhere in the script to make it run an hour later (ie. it's
self-repeating). If neither of these are possible, what I use (since
there's no point in doing what I want to do if no mail has arrived) is
to run a script when mail arrives and check the day (in your case the
time) to see if it's changed against a file storing it from the last
run. Obviously for an hourly run you'd need to be receiving mail fairly
regularly (I suppose you could set up an intentional loop :), but with
my daily mail that I'm getting while I test it, it's near enough for my
purposed (sending out daily mailing list digests):
	It is now Fri Jul 11 03:25:07 1997.
	It is now Sat Jul 12 02:42:25 1997.
	It is now Sun Jul 13 00:38:55 1997.
	It is now Mon Jul 14 01:12:00 1997.
	It is now Tue Jul 15 00:06:36 1997.
	It is now Wed Jul 16 01:40:12 1997.
	It is now Thu Jul 17 00:05:21 1997.
If your server doesn't kill off long perl jobs, you could always put a
loop in that waits an hour until the time is right then does the get,
then continues round the loop, obviously you'd want to put some delay in
there so you don't eat all the processor time up!).


-- 
Matthew Burnham, Manager, MindWeb | danew@enterprise.net
Commercial web design and hosting, reasonable rates
UKP24/Mb/Year for DIY space | mindweb@pobox.co.uk
FTP, CGI, password protection, etc. too!
http://www.mindweb.co.uk/


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

Date: Sat, 19 Jul 1997 08:06:28 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tung-chiang Yang <tcyang@netcom.com>
Subject: Re: Using varaibles from a template file
Message-Id: <Pine.GSO.3.96.970719080552.254D-100000@kelly.teleport.com>

On Sat, 19 Jul 1997, Tung-chiang Yang wrote:

> Tom Phoenix wrote after zapping the scum of the universe:

> :     $template =~ s/(\$\w+)/$1/gee;	# Maybe what you want?
> 
> Is there any special effect of using 'gee' instead of 'ge'?

Yes, there is. Try it and see. 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: Sat, 19 Jul 1997 09:57:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dico Reyers <dico@peionline.com>
Subject: Re: What happens when....
Message-Id: <Pine.GSO.3.96.970719095738.5345B-100000@kelly.teleport.com>

On Sat, 19 Jul 1997, Dico Reyers wrote:

> What happens when two or more people try to write to a file that is
> already open (ie, another person is already writing to it?).  Is there
> a way to stop this from happening?

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- 
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: 20 Jul 1997 15:25:34 +0300
From: Ariel Scolnicov <ariels@mangal.cs.huji.ac.il>
Subject: Re: What is--->>  19.483u 0.216s 0:12.71 154.9% 0+0k 0+0io 0pf+0w
Message-Id: <7zwwmlrjup.fsf@mangal.cs.huji.ac.il>

Shaun O'Shea <lmisosa@eei.ericsson.se> writes:

> Sometimes when I run perl scripts , the output gets spewed out and then
> stalls and finally spits out something similar to:
> 
> 	19.483u 0.216s 0:12.71 154.9% 0+0k 0+0io 0pf+0w
> 
> Usually this occurs when the perl script contains nested loops.

This looks like the output of the `time' command.  Why does it decide
to appear?  If you're using {t,}csh, you might have set the `time'
shell variable to something which causes these reports to be printed
for any command which runs longer than <blah> seconds.

See the tcsh(1) manpage, section 27 ("AUTOMATIC PROCESS TIME
REPORTING") for further details, or just try "unset time". Note that
the tcsh manpage claims this feature is undocumented in csh(1).


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

Date: Sat, 19 Jul 1997 15:03:08 -0400
From: Aveek Datta <MoNoLiTH+@CMU.EDU>
Subject: zombie processes
Message-Id: <cnoExgu00iWk01qEw0@andrew.cmu.edu>

Hi. I've written a Unix socket server which forks to answer client requests.
It's a simple server based almost verbatim on the one in the Camel book,
with the REAPER function and $SIG{CHLD} function set as is. However, I
still get zombie processes very so often, enough at one time to fill
up the process table and crash the machine.

If I have $SIG{CHLD} = \&REAPER; and sub reaper { $SIG{CHLD} = \&reaper;
$waitedpid = wait; } in my server code, why am I still getting Zombies?

I'm running the server on a Linux Redhat 4.1 box with kernel v2.0.27.
Thanks!

Aveek


  Network Administrator, Monolith Internet Services [TM]  _ _ _   _  Aveek
  SysAdmin, Carnegie Mellon Univ ITC   _ __  ___ _ _  ___| (_) |_| |_Datta
  Personal Website @ datta.ml.org    _| '  \/ _ \ ' \/ _ \ | |  _| ' \ _
  All opinions are ONLY mine.       (_)_|_|_\___/_||_\___/_|_|\__|_||_(_)
  [Get a free domain for your website or machine at http://www.ml.org]



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

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

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