[7075] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 704 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 21:17:21 1997

Date: Mon, 7 Jul 97 18:09:51 -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, 7 Jul 1997     Volume: 8 Number: 704

Today's topics:
     send any kinf od file to browser... <serginho@alpha.hydra.com.br>
     Sharing Data btwn XS C calls <jheck@merck.com>
     Shellscript -> perl (Christopher Shane Adams)
     Re: Shellscript -> perl <bat@unifi.com>
     Re: SIGCHLD handler not being called consistently (Jonathan Rozes)
     Re: Sorting many hashes <sfairey@adc.metrica.co.uk>
     Re: Source code comparison - know of a tool? <jkeller@gridnet.com>
     Re: Source code comparison - know of a tool? <rpsavage@ozemail.com.au>
     Re: Storing a hash of arrays of arrays with SDBM (Jeff Stampes)
     Strange bug when blessing rick@infomechanics.com
     Re: Strange bug when blessing <rootbeer@teleport.com>
     Re: strange problem... <serginho@alpha.hydra.com.br>
     Re: string to integer HELP !! (Carsten Schabacker)
     Tainted problem <oliver@inetu.net>
     Testing Perl <jcoursey@sed.nist.gov>
     Re: Testing Perl (Tad McClellan)
     Re: Testing Perl <rootbeer@teleport.com>
     TIMES function <qwu@xyplex.com>
     Re: TOP 5 REASONS FOR SWITCHING TO PERL <dwc3q@mamba.cs.Virginia.EDU>
     Re: TOP 5 REASONS FOR SWITCHING TO PERL (Kyzer)
     Re: tracing perl (M.J.T. Guy)
     Re: tree of a local site (Steffen Beyer)
     Re: Trouble with Split command <rootbeer@teleport.com>
     unprintable chars <rferr@voicenet.com>
     Re: unprintable chars <rootbeer@teleport.com>
     URL counter? (Jeff Davis)
     Re: URL counter? <rootbeer@teleport.com>
     Re: Use of the FTP library from the CPAN archive <bat@unifi.com>
     Using SFIO with perl5.004 on NT (Ronald E. Fortin)
     Re: using system <rootbeer@teleport.com>
     Variables Question (Dave Rapchun)
     Re: Variables Question <rootbeer@teleport.com>
     Re: Want benefit of 'my' variables in a package <aas@bergen.sn.no>
     Re: What does <<END do? (Tung-chiang Yang)
     Re: What does <<END do? (Tung-chiang Yang)
     Re: What does <<END do? (Tad McClellan)
     Re: What does this do? <jhinkle@rockisland.com>
     Re: When was PERL created? ("John Dallman")
     Re: When was PERL created? (brian moore)
     Re: When was PERL created? (Bart Lateur)
     Re: When was PERL created? (Hekan Lindholm)
     Re: WIN32 Perl head aches! (Michael Adams)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 4 Jul 1997 13:18:07 GMT
From: "Sergio Stateri Jr" <serginho@alpha.hydra.com.br>
Subject: send any kinf od file to browser...
Message-Id: <01bc887d$22828580$6875e7c8@Term104>

Hi! How can I send any kind of file to browser ? I know that, if I want to
send a gif image for a IMG tag, I'll have to send "content-type:
image/gif", ... But, if I don't know the kind of file ? Per example, I've
an array with a directory files, And I want to send any file to browser (an
exe, per example). How Can I do this ?

thanks in advance!

-- 
--------------------------------------------
Sergio Stateri Jr
Sco Paulo (SP) - Brazil
e-mail: serginho@usa.net
--------------------------------------------


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

Date: Mon, 07 Jul 1997 16:54:13 -0400
From: "James J. Heck" <jheck@merck.com>
Subject: Sharing Data btwn XS C calls
Message-Id: <33C15775.41C6@merck.com>

I have a fairly large set of C functions within a library.  I am trying
to make calls to certain C functions withing the library, return to
Perl, then make calls to other C functions in the same library.  
	My dilemma is that it seems like the data that each calls makes/uses is
held separate from the subsiquent calls to the other functions.  
	A quick description:
	
	Perl calls a "read" function, the C "read" populates a C data structure
and returns a pointer (T-PTR) to the perl function.  
	Perl calls another function, "getfield", which should search the C data
structure that was populated by the "read", and return the value of the
secified field asked to get.  It seems that the "get" has no knowledge
of the large C data structure that "read" created.  

	I would like to avoid passing the "get" function the pointer returned
from the "read".  Is there anyway this can be done?

	I have read all of the documentation that seemed relavent, however I am
welcome to any references that I might have overlooked.

	Thanks again.

James J. Heck

--------------------
James J. Heck
jheck@acm.org
http://www.bucknell.edu/~jheck


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


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

Date: 7 Jul 1997 21:01:38 GMT
From: adamsch1@cps.msu.edu (Christopher Shane Adams)
Subject: Shellscript -> perl
Message-Id: <5prlfi$j6q$1@msunews.cl.msu.edu>

  Is there a utility that will convert shellscripts to perl?


--
  God is Real unless declared as an Integer.
  Someone famous once said:
    I don't believe in God, but I'm scared of him.


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

Date: Mon, 07 Jul 1997 17:12:41 -0400
From: Boris Tabenkin <bat@unifi.com>
To: Christopher Shane Adams <adamsch1@cps.msu.edu>
Subject: Re: Shellscript -> perl
Message-Id: <33C15BC9.AE082503@unifi.com>

This is a multi-part message in MIME format.
--------------74F097A358493E927B9123D8
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

No,

    The nature of shell scripts (bourne and the like) to use external
programs such as SED, AWK, etc., makes it very hard to translate to
PERL. You can , however translate SED, AWK, and FIND to PERL. I found
that simply re-writting things in PERL on per-needed basis works fairly
well.

Christopher Shane Adams wrote:

>   Is there a utility that will convert shellscripts to perl?
>
> --
>   God is Real unless declared as an Integer.
>   Someone famous once said:
>     I don't believe in God, but I'm scared of him.



--------------74F097A358493E927B9123D8
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Boris Tabenkin
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Boris Tabenkin
n:              ;Boris Tabenkin
email;internet: bat@unifi.com
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
end:            vcard


--------------74F097A358493E927B9123D8--



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

Date: 7 Jul 1997 19:38:17 GMT
From: jrozes@gumbo.tcs.tufts.edu (Jonathan Rozes)
Subject: Re: SIGCHLD handler not being called consistently
Message-Id: <5prgj9$j4u$2@d2.tufts.edu>

In article <5prgd9$j4u$1@d2.tufts.edu>,
	jrozes@gumbo.tcs.tufts.edu (Jonathan Rozes) writes:

> When I run this, my signal handler only gets called once, sometime twice.
> If I do waitpid($pid,0) instead of a nonblocking waitpid, the handler
> gets called every time. When I run the script on an IRIX 5.3 box, I get
> expected results with either form of waitpid.
> 
> I get the same results under 5.004_01, or if I recompile either version
> with compiler optimizations disabled.

To clarify: I get the same inconsistent calls to the handler when using
5.004_01 or an unoptimized interpreter, not the same results as I get on
the IRIX machine.

jonathan
-- 
+++ Jonathan Rozes, Unix Systems Administrator, Tufts University
++  jrozes@tcs.tufts.edu, http://rozes.tcs.tufts.edu/
+   Remember, there's a difference between kneeling down and
    bending over --FZ


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

Date: Mon, 07 Jul 1997 17:36:26 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: mallozzi@ssl.msfc.nasa.gov
Subject: Re: Sorting many hashes
Message-Id: <33C11B0A.446B@adc.metrica.co.uk>

mallozzi@ssl.msfc.nasa.gov wrote:
> 
> Hello everyone,
> 
> I have a set of DBM files that I would like to sort based on a key/value
> in each of the hashes.  How can I sort the hashes based on a value in
> each hash?  Specifically, each hash contains a date field, and I would
> like to read all the DBM files from disk, sorting based on the date field
> in each hash.  Thanks,
> 
> -bob mallozzi
> mallozzi@ssl.msfc.nasa.gov

This is covered perfectly in the perl FAQ at www.perl.com under

How do I sort a hash (optionally by value instead of key)?

Simon


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

Date: 3 Jul 97 18:45:48 GMT
From: "John Keller" <jkeller@gridnet.com>
Subject: Re: Source code comparison - know of a tool?
Message-Id: <01bc87e1$6eaf39e0$4fa150ce@jkeller.gridnet.com>

I took CS classes at Georgia Tech, and was repeatadly told that a Grad
student had written a world-class cheater spotter. It supposedly worked by
analysing the loop structures in programs after stripping out all comments
and reassigning all variables generic names. You could try contacting
someone in the College of Computing at GT by emailing someone off the
http://www.coc.gatech.edu web pages.

Good luck.
JK


Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote in article
<5pgg9r$h1$1@news.netusa.net>...
> Tom Phoenix  <rootbeer@teleport.com> wrote:
> > On Thu, 26 Jun 1997, Simon Goland wrote:
> > > I am looking for a tool/utility/script (partial or complete) that
will
> > > compare various programs in C/C++/Java and tell me how closely they
> > > resemble each other. I teach these programming courses, and would
like
> > > to get an accurate estimate of "program resemblance" when checking
the
> > > assignments of my students... because some programs look way too
similar
> > > to each other. 
> 
> Heh. I remember taking a programming class where that was one of the
> assignments. Write a program that checked for similarity between code
> samples irrespective of identifier names and comments. Fairly simple
> to do poorly. Doing it well involves some work.
> 
> Try assigning it to put the fear of god in them. :^)
> 
> > And of course, that's a sign that one of your students is destined
> > to work for Microsoft, right? 
> 
> Probably not. Microsoft takes the ideas and codes them in a much
> more bloated and buggy fashion, then calls it progress.
> 
> Elijah
> ------
> highly amused by the recent spate of Macro$loth security scandals
> 


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

Date: Fri, 04 Jul 1997 09:27:31 +1100
From: Ron Savage <rpsavage@ozemail.com.au>
Subject: Re: Source code comparison - know of a tool?
Message-Id: <33BC2753.4B8D@ozemail.com.au>

> | I am looking for a tool/utility/script (partial or complete) that will
> | compare various programs in C/C++/Java and tell me how closely they[snip]

Microsoft's VC++ V5 CD-ROM contains the source of WinDiff.


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

Date: 5 Jul 1997 18:33:42 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Storing a hash of arrays of arrays with SDBM
Message-Id: <5pm426$lq8$1@neocad.com>

Joseph M. Hnkle (jhinkle@rockisland.com) wrote:
: Can someone suggest the right way to get SDBM to store a hash of an
: array of arrays?
: (Or hashes of hashes of hashes)
: possible in the notation, I still can't do it.

: Any suggestions?

>From the perl FAQ:

How can I store a multidimensional array in a DBM file?

Either stringify the structure yourself (no fun), or else get the
MLDBM (which uses Data::Dumper) module from CPAN and layer it on 
top of either DB_File or GDBM_File.



--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Mon, 07 Jul 1997 11:13:43 -0600
From: rick@infomechanics.com
Subject: Strange bug when blessing
Message-Id: <868290194.5823@dejanews.com>

I have a largish perl program which has been running for some time that
has developed a most perplexing bug under perl 5.004 built using the
SUN compiler.  The following (incredibly simple) code segment:

$self = {};
bless $self,$class;

occasionally results in the situation where ref($self) ne $class.
ref($self) is a valid class, but it is not related (in an @ISA sense) to
the class named $class.  This code is being invoked within an AUTOLOAD
which is within an eval (which actually is within yet another eval).  If
anyone has seen something similar or can shed even a modicum of light on
this problem, I would be most appreciative.

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


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

Date: Mon, 7 Jul 1997 10:28:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: rick@infomechanics.com
Subject: Re: Strange bug when blessing
Message-Id: <Pine.GSO.3.96.970707102302.9019c-100000@kelly.teleport.com>

On Mon, 7 Jul 1997 rick@infomechanics.com wrote:

> I have a largish perl program which has been running for some time that
> has developed a most perplexing bug under perl 5.004 built using the SUN
> compiler.  The following (incredibly simple) code segment: 
> 
> $self = {};
> bless $self,$class;
> 
> occasionally results in the situation where ref($self) ne $class.

That's odd. Can you change it to look like this? This might give a little
diagnostic information.

    $self = {};
    bless $self, $class;
    warn "bless failure ($self, $class, @{[ ref($self) ]})"
	unless $class eq ref($self);
    $self;		# If needed, as return value

> ref($self) is a valid class, but it is not related (in an @ISA sense) to
> the class named $class.  This code is being invoked within an AUTOLOAD
> which is within an eval (which actually is within yet another eval). 

This makes me wonder whether some other code has accidentally blessed the
wrong object, or is calling new in the wrong package, or something like
that. 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: 3 Jul 1997 21:18:35 GMT
From: "Sergio Stateri Jr" <serginho@alpha.hydra.com.br>
Subject: Re: strange problem...
Message-Id: <01bc87f7$0f0e5280$6875e7c8@Term104>


Ying Hu <Y_Hu@fccc.edu> escreveu no artigo <33BBA28D.167E@fccc.edu>...
> try:
> 
> $from = chomp($email);
> 
> Ying

I try it and the return address in MS-mail shows : 0@themailserver.xxx.xxx

I don't find a solution for this problem yet... :((

> 
> Sergio Stateri Jr wrote:
> > 
> > Hi! I did a script that send e-mails for everybody in a List...The
problem
> > is that when I put :
> > 
> > $from = "teste@teste.com";
> > 
> > Everything all right (The return mail is teste@teste.com)...But, I need
to
> > put the original sender, and if I put :
> > 
> > $from = $email;
> > 
> > ($email variable is the email address of sender, I take it from a file,
per
> > example, it'd be teste@teste.com). In the last case, the SMTP server
return
> > me :
> > 
> > ERROR: Mail command failed sending:
> > MAIL FROM:<teste@teste.com>
> > 
> > 553 Invalid address syntax


-- 
--------------------------------------------
Sergio Stateri Jr
Sco Paulo (SP) - Brazil
e-mail: serginho@usa.net
--------------------------------------------


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

Date: 04 Jul 1997 08:56:15 +0200
From: c.schabacker@gis.ibfs.de (Carsten Schabacker)
Subject: Re: string to integer HELP !!
Message-Id: <u2yb7ni9v4.fsf@aix1.ibfs.de>

david <davidvr@redestb.es> writes:

> I need that someone help me.
> I want to convert a string into a integer number. How can i do it?
I dont know why you need this but you can use printf:

  DB<1> $s="123";
  DB<2> $i=sprintf("%d", $s);
  DB<3> print $i;
123
  DB<4> print $i + 2;
125

cs.
-- 
GiS - Gesellschaft fuer integrierte Systemplanung mbH   Tel. +49-6201-503-38
Carsten Schabacker                                      Fax  +49-6201-503-66
Junkersstr. 2                               E-Mail  c.schabacker@gis.ibfs.de
D-69469 Weinheim                      private  cschaba@spock.rhein-neckar.de


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

Date: Tue, 08 Jul 1997 00:36:48 -0400
From: Oliver Giller <oliver@inetu.net>
Subject: Tainted problem
Message-Id: <33C1C3E0.1AD2A9EA@inetu.net>

I am having a problem with taint in a set-uid perl script.
I am writing a file out to /tmp/ and then trying to open this file with
an editor. The editor is pulled from $ENV{'EDITOR'}.

I keep getting the error 
   Insecure PATH at /usr/share/perl/vedit.lib line 332.

I have tried a number of ways of untaining the variables. 
Here is the code.

    $ENV{'EDITOR'} =~ /^-P(\w+)$/;  # attempt 1 at untaiting
    $editor = $1;

    $command = "$editor $sectionFileName";
    $command =~ /^(.*)$/;           # attempt 2 at untaiting
    $command = $1;

    system ("$command");


Thanks
Oliver

-- 
-------------------------------------------------------
Oliver Giller		mailto:oliver@inetu.net
Pagemaster		http://www.inetu.net/
-------------------------------------------------------


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

Date: Thu, 03 Jul 1997 14:37:58 -0400
From: Jack Coursey <jcoursey@sed.nist.gov>
Subject: Testing Perl
Message-Id: <33BBF186.41C6@sed.nist.gov>

I am trying to learn perl and I am copying scripts right out of the
camel book.

My html form works fine (using Netscape) and then instead of returning
the output of my script when I submit it returns my entire script.

I don't know if I am scripting correctly.

I would appreciate any help!

Jack


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

Date: Thu, 3 Jul 1997 17:54:25 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Testing Perl
Message-Id: <1jahp5.3f7.ln@localhost>

Jack Coursey (jcoursey@sed.nist.gov) wrote:
: I am trying to learn perl and I am copying scripts right out of the
: camel book.


Good idea!


: My html form works fine (using Netscape) and then instead of returning
: the output of my script when I submit it returns my entire script.


I see. So you do not have a "Testing Perl" question, you have a
"Testing CGI" problem.

An additional problem is that you asked about CGI in the Perl newsgroup.

You should ask CGI questions in the CGI newsgroup:

   comp.infosystems.www.authoring.cgi


: I don't know if I am scripting correctly.

Neither do we, because you have a server configuration or other CGI
problem. We can help with Perl problems, this being the Perl newsgroup
and all, but you don't have a Perl problem here...


: I would appreciate any help!


Does your script work when executed from the command line?

If not, then it may be a Perl question.

If so, then it almost certainly is NOT a Perl question.


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


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

Date: Thu, 3 Jul 1997 18:20:31 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jack Coursey <jcoursey@sed.nist.gov>
Subject: Re: Testing Perl
Message-Id: <Pine.GSO.3.96.970703181917.6445W-100000@kelly.teleport.com>

On Thu, 3 Jul 1997, Jack Coursey wrote:

> I am trying to learn perl and I am copying scripts right out of the
> camel book.

That's one way to do it.

> My html form works fine (using Netscape) and then instead of returning
> the output of my script when I submit it returns my entire script.

Sounds like a server problem. Ask your webmaster to help you find the
server's docs. 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, 07 Jul 1997 10:01:49 -0400
From: Qing Wu <qwu@xyplex.com>
Subject: TIMES function
Message-Id: <33C0F6CD.5807@xyplex.com>

I have a test tool written in Perl that is running on UNIX workstation.
I am trying to port it to Windows95, but Perl-for-Win32 doesn't support
this function called TIMES. Times function returns four-element array
which contains the user and system CPU time for this process and the
child of this process.  Does anyone know how I can work around this???

Thanks in advance!

Qing


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

Date: Thu, 3 Jul 1997 17:27:29 GMT
From: "David W. Coppit" <dwc3q@mamba.cs.Virginia.EDU>
Subject: Re: TOP 5 REASONS FOR SWITCHING TO PERL
Message-Id: <Pine.SOL.3.96.970703132406.9822A-100000@mamba.cs.Virginia.EDU>


I'd add to the list that:

1) Perl doesn't have (hardly has?) arbitrary restrictions.
2) It usually does what you mean, without having to be really explicit.
3) And yet it can be safer in some ways ("use strict", required "{}",
etc.)
4) You don't have tons of temporary files strewn about your file system.
5) It doesn't have weirdness like "VAR=VAL" working and "VAR = VAL" not.

On the other hand, it has its own weirdness that sometimes bites you, but
I've found that it takes longer to reach that point with Perl.

David

_________________________________________________________________________
David Coppit - Graduate Student        coppit@cs.virginia.edu
The University of Virginia             http://www.cs.virginia.edu/~dwc3q
"Never imagine yourself not to be otherwise than what it might appear to
others that what you were or might have been was not otherwise than what
you had been would have appeared to them to be otherwise." -Lewis Carroll



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

Date: 6 Jul 1997 14:06:05 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: TOP 5 REASONS FOR SWITCHING TO PERL
Message-Id: <5po8od$6r5$8@info.abdn.ac.uk>

When Doug Seay met comp.lang.perl.misc....:
: - csh sucks.  For details see URL http://www.perl.com/perl/index.html,
: select "advocacy" then "Csh Programming Considered Harmful".

: - Normally Perl runs 10 to 100 times faster than the same function in a
: shell.

Indeed. I got an huge speed increase just for changing from csh to sh.
(It wasn't a script that utilitised any of perl's potential, just a big
 switch selection)

To be fair, I might add that perl isn't a very good login shell :)
[but then, neither is csh.]

--
Stuart 'Kyzer' Caie, Aberdeen University, Scotland.  Email to: kyzer@4u.net
My opinions are not those of Aberdeen University, and I do not speak for or
on behalf of AUCC.
                   ..100% Amiga, forever!..  http://www.abdn.ac.uk/~u13sac/

-- 
Random sig of the day:
Amiga makes it, well, not necesarily possible, but a lot of fun trying anyway.


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

Date: 7 Jul 1997 11:30:24 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: tracing perl
Message-Id: <5pqk0g$gb2@lyra.csx.cam.ac.uk>
Keywords: trace

Robert McGraw <mcgraw@sunspot.noao.edu> wrote:
>
>I am running Perl 5.3 on a Sun Solaris 2.5 hosts.
>
>I would like to trace the execution of a perl script
>while the script is being run in batch mode.
>
>Is this possible, if so how?

You can do this with the Perl debugger.   See the perldebug man page
and in particular the AutoTrace and NonStop options.


Mike Guy


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

Date: 3 Jul 1997 20:19:56 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: tree of a local site
Message-Id: <5ph1hc$gs8$1@en1.engelschall.com>

Joelle D'Antin & Nicolas Gregoire <dantin@icp.grenet.fr> wrote:

> where could I find 2 things :

> * an easy way to store datas in a base, using Perl (free,basic &easy)

Sorry, I dunno! What do you mean by "datas"? This word does not exist.

Maybe you mean "data" (which is the plural of "datum", in Latin, BTW)?
Or do you mean "dates" (i.e., calendar dates)?

> * a script which give me a tree of a local web site, with links.

Direct your web browser to

http://www.engelschall.com/u/sb/download/

and download my "gen_tree" script!

See http://www.engelschall.com/u/sb/help/ for an example of what this
script produces.

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: Thu, 3 Jul 1997 17:36:23 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "M. muPe" <mupe@desk.nl>
Subject: Re: Trouble with Split command
Message-Id: <Pine.GSO.3.96.970703173533.6445M-100000@kelly.teleport.com>

On Thu, 3 Jul 1997, M. muPe wrote:

> >  @vals = split /;/, $s;

> Try the more explicite over-correct way;
> @vals = split(/\;/, $s);

That won't fix anything. Semicolon is not a special character in regular
expressions. Thanks for trying!

-- 
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: 3 Jul 1997 22:38:23 GMT
From: "rferr" <rferr@voicenet.com>
Subject: unprintable chars
Message-Id: <01bc8802$600feda0$958667cf@rferr.voicenet.com>

is there a way to id the nonprintable characters from a wp 5.1 file
(musical notes, 
smiley faces, etc) in dos and either substitute or delete them ?

thanks in advance.


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

Date: Thu, 3 Jul 1997 18:23:11 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: rferr <rferr@voicenet.com>
Subject: Re: unprintable chars
Message-Id: <Pine.GSO.3.96.970703182248.6445X-100000@kelly.teleport.com>

On 3 Jul 1997, rferr wrote:

> is there a way to id the nonprintable characters from a wp 5.1 file
> (musical notes, 
> smiley faces, etc) in dos and either substitute or delete them ?

Yes, and the way to do it is documented in perlop(1). Hope this helps!

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



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

Date: 4 Jul 1997 16:01:56 GMT
From: jeff@jehosophat.com (Jeff Davis)
Subject: URL counter?
Message-Id: <slrn5rq7q7.v3r.jeff@photuris.jehosophat.com>

I am looking for a script to count URLs on a Web page and report
the total via a SSI.

Anyone seen anything like that already done or do I need to
roll my own?

Many thanks.

-- 
Jeff Davis 
jeff@jehosophat.com
http://jehosophat.com


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

Date: Fri, 4 Jul 1997 12:55:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeff Davis <jeff@jehosophat.com>
Subject: Re: URL counter?
Message-Id: <Pine.GSO.3.96.970704125421.18569C-100000@kelly.teleport.com>

On 4 Jul 1997, Jeff Davis wrote:

> I am looking for a script to count URLs on a Web page and report
> the total via a SSI.
> 
> Anyone seen anything like that already done or do I need to
> roll my own?

It's been done once or twice. :-)  But if you want to write your own, you
could start with Randal's fourth Web Techniques column. 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: Mon, 07 Jul 1997 11:26:56 -0400
From: Boris Tabenkin <bat@unifi.com>
Subject: Re: Use of the FTP library from the CPAN archive
Message-Id: <33C10AC0.59D4CB06@unifi.com>

I found that the bellow code works

Boris Tabenkin wrote:

> I have found teh the FTP librray form the CPA archive will cause your
> program to hang (in an infinite loop) if the renote FTP server
> times-out
> or is killed. As a solution I have mad e a fix to the Net::Cmd module.
>
> The fix is to add the folloing code to the response method:
>
> sub reposne {
> ..
> ..
> ..
> while(1) {
>     my $str=$cmd->getline();
>
>     #
>     # fix for the infinite loop
>     #
>     unless ($str) {
>         $code="550";
>         last;
>     }
>     #
>     # end of fix
>     #
> ...





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

Date: Mon, 07 Jul 1997 20:21:31 GMT
From: ref@mesasys.com (Ronald E. Fortin)
Subject: Using SFIO with perl5.004 on NT
Message-Id: <5prj9s$5ag$1@hal.brainiac.com>
Keywords: SFIO NT

Hello,

I'm having a problem building perl5.004 with SFIO.  I have
succesfully build perl5.004 by itself (without SFIO) and have
built the sfio libraries (which needed some minor fixes).

Now, to get the win32 version of perl to build with sfio, I changed the
makefile so that it defines SFIO and PERLIO and includes the sfio
include files and libraries

INCLUDES = -Id:\dev\sfio97\include -I.\include -I. -I..
DEFINES = -DWIN32 -DCONSOLE -DPERLDLL -DUSE_PERLIO -DUSE_SFIO
LIBFILES = ..... libsfio.a libstdio.a

However, when I compile it I get many warnings like the following:

         cl.exe -c -nologo -W3 -Id:\dev\sfio97\include -I.\include -I. -I.. 
        -DWIN32 -D_CONSOLE -DPERLDLL -DUSE_PERLIO -DUSE_SFIO  -Od -MD -DNDEBUG 
        -Fo..\miniperlmain.obj ..\miniperlmain.c
        miniperlmain.c
        ..\perlsfio.h(6) : error C2143: syntax error : missing '{' before '*'
        ..\perlsfio.h(6) : error C2282: '_stdopen' is followed by '_ARG_' 
        (missing ','?)
        ..\perlsfio.h(7) : error C2282: '_stdprintf' is followed by '_ARG_' 
        (missing ','?)
        ..\perlio.h(194) : error C2143: syntax error : missing ')' before '*'
        ..\perlio.h(194) : error C2143: syntax error : missing '{' before '*'
        ..\perlio.h(194) : error C2059: syntax error : ','
        ..\perlio.h(194) : error C2059: syntax error : ')'



Has anyone tried to build perl with sfio97 on NT?
Any pointers are appreciated.





---
Ronald E. Fortin
Senior Engineer
ref@mesasys.com
Mesa Systems Guild, Inc.
60 Quaker Lane
Warwick, RI 02886
401-828-8500
www.mesasys.com


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

Date: Thu, 3 Jul 1997 17:57:43 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Robert U Myers <robertmy@pogo.wv.tek.com>
Subject: Re: using system
Message-Id: <Pine.GSO.3.96.970703175334.6445Q-100000@kelly.teleport.com>

On Wed, 2 Jul 1997, Robert U Myers wrote:

> system(@args);
> 
> When I run my script all it does is run the command.  Ex: if I were
> running ls -l all that would happen is an ls.

Really? If I use this code...

    @args = ('ls', '-l');
    system @args;

 ...I don't just get the results of ls. 

How about this. Just before your system command, put in this diagnostic.

    $| = 1;		# Don't buffer this output
    print "About to call system with these args:\n",
	map "$_: '$args[$_]'\n", 0..$#args;

Now, you'll be able to see just what arguments you're passing to your
subprocess. 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, 7 Jul 1997 16:31:13 GMT
From: rapchun@barnard.yerkes.uchicago.edu (Dave Rapchun)
Subject: Variables Question
Message-Id: <ECyJ81.A9s@midway.uchicago.edu>

Hello,

I'm trying to call the 'ftp' function from within my perl script, but
I want to pass it a variable containing the file name I wish to 
transfer.  I am stumped.  Please help.

Thanx.

Dave.


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

Date: Mon, 7 Jul 1997 10:33:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dave Rapchun <rapchun@barnard.yerkes.uchicago.edu>
Subject: Re: Variables Question
Message-Id: <Pine.GSO.3.96.970707103148.9019e-100000@kelly.teleport.com>

On Mon, 7 Jul 1997, Dave Rapchun wrote:

> I'm trying to call the 'ftp' function from within my perl script,

Perl doesn't have a built-in ftp function, but maybe you're using
something from a module. 

> but I want to pass it a variable containing the file name I wish to
> transfer.  I am stumped. 

Parameter passing is documented in perlsub(1). You can see a module's
documentation with the perldoc command. If you can't find what you need
in those places, let us know. 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: 03 Jul 1997 20:27:17 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: Want benefit of 'my' variables in a package
Message-Id: <h3epwdm9m.fsf@bergen.sn.no>

Brett Denner <Brett.W.Denner@lmtas.lmco.com> writes:

> Is there a way to get the benefits of "use strict 'vars'" yet have my
> variables go into the current package?

   use strict;
   use vars qw(%macros);

   $macros{FOO} = "Bar";

-- 
Gisle Aas <aas@sn.no>


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

Date: Fri, 4 Jul 1997 20:03:16 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: What does <<END do?
Message-Id: <tcyangECt91H.MH0@netcom.com>

Also no spaces after END.  Sometimes I wonder why Perl has such a rule
since many people make this mistake, and if Perl can accept this label
with leading and lagging spaces, it does not seem to create ambiguity.

(of course, I do agree that if Perl says so, we should leave no spaces
around END)

======================================
Ying Hu wrote after talking to Zeus and Hercules:
: Wade Williams wrote:
: >           print <<END;
: 	...
: >         END
: > Can't find string terminator "END" anywhere before EOF at ./test.cgi line 77.

: The END should be the beginning of line, there is non space before END
: in the line.

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Mon, 7 Jul 1997 20:11:03 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: What does <<END do?
Message-Id: <tcyangECytEG.8zF@netcom.com>

Well, I know what you mean :)  And actually Tad told me the same thing
already.  However, if we do not want to implement too many 'flexibilities',
then we might want to distinguish the string '123' and the integer
'123'.  Don't you think so?  :)  I know this property is probably inherited
from 'awk', but stricter restrictions make people more careful about
their codes, while easier restrictions give people more convienience.

>From another viewpoint, you can also say stricter restrictions make
programming difficult, and easier restrictions make people write lousy
codes.

The mirror has two faces :)

===================================================
Matthew D. Healy wrote after zapping the scum of the universe:
: In article <tcyangECt91H.MH0@netcom.com>, tcyang@netcom.com (Tung-chiang
: Yang) wrote:

: > Also no spaces after END.  Sometimes I wonder why Perl has such a rule
: > since many people make this mistake, and if Perl can accept this label
: > with leading and lagging spaces, it does not seem to create ambiguity.

: Because if you allow too much flexibility for the ending tag, then
: you increase the risk of ending when you really don't want to!  Requiring
: it to be the ONLY thing on the line means you can safely put absolutely
: anything else, even strings containing the here-doc terminator, within
: the here-doc contents.  IMHO, the subtle bugs that could be created
: by allowing heredoc terminators within longer lines would be far
: worse than the way it is now.

: Besides, if this month Perl is "fixed" to allow leading and trailing
: spaces AND NOTHING ELSE before and after the heredoc terminator, then
: probably next month somebody will demand allowing quotes around the
: here-doc terminator, or a backslash in front of it, or something.

: Look at the headaches caused by differences in how bourne and C shells
: handle here-doc terminators!  Do we really want Perl to go down this
: road?

: As I see it, ambiguity is the inherent problem with virtually all
: attempts to "fix" a common user error by redefining the language.  For
: example, many versions of Netscape try to fix some common HTML mistakes.
: As a result:

:    1. I see lots of "works with Netscape, not with other browsers"
:       questions on web-related newsgroups.

:    2. I've also seen "works with version such-and-such" questions
:       because different versions of Netscape handle these cases
:       differently -- and the differences are not well documented!

:    3. There are examples of _CORRECT_ HTML that cannot be handled
:       properly by Netscape because the ambiguities introduced into
:       the parser to "fix" common coding errors introduce bugs.

: PS: I am not talking about things like NETSCAPE-specific tags here;
: that's a different kind of stupidity.  I am talking about things like
: the versions of Netscape that attempt to fix URLs with a missing close
: quote or somesuch.

: Let's not make Perl commit similar errors!

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Fri, 4 Jul 1997 18:31:21 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: What does <<END do?
Message-Id: <941kp5.90b.ln@localhost>

Tung-chiang Yang (tcyang@netcom.com) wrote:
: Also no spaces after END.  Sometimes I wonder why Perl has such a rule
: since many people make this mistake, 


It is not Perl's rule.

It is the shell's rule.

Perl just doesn't want to confuse folks by changing the rules that
they are (likely) familiar with...


: and if Perl can accept this label
: with leading and lagging spaces, it does not seem to create ambiguity.

: (of course, I do agree that if Perl says so, we should leave no spaces
: around END)

: ======================================
: Ying Hu wrote after talking to Zeus and Hercules:
: : Wade Williams wrote:
: : >           print <<END;
: : 	...
: : >         END
: : > Can't find string terminator "END" anywhere before EOF at ./test.cgi line 77.

: : The END should be the beginning of line, there is non space before END
: : in the line.


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


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

Date: Thu, 03 Jul 1997 21:55:21 -0700
From: "Joseph M. Hnkle" <jhinkle@rockisland.com>
To: TechMaster Pinyan <jefpin@bergen.org>
Subject: Re: What does this do?
Message-Id: <33BC8239.464FDE95@rockisland.com>

TechMaster Pinyan wrote:
> 
> >   $name =~ s/%                        # match a percent sign
> >              (                        # start remembering matched part in $1
> >               [a-fA-F0-9]             # match a hex char
> >               [a-fA-F0-9]             # match another hex char
> >              )                        # stop remembering matched part in $1
> >                                       #    now there are 2 hex chars in $1
> >             /pack("C", hex($1))/egx;  # decode it
> >                                       # s///x allows those comments in
> >                                       # the pattern above
> 
> When do you use $1 and when do you use \1?
> I always use \1, but does it ever make a difference?
> 

"The backreferences \1 and \2 and \3 (and so on) have the same meaning
as $1 and $2 and $3, but are valid only inside s/// or m/// expressions.
In particular, they're valid inside the pattern itself."

p.81, 'Perl 5 Interactive Course', Waite Press


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

Date: Thu, 3 Jul 1997 20:58:59 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: When was PERL created?
Message-Id: <ECrGyC.A19@cix.compulink.co.uk>

In article <867790152.23274@dejanews.com>, tim@hcirisc.cs.binghamton.edu 
() wrote:

> Does anyone have info on when PERL was created?  Some idiot wrote a
> proposal to my company saying that PERL has no practical application
> outside of the WWW.  So I wanted to know by how much PERL pre-dates
> the web for a little extra oomph for my reply.  Thanks.

It has major practical applications outside the WWW - I'd say more so that 
within it, but I'm a curmudgeon about WWW. I started using perl in early 
'92, and first used the WWW in 1995, having got a new job largely on the 
strength of my Perl skills.

I've used it for all sorts of text processing - managing DTP files, 
writing file converters for obscure word processors, writing customised 
versions of standard UNIX tools (grep, strings, that kind of thing) - plus 
UNIX and NT system automation, writing a specialised programmer's 
workbench for NT in much less time than the shell-script UNIX version and 
gawd knows what else.

I've done at least two years worth of full-time work in perl, spending 
about three man-days on cgi scripts.

Good enough?

--- 
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: 7 Jul 1997 20:35:40 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: When was PERL created?
Message-Id: <5prjus$im8$1@news.cmc.net>

In article <33c8c902.5695997@news.tornado.be>,
	bart.mediamind@tornado.be (Bart Lateur) writes:
> tim@hcirisc.cs.binghamton.edu wrote:
> 
>>Does anyone have info on when PERL was created?  Some idiot wrote a
>>proposal to my company saying that PERL has no practical application
>>outside of the WWW.  So I wanted to know by how much PERL pre-dates
>>the web for a little extra oomph for my reply.  Thanks.
> 
> Strike back at their own terms. WHY is Perl the most used tool for CGI
> scripting? Because it's so bloody handy in text processing and data
> manipulation, thanks (mainly) to regular expressions and associative
> arrays.

And due to the various CGI libraries.  The old cgi-lib.pl was (despite
quirks) a huge boon to doing CGI in Perl instead of C or sh.

> My main use of Perl is in manipulation of database export files into
> producing catalogues (paper and CD-ROM).

I use it for various adminly things (from grepping/reformatting logs for
RADIUS, to software that pages me by opening a socket to a portmaster
and issuing commands via chat2, or one that goes through the Apache log
file, stripping out the proxy requests that confuse Analog and splitting
each virtual domain into its own log (which also confuses Analog) and then
running analog on each found domain and sending off a report to the proper
person.. or mrtg, which graphs my bandwidth usage and the lines in use
at 6 sites as well as server loads....)

> So, if your app involves using extensive text processing, don't doubt.
> Use Perl.

Perl is great for text, granted... but it does a LOT of other things
well, too.  It allows for effectively prototyping a project quickly and
easily and it usually works so well that you let the prototype do the
real job. :)   [I have one perl program that babysits another process,
ensuring that it is alive and responding and restarting it if it dies
or killing it and restarting it if it gets stuck.... I was gonna redo it
in C a couple years ago once I ensured that the premises involved were
valid... never have gotten around to it.]

And some of the CPAN toys are quite amazing in what they let you do
quickly and easily. :)

-- 
Brian Moore                      The opinions expressed above are my own, not
Sysadmin, C/Perl Hacker          necesarily my employers'.


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

Date: Fri, 04 Jul 1997 10:29:26 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: When was PERL created?
Message-Id: <33c8c902.5695997@news.tornado.be>

tim@hcirisc.cs.binghamton.edu wrote:

>Does anyone have info on when PERL was created?  Some idiot wrote a
>proposal to my company saying that PERL has no practical application
>outside of the WWW.  So I wanted to know by how much PERL pre-dates
>the web for a little extra oomph for my reply.  Thanks.

Strike back at their own terms. WHY is Perl the most used tool for CGI
scripting? Because it's so bloody handy in text processing and data
manipulation, thanks (mainly) to regular expressions and associative
arrays.

My main use of Perl is in manipulation of database export files into
producing catalogues (paper and CD-ROM).

So, if your app involves using extensive text processing, don't doubt.
Use Perl.

	Bart.


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

Date: 4 Jul 1997 21:54:55 GMT
From: hakan@af.lu.se (Hekan Lindholm)
Subject: Re: When was PERL created?
Message-Id: <5pjrff$lni$1@news.lth.se>

Gert Jan Verhoog <gerti@xs4all.nl> wrote:
>Tad McClellan <tadmc@flash.net> wrote:
>
>>   Anyone have a date for the invention of the WWW?
>
>around '91/'92 or so?

http://www.w3.org/History.html tells you all about it!

It started second half 1980 !!

Well, it got its name in 1990 and Mosaic came in early 1993. I joined in 1994. 


-- 
Hekan Lindholm          interAF           Email:Hakan@af.lu.se
Kdmndrsvdgen 15 H:22    Sandgatan 2       Fax:046-2112505
SE-226 46  LUND         SE-223 50  LUND   http://purl.oclc.org/NET/hakan
046-391492              046-132630        StudentDatorRedgivare Mac


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

Date: Mon, 7 Jul 1997 20:01:20 GMT
From: msadams@netcom.com (Michael Adams)
Subject: Re: WIN32 Perl head aches!
Message-Id: <msadamsECysy8.1nE@netcom.com>

Troy High (thigh@mci2000.com) wrote:
: I've read all the faqs, and done all my homework (I think so anyway...)

: But I still can't figure out a couple of things:

: 1) On a Win95 machine, what registry entries do I need to enable the
: following things

This problem is chronic.  I am seeing post after post regarding getting 
Perl for Win32 to work with the Personal Web Server and Window 95, yet 
nothing seems to work.

Has anyone gotten this to run with build 306?  If you have let us know 
how to get it running.  I will personally be the evangalist, and e-mail 
everyone with a solution, including the author of the Perl for Win 32 FAQ.

We are all anxious to get some Perl programming done.

Michael Adams
-- 
                                             msadams@netcom.com


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

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

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