[6524] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 149 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 20 19:11:24 1997

Date: Thu, 20 Mar 97 16:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 20 Mar 1997     Volume: 8 Number: 149

Today's topics:
     "Insecure dependency" while Selfloading (Erik Braun)
     Re: [Q] Finding the contents of a directory? <agent.email@NetTown.com>
     [Q] HTTP client in perl? amas@lhr-sys.dhl.com
     Re: [Q] HTTP client in perl? <agent.email@NetTown.com>
     any non-forking server template code? (Rahul Dhesi)
     Re: Core Dump!?!? (Dominic Dunlop)
     Dereferencing... <rruiz@cybercities.com>
     Re: Dereferencing... (Des Herriott)
     Re: Dereferencing... (Honza Pazdziora)
     Frame -> HTML conversion (was Re: /RE/ for Dummies - Ma <pcunnell@csfp.co.uk>
     Getting Perl 5 <jneufeld@rapidnet.net>
     Re: Getting Perl 5 <merlyn@stonehenge.com>
     Re: Here Document ....How in Perl ???? (Tad McClellan)
     Re: How to edit the data in a file? (Tad McClellan)
     Re: how2 run perl on win 3.11 system?? <tchrist@mox.perl.com>
     Re: join <--> split with delimiter in variable <tchrist@mox.perl.com>
     Making Money From Perl! <jneufeld@rapidnet.net>
     Re: Need to extract the text from Microsoft Word 6 file Steve_Kilbane@cegelecproj.co.uk
     NT and dates <lwallach@pobox.com>
     Re: Opening files in subdirectories <Kevin.T.Huber@cdc.com>
     Re: overloading operators? <tchrist@mox.perl.com>
     Re: Perl 100 times slower ... (Dominic Dunlop)
     Re: perl-binaries for aix1.3 <jonnyb@omni.uio.no>
     Re: Problems with flock() (Jim Rudolf)
     Re: Q: How to search _VERY_ long scalars for recurring  (John Kodis)
     Re: Q: How to search _VERY_ long scalars for recurring  (Tad McClellan)
     Re: Q: How to search _VERY_ long scalars for recurring  <jstrick@mindspring.com>
     QUESTIONNAIRE FOR PERL GURUS <jneufeld@rapidnet.net>
     Re: Recognizing spaces (Bob Wilkinson)
     Response headers (cont'd) <mipotech@novice.uwaterloo.ca>
     Running Dos Programs from within Perl For NT <jont@uunet.pipex.com>
     stat file $mode anomaly? <stclairj@erols.com>
     strange error using anonymous arrays under Solaris but  (R L Samuell)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Jacobus Erasmus)
     Re: What's a good Perl book? (I R A Aggie)
     Re: Win32: How to use a MessageBox or Dialog ("John Dallman")
     Re: ~INTERVIEW FOR ALL PERL GURUS (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 Mar 1997 11:29:46 GMT
From: erik@paxp01.mipool.uni-jena.de (Erik Braun)
Subject: "Insecure dependency" while Selfloading
Message-Id: <slrn45j27t9.dgd.erik@paxp01.mipool.uni-jena.de>

Yes, I've read the perlsec manpage.

When I run this small program I get this error:

  Insecure dependency in eval while running with -T switch at
  /usr/local/lib/perl5/SelfLoader.pm line 24.

This happens, if I press the cursor-left-key. Do you know, what can I
do against this error?

###################################################
#!/usr/local/bin/perl -Tw

use strict;
use Term::ReadLine;

my ($term) = new Term::ReadLine;

my ($input) = $term->readline('Eingabe: ');

###################################################

thank you, erik
-- 
erik@minet.uni-jena.de


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

Date: Thu, 20 Mar 1997 08:27:56 +0000
From: Opera Ghost <agent.email@NetTown.com>
To: amas@lhr-sys.dhl.com
Subject: Re: [Q] Finding the contents of a directory?
Message-Id: <3330F50C.65FAB701@NetTown.com>

amas@lhr-sys.dhl.com wrote:
> 
> I am writing a program and part of what it has to do is find the
> contents of the directory.  What I would be looking for is something
> like:
> 
>        GetDirContents($contents,$type,$regexp)
> 
> $contents would be an array listing the contents of the directory,
> $type would be a set of Folder,File,Symbolic Link
> $regexp would be a regular expression used as a filter, so for example
> if I wanted to find file names that started with 5 alphnumeric characters
> followed by a full-stop, followed by an unknown number of alphanumeric
> characters, I would have something like "?????.*"
> 
> I am in the process of moving from awk, partly becuase of the greater
> functionality of Perl and partly because Perl is available on many more
> platforms.
> 
> If anyone can help me I would appreciat this very much.  If it makes any
> difference my target platform is primarily Unix, though it could be
> anything.
> 
> Andre
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

aside...
yo, why dont u take a quick look at a index of some perl book before
asking the world wide comunity? well i guess u have ur reasons...

so, no anwser, but here's an 'index' i wrote last nite...
http://nettown.com/site_perl/search.cgi
search for 'find', choose that first link

good luck!
--
<i>Opera Ghost
<mailto:agent.email@NetTown.com>
[http://NetTown.com/site_perl/]
have a good day!


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

Date: Thu, 20 Mar 1997 07:51:22 -0600
From: amas@lhr-sys.dhl.com
Subject: [Q] HTTP client in perl?
Message-Id: <858865829.6248@dejanews.com>

I would like to have a robot that would go through my site and index
all the links it comes across. Has anybody done this and would it
work independently of platform?

If you have or know where I can get examples, explanataions I would
appreciate this very much.

Thanks

Andre

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Thu, 20 Mar 1997 08:19:28 +0000
From: Opera Ghost <agent.email@NetTown.com>
To: amas@lhr-sys.dhl.com
Subject: Re: [Q] HTTP client in perl?
Message-Id: <3330F310.14CF3D33@NetTown.com>

amas@lhr-sys.dhl.com wrote:
> 
> I would like to have a robot that would go through my site and index
> all the links it comes across. Has anybody done this and would it
> work independently of platform?
> 
> If you have or know where I can get examples, explanataions I would
> appreciate this very much.
> 
> Thanks
> 
> Andre
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

r u can write ur own easily using...libwww-perl

check out LWP.pm.html and lwpcook.html (for starts) under
http://nettown.com/site_perl/doc
this has examples, also check, a little later today r ?
http://nettown.com/site_perl/doc/eg
ill try to put what i have there

also check out (if u can) the latest linux journal, april 97, issue 36,
which has the article 'using perl to check web links'
http://www.ssc.com/lj/

also look for MOMspider if u want a full blown app.

good luck!
--
<i>Opera Ghost
<mailto:agent.email@NetTown.com>
[http://NetTown.com/site_perl/]
have a good day!


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

Date: 19 Mar 1997 08:51:08 GMT
From: c.c.eiftj@42.usenet.us.com (Rahul Dhesi)
Subject: any non-forking server template code?
Message-Id: <5go9ds$rd5@samba.rahul.net>

The perl online manual has an example of forking server, but not for a
non-forking server.  Are there any available templates for a non-forking
server on which one could build a customized one?

Ideally such a server would create n processes all at once, and then
each process would continue to cycle through incoming connections.
-- 
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
** message body scan immune to fake headers ***   see http://www.rahul.net/
>>> "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> <<<


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

Date: Thu, 20 Mar 1997 11:44:10 +0100
From: domo@tcp.ip.lu (Dominic Dunlop)
Subject: Re: Core Dump!?!?
Message-Id: <19970320114410589047@dialup16.ip.lu>

Tom Phoenix <rootbeer@teleport.com> wrote:

> On Wed, 19 Mar 1997, Michael C. Harris wrote:
> 
> > We have a Perl script (5.001 patch level 1m) 

First off, "have you tried -w"?  This might point to something
questionable in your script that is precipitating the core dump.  Not
that perl should ever dump core (although it's damned hard to catch some
things that cause this behaviour).  But, if a modification to the script
can make the problem go away, that may be your quickest solution.
Talking of which, since it's printf that's at the root of the blow-up,
it's conceivable that you're handing it arguments which, in some
circumstances, make no sense.  Called from C, some printfs will
precipitate core dumps in such cases.  This should not happen in perl,
but, if it does, defensive programming around it may be quicker than
getting a newer and hopefully fixed perl.

> Chances are very good that the problem is fixed in the upcoming version
> 5.004. Would you care to test the beta to find out? (You shouldn't replace
> your current Perl with the beta, though, unless you're especially daring
> or foolhardy.) Good luck! 

If you don't like the thought of beta software (and who could blame
you), simply try the current released version of perl, 5.003.  You can
get it via <http://www.perl.com/perl/info/software.html>.  There's a
good chance that it too will fix the problem.  (If it doesn't, please
submit a bug report using the perlbug program that is part of the perl
distribution.)
-- 
Dominic Dunlop


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

Date: 20 Mar 1997 07:34:43 GMT
From: "Rudy Ruiz" <rruiz@cybercities.com>
Subject: Dereferencing...
Message-Id: <01bc3502$c2e18ea0$53b08ccc@mystra>


	I have a small problem here..

snippet starts here>>
	
	$ptr = \@somearray;
            &somefunction($ptr);

snippet ends here>>

	How do I dereference $ptr inside the sub routine??
	@_[0] contains the address of @somearray but how do I view the contents
	in that address?

	Any help is appreciated

	
	Rudy


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

Date: 20 Mar 1997 09:53:19 GMT
From: des@corp.netcom.net.uk (Des Herriott)
Subject: Re: Dereferencing...
Message-Id: <5gr1ef$kpf$1@taliesin.netcom.net.uk>

In article <01bc3502$c2e18ea0$53b08ccc@mystra>,
	"Rudy Ruiz" <rruiz@cybercities.com> writes:
> 	$ptr = \@somearray;
>             &somefunction($ptr);
> 
> 	How do I dereference $ptr inside the sub routine??
> 	@_[0] contains the address of @somearray but how do I view the contents
> 	in that address?

  sub somefunction
  {
    my ($aref) = @_;
    # dereference the array reference:
    my @array = @$aref;
    # access an element through the array reference:
    my $el = $aref->[$idx];
  }
 
Have a read of 'perldoc perlref'.  It's all in there.

-- 
Des Herriott
des@corp.netcom.net.uk


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

Date: Thu, 20 Mar 1997 15:13:47 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Dereferencing...
Message-Id: <adelton.858870827@aisa.fi.muni.cz>

"Rudy Ruiz" <rruiz@cybercities.com> writes:


> 	I have a small problem here..
> 
> snippet starts here>>
> 	
> 	$ptr = \@somearray;
>             &somefunction($ptr);
> 
> snippet ends here>>
> 
> 	How do I dereference $ptr inside the sub routine??
> 	@_[0] contains the address of @somearray but how do I view the contents
> 	in that address?

Actually, $_[0] is what contains the address. So you simply do

sub somefunction
	{
	my $arrayptr = shift;
	$$arrayptr[0] is the first element of @somearray ...
	
Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Thu, 20 Mar 1997 09:29:45 +0000
From: Paul Cunnell <pcunnell@csfp.co.uk>
To: Robert Schuldenfrei <sailboat@tiac.net>
Subject: Frame -> HTML conversion (was Re: /RE/ for Dummies - Match all caps)
Message-Id: <33310389.4F42@csfp.co.uk>

[mailed & posted]

Robert Schuldenfrei wrote:
> 
[...]
> Thank you Tom.  It is an honor to get help from a SUPERSTAR.  BTW, this is part
> of a conversion process which takes FrameMaker 1.0 mml files and converts them
> to html.  While my needs are quite modest, I have a whole shelf of manuals to
> convert.  The thought of doing it by hand leaves me cold.  Is there a collection
> of perl scripts or /RE/ put together somewhere to be of aid in conversion from
> one markup language to another?  Yes, I guess the definition of awk and perl is
> such a collection, but a book, website, or other repository would be a big help
> in my study.

If you're converting Frame to html, then there are a number 
of things you might want to look at - as you suspect, this wheel
has been reinvented a few times:

- mifmucker is a perl script which can be used to munge Frame MIF files
into
  just about anything (AltaVista can probably find it - I can't remember
offhand,
  though I probably have a copy around somewhere if you're desparate :)

- If you're prepared to pay (a small amount of) money, then the
Harlequin
  WebMaker product seems pretty robust: http://www.harlequin.co.uk

- there's also fm2html, which as far as I recall is a bit like WebMaker, 
  but free and not as neato (again, AltaVista can probably find it).

HTH

-- 
Paul Cunnell CSFB RDG (pcunnell@csfp.co.uk) +44 171 888 2946


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

Date: 20 Mar 1997 12:03:28 GMT
From: "Jonathan Barry Neufeld" <jneufeld@rapidnet.net>
Subject: Getting Perl 5
Message-Id: <01bc3527$938b2e20$ae49c2cf@ocoi>

How can I get a Perl 5 compiler and a documentation for it?

-- 
Jonathan B. Neufeld
Solar Tech Enterprises and Consulting
NT-Online Technologies:
http://www.ntonline.com
Ph: 793-3657  Fax: 793-3659


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

Date: 20 Mar 1997 11:25:30 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Jonathan Barry Neufeld" <jneufeld@rapidnet.net>
Subject: Re: Getting Perl 5
Message-Id: <8clo7io1yd.fsf@gadget.cscaper.com>

In one message...

>>>>> "Jonathan" == Jonathan Barry Neufeld <jneufeld@rapidnet.net> writes:

Jonathan> How can I get a Perl 5 compiler and a documentation for it?

and in the next message...

>>>>> "Jonathan" == Jonathan Barry Neufeld <jneufeld@rapidnet.net> writes:

Jonathan> I am curious to know what some people will charge at an
Jonathan> hourly rate for their programming services in specifically
Jonathan> Perl.  I ask mainly because I am not entirely sure what to
Jonathan> charge my boss for Perl programming.

Well, given that you asked the first question to the entire net, and
apparently did very little research on your own, I'd say about $3/hr.
Wait, that's below new federal minimum wage.  Better make it $6/hr.

(Just being silly, but I hope you get my point...)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 529 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: Thu, 20 Mar 1997 07:06:59 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Here Document ....How in Perl ????
Message-Id: <jpcrg5.7q.ln@localhost>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On Wed, 19 Mar 1997, Ronak Bhatt wrote:

: > From: Ronak Bhatt <rbhatt@netscape.com>
: > Subject: Here Document ....How in Perl ????

: I strongly suspect that your Perl documentation has something to help you.


[ hint: search for 'here-doc' in the perldata man page ]


: And since you're from Netscape, you may benefit from being able to access
: it in many forms, including HTML. If whoever set up Perl for you didn't
: make the docs easily accessable, complain. Good luck!


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


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

Date: Thu, 20 Mar 1997 07:09:42 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to edit the data in a file?
Message-Id: <mucrg5.7q.ln@localhost>

Opera Ghost (agent.email@NetTown.com) wrote:
: oops...

: should be
: open FILE, ">$outfile";


oops...

should be

open FILE, ">$outfile" or die "could not open '$outfile'  $!";



ALWAYS check return values...    ;-)


: so very sorry about that trailing >

: the important part is > is used for opening a file for write.
: like >> is for appending.


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


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

Date: 20 Mar 1997 07:27:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how2 run perl on win 3.11 system??
Message-Id: <5gqoss$n30$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    rubinm@aztec.asu.edu writes:
:I'd like to develop perl app on my windows 3.1/486 machine.  Would be
:most grateful for instructions on how to get started.  

Simple:

    Rule 1: upgrade to Linux
    Rule 2: install perl if it wasn't on your install kit
    Rule 3: type perl

Some would point out that you could also install win95 or winNT
at rule 1, but I prefer my version.  It's cheaper and more useful. :-)

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

    "Just because something is obviously happening doesn't mean something obvious
    is happening." --Larry Wall


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

Date: 20 Mar 1997 21:04:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: join <--> split with delimiter in variable
Message-Id: <5gs8p9$1n7$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    John Strickler <jstrick@mindspring.com> writes:
:The problem is that the delimiter for split() is not a single character,
:but a 
:regular expression. For this reason, the first argument to split is
:generally 
:enclosed in forward slashes. The pipe char ('|') is a metacharacter in
:REs,
:meaning, approximately, "or", so split() is a little confused. In a
:literal pattern,
:you could backslash or use q() to quote the pipe; but with a variable,
:you need
:to use the quotemeta function like this:

That's a fair analysis, but whatever you're using for a newsreader
is a piece of crap, generating ugly-issimo posting -- see the quoted
text above.  If you were to replace or fix it, you would be able
to generate postings that were much nicer to read, and all of our
eyes would benefit.

:        ($v1,$v2) = split(/qm($Delimiter)/,$some_string);

Whoops!  You've made up that qm() thing.  It's a figment.  You meant \Q.

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

#ifdef USE_STD_STDIO    /* Here is some breathtakingly efficient cheating */
    --Larry Wall, from sv.c in the v5.0 perl distribution


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

Date: 20 Mar 1997 11:43:47 GMT
From: "Jonathan Barry Neufeld" <jneufeld@rapidnet.net>
Subject: Making Money From Perl!
Message-Id: <01bc3524$d93bc900$ae49c2cf@ocoi>

I am curious to know what some people will charge at an hourly
rate for their programming services in specifically Perl.  I ask mainly
because I am not entirely sure what to charge my boss for Perl
programming.

Thanks for your time...

-- 
Jonathan B. Neufeld
Solar Tech Enterprises and Consulting
NT-Online Technologies http://www.ntonline.com


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

Date: 20 Mar 1997 08:29:23 GMT
From: Steve_Kilbane@cegelecproj.co.uk
Subject: Re: Need to extract the text from Microsoft Word 6 files
Message-Id: <5gqsh3$kgj$1@jupiter.sdd.cegelecproj.co.uk>

In article <Pine.GSO.3.95q.970319151732.17596C-100000@kelly.teleport.com>, Tom Phoenix <rootbeer@teleport.com> writes:
> > Subject: Need to extract the text from Microsoft Word 6 files
> 
> If somebody has a module which does this in Perl, it should be on CPAN. If
> it's not, you're welcome to make and submit one. Thanks!

If someone *is* considering writing such a module, might I suggest that
it be geared to the forthcoming release of Perl? The reason for this
is that such a module would be most useful if it ran on both UNIX
and M$ Windows platforms (and any others....). The current
releases knocking around for M$W platforms are lacking a little
in the library side, which makes it hard to install some otherwise
excellent packages.

steve
-- 
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
Kilbane's law of integration: standardise on protocols and file
formats, and the applications take care of themselves.


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

Date: Thu, 20 Mar 1997 13:12:01 -0500
From: Levi Wallach <lwallach@pobox.com>
Subject: NT and dates
Message-Id: <33317DF1.6743@pobox.com>

I remember seeing a library a while back that allows you to use insert
dates in NT Perl.  If anyone knows where I can get this or has another
work-around, I would be grateful!  Please email me.

--
_______________________________________________________________________
Levi Wallach                                         lwallach@pobox.com
PGP Public Key 0x0FF4E3C5 1996/10/17  at http://www.pobox.com/~lwallach
_______________________________________________________________________



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

Date: 20 Mar 1997 06:44:01 -0600
From: Kevin Huber <Kevin.T.Huber@cdc.com>
Subject: Re: Opening files in subdirectories
Message-Id: <k9n2zqb2.fsf@khuber.arh.cdc.com>

"Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:

> Um, you *did* read 
>     http://www.perl.faq/perl/faq/idiots-guide.html
> Didn't you?

I think Tom meant http://www.perl.com/perl/faq/idiots-guide.html.

-Kevin


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

Date: 20 Mar 1997 07:30:47 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: overloading operators?
Message-Id: <5gqp37$n30$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Phil Sallee <phil@irvine.com> writes:
:Does anyone know of a way to overload operators in Perl?  Other
:object oriented languages such as C++ or Ada allow you to do this,
:but I haven't found a way to do this in Perl yet.  How do you allow
:objects to be manipulated using standard operators?  
:
:Is this a feature that might be added in a future release of 
:Perl maybe??

Type "man overload".  If that doesn't work, complain to your
negligent sysadmin and then lookup this instead:

    http://www.perl.com/CPAN/doc/manual/html/lib/overload.html

While you're at it, read

    http://www.perl.com/CPAN/doc/manual/html/pod/perltoot.html

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

    Be consistent.
            --Larry Wall in the perl man page 


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

Date: Thu, 20 Mar 1997 11:44:11 +0100
From: domo@tcp.ip.lu (Dominic Dunlop)
Subject: Re: Perl 100 times slower ...
Message-Id: <19970320114411589144@dialup16.ip.lu>

Premkumar Natarajan <pnataraj@emerald.tufts.edu> wrote:
> Is this usual or does your instinct suggest that some obvious optimizing
> is required ?

Yes.  If you can isolate the costly bit of your script, and post it to
this group with a "how should I optimize" question, I'm sure you'll get
the help you need.  (Although be warned that it's hard to make
math-intensive stuff go particularly fast without heavy-duty help from a
C-language add-on module.)  If you have Programming Perl, 2nd edition
(and probably you should have it), you might like to check out the
section on efficiency before you post so as to avoid the possibility of
accusations of dumbly pessimal programming.  Or you can experiment
yourself, with the aid of the Benchmark module.

Unless you have strong geekish tendencies, do that before you bother to
look at the perl source or check out the perl compiler -- whatever
"Opera Ghost" may have suggested in his followups.  If you do have
geekish tendencies, you might also like to investigate what the -D
option to perl an tell you.  (Although you need a perl built with
debugging enabled in order for it to tell you anything at all.)
-- 
Dominic Dunlop


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

Date: 20 Mar 1997 09:04:34 +0100
From: Jonny Birkelund <jonnyb@omni.uio.no>
Subject: Re: perl-binaries for aix1.3
Message-Id: <pd8pvwvugz0.fsf@omni.uio.no>

Tom Phoenix <rootbeer@teleport.com> writes:

> On 19 Mar 1997, Jonny Birkelund wrote:
> 
> > I'm looking for binaries for aix1.3
> 
> It's almost always better to compile Perl yourself. Have you tried? It's
> easier than you might think. Hope this helps!

I would be glad to do it by myself but the problem is: IBM could't
help me with CC compiler for this version of AIX. (they have stopped
supporting it). 
I'm really desperate so any hints where I can get binaries is very
welcome.

/Jonny


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

Date: Thu, 20 Mar 1997 09:23:18 +0100
From: rudolf@metadesign.de (Jim Rudolf)
Subject: Re: Problems with flock()
Message-Id: <rudolf-2003970923180001@jim.metadesign.de>


Tom Phoenix <rootbeer@teleport.com> wrote:

> Many (most?) vendors' implementations of flock make the assumption that
> there's no need to lock the file if you're not going to be changing it. If
> you want to flock, you should open with write access.

But if they provide shared/exclusive functionality in their flock(),
then it ought to work, regardless of what my intentions are, right?

> Also, unless you know what you're doing, don't use shared locks. Use
> exclusive locks, something like this.

I don't understand why you recommend avoiding shared locks.  Both kinds
of locks have a distinct purpose.  With a shared lock, many processes
can read a file and know that it won't be over-written while they are
reading it.  A process that wants to write to the file uses an exclusive
lock so it knows that no one is reading it, and no one can read it as
long as it is being modified.  I can of course solve the problem only
with exclusive locks, but that's likely to be slower, since many processes
that could be simultaneously reading a file must instead queue for read
access.

Cheers,

Jim


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

Date: 20 Mar 1997 12:20:55 GMT
From: kodis@kodis.jagunet.com (John Kodis)
Subject: Re: Q: How to search _VERY_ long scalars for recurring patterns?
Message-Id: <slrn5j2at7.se9.kodis@kodis.jagunet.com>

Previously, Kenneth W. Lee wrote:

>How do you process an _extremely_ looooong scalar file
>(i.e. a 3 meg ascii text file with no newlines) that has 
>a unique recurring regexp?  (Imagine a very large
>fixed-length ascii table... and now imagine that
>that table has all the newline characters removed...yuck)

I've solved that exact problem by simply running the single-line file
through the unix `fold' program which inserts newlines periodically to
transform it back into a more normally-formatted multi-line text file.
This simplifies subsequent processing enormously.  You could also do
this in Perl itself by opening a fold pipeline for the process to read
from, thusly:

	open LINE_ORIENTED, "fold -$line_length $one_line_filename |"

Of course, the real mystery here is why anyone in their right mind
would format a file in such an unusable manner in the first place.

-- John Kodis.



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

Date: Thu, 20 Mar 1997 08:02:45 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Q: How to search _VERY_ long scalars for recurring patterns?
Message-Id: <52grg5.251.ln@localhost>

John Kodis (kodis@kodis.jagunet.com) wrote:
: Previously, Kenneth W. Lee wrote:

: >How do you process an _extremely_ looooong scalar file
: >(i.e. a 3 meg ascii text file with no newlines) that has 
: >a unique recurring regexp?  (Imagine a very large
: >fixed-length ascii table... and now imagine that
: >that table has all the newline characters removed...yuck)


: Of course, the real mystery here is why anyone in their right mind
: would format a file in such an unusable manner in the first place.
                                 ^^^^^^^^^^^^^^^

It's perfectly usable for a computer. I expect it was intended to
be used by a computer.

The concept of 'lines' is just a convenience for humans...


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


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

Date: Thu, 20 Mar 1997 01:36:28 -0500
From: John Strickler <jstrick@mindspring.com>
Subject: Re: Q: How to search _VERY_ long scalars for recurring patterns?
Message-Id: <3330DAEC.157326D7@mindspring.com>

Kenneth W. Lee wrote:
> 
> Hi,
> 
> How do you process an _extremely_ looooong scalar file
> (i.e. a 3 meg ascii text file with no newlines) that has
> a unique recurring regexp?  (Imagine a very large
                     ^^^^^^ do you mean pattern? It seems unlikely that
your file 
                            contains REs
> fixed-length ascii table... and now imagine that
> that table has all the newline characters removed...yuck)
> 
> For simplicity, consider the example:
> 
>    FOO 12345 FU
>    BAR 67890 MN
>    FOO 12345 CH
>    ...
> 
> that is mysteriously changed to:
Not so mysterious; mainframes routinely have fixed-length records.
> 
>    FOO 12345 FU BAR 67890 MN FOO 12345 CH ... ad naseum
> 
> ($wc -l will return a value of zero)
As it should, since wc counts newlines.
Are you trying to find out how many runs of your pattern are in 
the file? If so, get the size of the file with stat()
and divide by 12. You don't actually need Perl for this, of
course:

 ls -l  yourfile | awk '{ print $5/12 }' # any UNIX shell cmd line


> Is there a method of parsing this long scalar to return
> the length of the unique pattern /\w{3}\s\d{5}\s\w{2}/?
Hmmm. The length of the pattern is "12". 
> I've looked in the pink and blue camels, the big how-to,
> as well as the man pages.  (I'm running perl5 on SunOS
> 4.1.3)  This is driving me nuts!

I'm not sure what you're looking for in that >=3MB file, but
if all the patterns are the same length, try

open(F,"your_file") or die("oops: $!\n");
while (read(F,$buf,12) {
   # this loop reads 12 bytes at a time from your file, which could
   # be 57 terabytes, if you want. 
   print "$buf\n";   # 1st time through prints "FOO 12345 FU"
                            # 2nd time prints "BAR 67890 MN", etc etc
}

HTH!

--
John Strickler --  Perl/UNIX/C Trainer, Consultant
Jeffersonian Consortium            Voice:     919-682-3401     
HTTP://WWW.JCINC.COM               Facsimile: 919-682-3369


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

Date: 20 Mar 1997 12:11:10 GMT
From: "Jonathan Barry Neufeld" <jneufeld@rapidnet.net>
Subject: QUESTIONNAIRE FOR PERL GURUS
Message-Id: <01bc3528$adc71280$ae49c2cf@ocoi>

Hi, my name is Jonathan Neufeld and I am very curious of how
people get into Perl, learn it, and use it in the future.  I would like
to have this information that I might see what the road of Perl is
going to be like before I set out on it.

If you would take the time to answer a couple of questions I think
you'll greatly enlighten many people including me!  So let's get
started:

1.  How long have you been programming in Perl?
2.  What made you start learning Perl?
3.  What has learning Perl been like for you? i.e. troubles etc.
4.  How has Perl changed your outlook on programming?
5.  For what applications do you use Perl?
6.  Overall what is your general opinion of Perl?

Thank you for your time, it is greatly appreciated by many and I
hope to conference with you some time in the future.

-- 
Jonathan B. Neufeld
Solar Tech Enterprises and Consulting
NT-Online Technologies:
http://www.ntonline.com
Ph: 793-3657  Fax: 793-3659


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

Date: Thu, 20 Mar 1997 14:03:51 -0500
From: b.wilkinson@NOSPAM.pindar.co.uk (Bob Wilkinson)
Subject: Re: Recognizing spaces
Message-Id: <b.wilkinson-2003971403510001@ip57-york.pindar.co.uk>

In article <3330830E.47C5@sybex.com>, mriggsby@sybex.com wrote:

deleted explanation

>Any ideas what I'm missing?
 
text::wrap.pm ?

Bob

-- 
I have become death, destroyer of the worlds.


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

Date: Thu, 20 Mar 1997 10:27:55 -0800
From: Micah Potechin <mipotech@novice.uwaterloo.ca>
Subject: Response headers (cont'd)
Message-Id: <33317F3C.7486@novice.uwaterloo.ca>

I forgot to mention that I was talking to someone earlier who told me
that I am not sending a proper response header.  Any ideas?


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

Date: 20 Mar 1997 10:02:51 GMT
From: "Jonathan Tracey" <jont@uunet.pipex.com>
Subject: Running Dos Programs from within Perl For NT
Message-Id: <01bc3516$01661070$0600000a@salmon>

How can I execute a dos program from within a Perl script running under
windows NT?

Thanks 

Jon.............


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

Date: Thu, 20 Mar 1997 13:30:46 -0500
From: "John W. St. Clair" <stclairj@erols.com>
Subject: stat file $mode anomaly?
Message-Id: <33318256.DA7@erols.com>

Hello,

     Can anyone out there tell me why when I call the
stat function on a file, and look at the $mode field, the file 
permisson returned (in decimal) is off by +32,768??

For example; a file with permissions of -rwxr-xr-x will return
a value for $mode of 33261.  33261-32768==493.  493(10)==755(8),
or 755 in octal.  Strange!

I've tried this in Perl 5.001 and 4.036 under Solaris, NeXTSTEP,
Linux, and DEC Unix, with the same result every time.

ANY ideas?  Just curious....

Please reply via e-mail, and right here, if you prefer.

John W. St. Clair
stclairj@erols.com


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

Date: 20 Mar 1997 17:59:37 GMT
From: samuell@cis.uab.edu (R L Samuell)
Subject: strange error using anonymous arrays under Solaris but not OS/2
Message-Id: <5grtu9$tf2@juniper.cis.uab.edu>


I developed a set of Perl code examples under Perl5.003 under OS/2 4.0
for use in a Perl course I recently taught.  When I tested them before
class under Perl5.000 under Solaris 5.5, I got a strange error message.

I have distilled the set of examples down to the following script which
when I run it:


#!/ra/local/bin/perl
goto EXAMPLE;
$N = \6; $S = \'six'; $B = [3,4];
EXAMPLE: # references - anonymous arrays
print "A pair of enclosing [brackets] is used to compose an anonymous\n",
  "  array, that is, an array with only a reference and no other name.\n";
print "Anonymous arrays can be used to define multidimensional arrays.\n";
@MA = ([0,0,0,0],[0,1,2,3],[0,2,4,6],[0,3,6,9]);
print "  By creating an array of references, we get the desired\n",
  "    appearance of a 2D array yielding ",$MA[3][2]," for 3 times 2.\n";
exit;
__END__


I get the following the error message:

Modification of non-creatable array value attempted, subscript -697805 at examp 
line 9.                                                                         

If I remove only the assignment to $N or $S, the code works.

What is going on here?

Thanks in advance for any clues.



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

Date: 20 Mar 1997 09:47:42 GMT
From: jacobus@pasteur.up.ac.za (Jacobus Erasmus)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5gr13u$b47@kendy.up.ac.za>

M. Prasad (prasadm@not4u.polaroid.com) wrote:
: Iggy Drougge wrote:
: > 
: > >>> Unix appeals more to me and is more advanced technically, but I am
: > >>> afraid that it is losing the market share to Windows 95.

: > >Unix is more advanced technically?  That's interesting.  The last time
: > >I installed a modem on Windows NT the OS found it for me.  The last
: > >time I tried it on Unix I read about the nine files one had to edit,
: > >then gave up.   It seems to me that Unix is losing market share
: > >precisely because end users never make the programmer's mistake of
: > >confusing technical advancement with obtuseness.
I always thought that how easy you setup a external device has something to do
with user friendliness. Ah well ?! On my REDHAT linux installation modem setup
wasn't really a major problem ?  

There is a fundamental design difference. Windows has been design from the
beginning to be maintained by novices that why everything sets up
automatically. This is very nice if you don't want to tweak your computer.
Unfortunately Unix was designed to have a Administrator that manages the
system. A person that know how to operate a computer. 

For me as an administrator it is much easier administrating UNIX machines than
NT machines. For that matter any other operating system. 

There is one interesting thing about support and that is so what Windows is
easier to setup. It's faster to setup. Unix is harder to setup and takes
longer. 

The main difference is I need to setup my application once for my 500 UNIX
users but I have to setup my application 500 times for my Windows users. Which
one would you choose. Just asking. UNIX has all the facilities that Windows
has and more. Caldera and some other companies is working hard to make it just
as easy to setup and maintain as Windows. Check out Caldera Open Linux if you
want to see the type of work being done. 

LINUX is getting there faster than most people realize and I'll install it on
my users machines the moment I think it's ready.

Cu
jacobus@medic.up.ac.za


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

Date: Wed, 19 Mar 1997 10:52:59 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: What's a good Perl book?
Message-Id: <fl_aggie-ya02408000R1903971052590001@news.fsu.edu>

In article <slrn5ipmbh.9nu.jgoerzen@complete.org>, jgoerzen@complete.org
(John Goerzen) wrote:

+ On Tue, 11 Mar 1997 19:37:15 -0600, Tad McClellan <tadmc@flash.net> wrote:

+ >"Programming Perl" by Larry Wall, Tom Christiansen and Randal Schwartz
 
+ Let us not forget that it is important to get the **second edition** of this
+ book!

Ah, now would the first edition be considered a 'dead, flea-bitten camel
carcass'? :)

James - and for whoever started this thread: there is no such newsgroup
        as comp.lang.perl!!!

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Sun, 16 Mar 1997 20:37:56 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Win32: How to use a MessageBox or Dialog
Message-Id: <E75LB9.FsK@cix.compulink.co.uk>

Achim Bursian <ea1217@fen.baynet.de> wrote:

> I'd like to get some userinput through a windows dialog in Perl for 
> Win32.

As far as I can tell, you can't The Win32 module doesn't include any such 
calls.

John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked: 
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, Perl for 
NT/Win 95 can be found at http://www.activeware.com, with an excellent 
FAQ file at 
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html and no, 
I don't have the slightest idea what's wrong with your CGI script. Try 
http://www.perl.com/perl/faq/idiots-guide.html


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

Date: Thu, 20 Mar 1997 07:43:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ~INTERVIEW FOR ALL PERL GURUS
Message-Id: <7uerg5.n01.ln@localhost>

Jonathan Barry Neufeld (jneufeld@rapidnet.net) wrote:
: Hi, my name is Jonathan Neufeld and I am very curious of
: how people get into Perl, 
  ^^^^^^^^^^^^^^^^^^^^^^^^

You get the 'rhythm' of the language pounding in your head 
(according to Randal ;-)


: learn it, 

There is a *whole bunch* of free documentation available:

1) the '.pod' files (Plain Old Documentation)
   these are included with the perl distribution

2) the new Perl FAQs

3) http://www.perl.com


Also, it would be a Good Idea to get "Learning Perl" by Randal Schwartz.
http://www.ora.com



: and use it in the future...


If you 'use it in the future' you aren't using it.

Use it _now_   ;-)



: If you would take the time to answer a couple of questions I think
: you'll greatly enlighten many people including me!  So let's get
: started:

: 1.  How long have you been programming in Perl?


Two and a half years.


: 2.  What made you start learning Perl?


Someone asked "what book should I buy to learn shell scripting"
on the comp.unix.questions newsgroup.

One answer said "don't bother, just learn Perl instead"

So I did. The answerer was right. I have not written a shell script
since learning Perl. (I have very seldom written a C program since
learning Perl either)


: 3.  What has learning Perl been like for you? i.e. troubles etc.


Piece of cake. Though this is likely because I had many years of
programming experience in other languages, as well as years of
using regular expressions.

"Learning to program" is the difficult part. Once that is done, 
"learning Perl" is not much of a leap.


See also, from the aforementioned FAQ (part 1):

=head2 Is Perl difficult to learn?


: 4.  How has Perl changed your outlook on programming?


I find that spending an hour to type in 200 lines of program in
a "high level assembly language" (such as C/lex) is no longer 
something I like to do.

Now I prefer to type 20 lines of Perl in 10 minutes  ;-)


: 5.  For what applications do you use Perl?


Munging SGML text.

Writing CGI scripts.

Analysing data.

Anything I would have written a shell script to do.


: 6.  Overall what is your general opinion of Perl?


It the greatest (what opinion did you expect from a Perl newsgroup ;-)

It may lead to a new religion or something...



: Thank you for your time, it is greatly appreciated by many and I
: hope to conference with you some time in the future.

If you get many responses to your questions, I would encourage you
to contribute to the newsgroup yourself by posting a summary of the
collected answers.


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


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

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

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