[7612] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1238 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 28 11:37:16 1997

Date: Tue, 28 Oct 97 08:00:30 -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           Tue, 28 Oct 1997     Volume: 8 Number: 1238

Today's topics:
     Re: Better ways to... <eike.grote@theo.phy.uni-bayreuth.de>
     Re: Better ways to... (brian d foy)
     Re: Better ways to... <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     Re: Better ways to... (Jeffrey R. Drumm)
     Re: Better ways to... <eike.grote@theo.phy.uni-bayreuth.de>
     Can a -DDEBUGGING version of perl coexist with a regula (James FitzGibbon)
     Re: Can a -DDEBUGGING version of perl coexist with a re <rootbeer@teleport.com>
     Re: Debugging all day, and still can't figureit out - p (Mike Stok)
     Directory Contents problems jason.kitchen@scic.cec.be
     Re: Directory Contents problems <rootbeer@teleport.com>
     Re: fork() makes me wait (?) <rootbeer@teleport.com>
     Re: How to use Comm.pl from cron or ? (Matthew H. Gerlach)
     Re: PDF <michael@datahost.com>
     Perl program to recognise ANSI C header lines (Bernard Doyle)
     Re: pod2html lvirden@cas.org
     Re: Problems with $ARGV <Greg.Allen@csfp.co.uk>
     Re: Reference to class method (\&{$foo->you}) (Andrew M. Langmead)
     Re: Storage size computation (Mike Stok)
     Testing the performance of a Perl program? <fredrik.andersson@egs.ericsson.se>
     Re: Testing the performance of a Perl program? <rootbeer@teleport.com>
     Using Perl Modules <michael@datahost.com>
     Re: Using Perl Modules (Mike Stok)
     Re: Using Perl Modules <michael@datahost.com>
     Re: Year2000 problem with localtime(); lvirden@cas.org
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 28 Oct 1997 13:09:44 +0100
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Better ways to...
Message-Id: <3455D608.41C6@theo.phy.uni-bayreuth.de>

Hi,

Shetal N. Patel wrote:
> 
> I'm looking for other ways to add colons to a MAC address.
> 
> Here's how I'm doing this:
> $fmac="123456789abc";
> @fmac=($fmac=~/(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)/);
> $fmac=join(":",@fmac);
> print "$fmac\n";
> 
> The print gives me "12:34:45:78:9a:bc"  (unless I missed some syntax
> above).  Any suggestions on how I could do this differently (more
> efficiently, faster, simpler, etc).

Maybe you like this one:

   $fmac =~ s/(\S{2})(?!$)/$1:/g;

BTW: I would also replace '\S' by '[0-9a-f]'.


Bye, Eike
-- 
=======================================================================
>>--->>    Eike Grote  <eike.grote@theo.phy.uni-bayreuth.de>    <<---<<
-----------------------------------------------------------------------
 Home Page, Address, PGP,...:  http://www.phy.uni-bayreuth.de/~btpa25/
-----------------------------------------------------------------------
 PGP fingerprint:      1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
=======================================================================


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

Date: Tue, 28 Oct 1997 10:27:36 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Better ways to...
Message-Id: <comdog-ya02408000R2810971027360001@news.panix.com>

In article <slrn65bdok.du5.Tom.Grydeland@mitra.phys.uit.no>, Tom.Grydeland@phys.uit.no (Tom Grydeland) wrote:

>On Tue, 28 Oct 1997 05:32:49 -0400,
>brian d foy <comdog@computerdog.com> wrote:
>
>> In article <3455878a.129787@news.mindspring.com>,
>> snpatel@mindspring.com wrote:
>
>> >I'm looking for other ways to add colons to a MAC address.
>
>> this is the same problem as adding commas to a number, which is 
>> answered in the FAQ.
>
>Not really.  The MAC address is fixed length (or ought to be,
>considering the solution snpatel has come up with already), whereas the
>comma problem is tricky because it is a variable length problem.

the solution of the FAQ still works (the MAC address is a subset of
the set of strings for that problem).  the general solution of adding
a certain character after N characters works for the specific 
examples too.   perl doesn't care what your data mean - Perl just does
what you tell it to do. :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 28 Oct 1997 06:27:25 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Better ways to...
Message-Id: <634sod$8st@bgtnsc01.worldnet.att.net>

If you do that, you should add this line:

chop($mac);

If you don't you'll end up with 12:34:56:78:9a:bc: (with a colon at the end)
which may or may not work for what you had in mind.

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl

Eike Grote wrote in message <3455D608.41C6@theo.phy.uni-bayreuth.de>...
>Hi,
>
>Shetal N. Patel wrote:
>>
>> I'm looking for other ways to add colons to a MAC address.
>>
>> Here's how I'm doing this:
>> $fmac="123456789abc";
>> @fmac=($fmac=~/(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)/);
>> $fmac=join(":",@fmac);
>> print "$fmac\n";
>>
>> The print gives me "12:34:45:78:9a:bc"  (unless I missed some syntax
>> above).  Any suggestions on how I could do this differently (more
>> efficiently, faster, simpler, etc).
>
>Maybe you like this one:
>
>   $fmac =~ s/(\S{2})(?!$)/$1:/g;
>
>BTW: I would also replace '\S' by '[0-9a-f]'.
>
>
>Bye, Eike
>--
>=======================================================================
>>>--->>    Eike Grote  <eike.grote@theo.phy.uni-bayreuth.de>    <<---<<
>-----------------------------------------------------------------------
> Home Page, Address, PGP,...:  http://www.phy.uni-bayreuth.de/~btpa25/
>-----------------------------------------------------------------------
> PGP fingerprint:      1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
>=======================================================================




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

Date: Tue, 28 Oct 1997 15:18:03 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Better ways to...
Message-Id: <3455ffb1.5210752@news.mmc.org>

On Tue, 28 Oct 1997 06:27:25 -0800, "Creede Lambard"
<$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> wrote:

>If you do that, you should add this line:
>
>chop($mac);
>
>If you don't you'll end up with 12:34:56:78:9a:bc: (with a colon at the end)
>which may or may not work for what you had in mind.
>
>--- Creede Lambard
>Minister of Irregular Expressions
>Programming Republic of Perl

And if you do that, you'll wind up with:

Name "main::mac" used only once: possible typo at macaddr.pl line xx

Once you fix that, you'll wind up with 12:34:56:78:9a:b (without a c at the
end).  Eike's RE works fine . . . the zero-width negative lookahead assertion
"(?!$)" takes care of the last octet. Really. I tried it.

-- 
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
420 Cumberland Ave, Portland, Maine 04101
Voice: 207-871-2150 Fax: 207-871-6501 Email: drummj@mail.mmc.org


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

Date: Tue, 28 Oct 1997 16:12:36 +0100
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Better ways to...
Message-Id: <345600E4.2781@theo.phy.uni-bayreuth.de>

Hi,

Creede Lambard wrote:
> 
> If you do that, you should add this line:
> 
> chop($mac);
> 
> If you don't you'll end up with 12:34:56:78:9a:bc: (with a colon at the end)
> which may or may not work for what you had in mind.

Really ? Did you try out my code ?

Note the '(?!$)' in my regular expression - it tests if the two
matched characters are at the end ('$') of the string or not. Only in
the latter case the substitution is done.

> >   $fmac =~ s/(\S{2})(?!$)/$1:/g;
                        ^^^^^

Bye, Eike
-- 
=======================================================================
>>--->>    Eike Grote  <eike.grote@theo.phy.uni-bayreuth.de>    <<---<<
-----------------------------------------------------------------------
 Home Page, Address, PGP,...:  http://www.phy.uni-bayreuth.de/~btpa25/
-----------------------------------------------------------------------
 PGP fingerprint:      1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
=======================================================================


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

Date: 28 Oct 1997 14:00:58 GMT
From: james@ican.net (James FitzGibbon)
Subject: Can a -DDEBUGGING version of perl coexist with a regular one ?
Message-Id: <slrn65bs0q.pif.james@oddjob.ican.net>

Is it feasible to do a full install of perl 5.004_01, say into the directory
/usr/local/lib/perl5, and then re-run Configure to build a debugging
version of perl and install just the perl binary as /usr/local/bin/perldbug ?

I realize that the ext libs and site libs won't be compiled with the debugging
flags, but I'm just trying to track down a memory leak in a large regex
sequence.

Any experiences/thoughts are appreciated.

-- 
j.

James FitzGibbon                                                james@ican.net
System Engineer, ACC TelEnterprises               Voice/Fax (416)207-7171/7123


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

Date: Tue, 28 Oct 1997 06:49:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: James FitzGibbon <james@ican.net>
Subject: Re: Can a -DDEBUGGING version of perl coexist with a regular one ?
Message-Id: <Pine.GSO.3.96.971028064809.18883G-100000@usertest.teleport.com>

On 28 Oct 1997, James FitzGibbon wrote:

> Is it feasible to do a full install of perl 5.004_01, say into the
> directory /usr/local/lib/perl5, and then re-run Configure to build a
> debugging version of perl and install just the perl binary as
> /usr/local/bin/perldbug ? 

Yes, and I've done that sort of thing. Of course, if you need it only for
testing purposes, there's no need to install the new binary. You can run
it from the directory in which it was built, usually. 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/
              Ask me about Perl trainings!



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

Date: 28 Oct 1997 15:05:42 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Debugging all day, and still can't figureit out - please help
Message-Id: <634v06$sok@news-central.tiac.net>

In article <3455b28c.2971430@nntp.onyx.net>,
 <warren.milburn@cdtec.co.uk> wrote:

>Whereas this line (below), which has been adapted from the above gives
>the error "Backslash found where operator expected at people.pl line
>174, near "= split (/\" ....  (Missing Operator before \?) .... Syntax
>error at people line 174, near "= split (/\" .... Execution of
>people.pl aborted due to compilation errors" :
>
>($staff_no, $forename, $surname, $job_title, $company, $department) =
>split (/\0/, $fields);
>
>Any suggestions you might have would be gratefully received.

Check the code before the line, the code you presented above is fine in
isolation, but if P put a line before it with a deliberate error e.g.

$foo =~ /pattern;

where the / is missing then I get this error message:

Backslash found where operator expected at ./try.pl line 5, near "split (/\"
  (Might be a runaway multi-line // string starting on line 3)
        (Do you need to predeclare split?)
syntax error at ./try.pl line 5, near "split (/\"
Execution of ./try.pl aborted due to compilation errors.

Error reporting has improved in recent perls, so this may be your problem.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 28 Oct 1997 08:53:59 -0600
From: jason.kitchen@scic.cec.be
Subject: Directory Contents problems
Message-Id: <878044834.24184@dejanews.com>

I have an NT directory named "02" containing the following directories:.
 ...
 ...
00
01

So I use the following code to give me a directory list:

  Win32::SetCwd("02");
  opendir DIR, "." or print "<!--Could not open @_-->";
  my @dirList = readdir DIR;
  closedir DIR;
  my $item;
  foreach $item (@dirList)
  {
    print "$item<BR>";
  }

 ....with the following results

 ...
 ...
00

Anything found after the "00" entry is lost. I suppose that Perl must be
interpreting the filename "00" as end of list or something.

Does anyone know of a way to get around this problem ?

-- Jason Kitchen
-- jason.kitchen@scic.cec.be
-- http://www.ping.be/jasonhome

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


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

Date: Tue, 28 Oct 1997 07:45:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: jason.kitchen@scic.cec.be
Subject: Re: Directory Contents problems
Message-Id: <Pine.GSO.3.96.971028073455.18883R-100000@usertest.teleport.com>

On Tue, 28 Oct 1997 jason.kitchen@scic.cec.be wrote:

> I have an NT directory named "02" containing the following directories:.
> ...
> ...
> 00
> 01

Now right away, I've got a question: Do you have a directory named '.',
and one named '...' and _another_ one named '...' ? But I looked more
closely at your original message (with a little help from Perl) and saw
this string: 

    containing the following directories:\r.\n..\r.\n...\n00\n01\n\n

Now I'm _really_ curious: Do you have \r or \n in your directory names?
That's... interesting. :-)

>   my @dirList = readdir DIR;

> Anything found after the "00" entry is lost. I suppose that Perl must be
> interpreting the filename "00" as end of list or something.

That shouldn't be happening. readdir should always return the full list of
names. (Although there's a way that user code could easily terminate early
upon a file named '0', your posted code doesn't make that mistake.) 

If you're using the latest version of Perl, you may have found a bug. Then
again, if you've got control characters in your filenames and you didn't
know it, maybe your directory structure is corrupted. :-) Investigate a
little more, and see whether you can make a test case which others should
be able to duplicate. Then you can see about filing the bug report as
described in the release notes which should have come with your copy of
Perl. Good luck! 

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



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

Date: Tue, 28 Oct 1997 06:47:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Peter Tiemann <peter@preview.org>
Subject: Re: fork() makes me wait (?)
Message-Id: <Pine.GSO.3.96.971028064548.18883E-100000@usertest.teleport.com>

On Tue, 28 Oct 1997, Peter Tiemann wrote:

> Newsgroups: comp.lang.perl, comp.lang.perl.misc

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

> Q: How do I fork a process without waiting for the child?

> The HTML document does not appear before the child process has finished.

Try closing the three standard filehandles in the child, just after the
fork, so that the server will know to not expect anything from them. Hope
this helps!

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




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

Date: Tue, 28 Oct 1997 15:04:28 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: How to use Comm.pl from cron or ?
Message-Id: <gerlachEIroJG.KBK@netcom.com>

In article <34552C53.47C2@why.net> Jim Sauber <charis@why.net> writes:
>I've tried every trick I can think of, but have been unable to get an
>app that uses Comm.pl to run in the background or from the cron. This
>app talks to a very unsophisticated database. (No problem running it in
>the foreground.) If it can't be done using Comm.pl any other hints? Any
>help at all would really be appreciated.
>

My first suggestion was to check the permissions on the pseudo-tty 
devices.  This might explain why cron can't run the app.  However,
you say you can't run the app in the background.  I would start
by focusing on the background problem.  In your "main" namespace,
set a variable called Debug to 1, and Comm.pl will dump out some informative
debug info.  In addition a file Comm.pl.debug will be created for
loggin of debug info of the child process.

Good Luck,
Matthew


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

Date: Tue, 28 Oct 1997 06:34:43 -0800
From: Michael Stearns <michael@datahost.com>
To: thayer@astor.mediabridge.com
Subject: Re: PDF
Message-Id: <3455F803.981@datahost.com>

You might want to check out:
http://www.mincom.com/mtr/sdf/

This is written in PERL, and if it can do what it advertises, which
includes outputting to PDF, it is quite powerful.

I have not used this package myself, but it looks interesting.

Michael Stearns

Charles Thayer wrote:
> 
> Any PDF generators or readers in Perl around?  /charles


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

Date: 28 Oct 1997 12:03:34 GMT
From: bernardd@wr.com.au (Bernard Doyle)
Subject: Perl program to recognise ANSI C header lines
Message-Id: <878043220.636883@nachos.wr.com.au>

Hi,

I apologise if this is a subject that has been dealt with before.
I am interested in getting hold of or making a C program function
cross refence generator. Given the capabilities of Perl for handling
and searching strings, it should be an ideal language for just
such a job.

Ideally the program would identify each function within a C source
file (or a group of files) and generate a list of functions.
It should also then generate a list of the functions called by each
function.

I do have the source code for a pre-ansi C program that does this, but
would prefer to do it in perl as I think it would be simpler.

Does anyone know of any such programs in perl ?(prefertably free and
preferably available on the net). Some notes and/or tips and/or
hints about programs to do this would also be appreciated.

If someone can provide a regular expression capable of recognising an 
ANSI C function header then I should be able to write the rest.

I have access to both perl 4 and perl 5 interpreters, so an answer
in either (or both) versions is acceptable.

Bernard Doyle
http://www.moreinfo.com.au/bjd/
bernardd@wr.com.au


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

Date: 28 Oct 1997 14:55:16 GMT
From: lvirden@cas.org
Subject: Re: pod2html
Message-Id: <634uck$266$1@srv38s4u.cas.org>


According to  <indhiraa@hotmail.com>:
:
:The problem is pod2html replaces the "<" and ">" characters by "&lt" and
:"&gt" respectively. But I want it to appear as HTML tags, that's why I am
:using "begin html" and "end html", but it seems to interpret the HTML
:tags inside the block =begin html/=end html.
:
:Am I doing something wrong.
:

I can't explain why this works, but if you make sure that the line after
=begin html
is not an empty line, you get the behavior you desire.  For some reason,
the completely empty line appears to be terminating the html mode.  The
perlpod doc _seems_ to imply that the paragraph containing =end html
will be the terminating factor.  


-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Tue, 28 Oct 1997 10:55:41 +0000
From: Greg Allen <Greg.Allen@csfp.co.uk>
Subject: Re: Problems with $ARGV
Message-Id: <3455C4AD.1544@csfp.co.uk>

Chipmunk wrote:
> 
> A. Deckers wrote:
> > $arg foo f*.1 bar
> >
> > And the output is:
> >
> > foo
> > f*.1
> > bar
> >
> 
> That's not the output I get...
> temp: No match.
> ~>
> 
> Chipmunk

"temp: No match" is displayed by your shell. You would get the same
error if you tried "echo foo f*.1 bar". A. Deckers is using a bourne
shell or derivative - sh, ksh, bash etc. which behaves differently.
If you never want wildcards expanded in your shell, which I assume is
csh, use "set noglob", but this probably won't do want you want in the
general case. You'd have to expand the wildcards inside your perl script
instead of having the shell do it for you.
_____________________________________________________
Greg Allen             
OTC Settlement Systems     
Credit Suisse Financial Products
_____________________________________________________


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

Date: Tue, 28 Oct 1997 14:47:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Reference to class method (\&{$foo->you})
Message-Id: <EIrnqM.FH6@world.std.com>

Don Thomson <thomson@zinger.adp.wisc.edu> writes:

>Hmmmm.....  I'm trying to create a reference to a class method, as in
>'\&{$foo->you}' in the following code snippet.  

How about if you create an anonymous subroutine that calls the method?

$subref = sub { $foo->you() };

With this, inheritance will still work.

There are a few drawbacks or points of mention that I can think of.

     The variable $foo must be a lexically local variabled (a my()'d
     variable. If the value of the global symbol $foo is hidden by a
     call to local(), you'll get the global symbol once the scope of
     the local ends.)

    Any calls to caller() inside you() will be messed up (you have an
    extra subroutine call.)

    The object's $foo's destructures won't get called until $subref
    goes out of scope.
-- 
Andrew Langmead


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

Date: 28 Oct 1997 14:57:33 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Storage size computation
Message-Id: <634ugt$s4c@news-central.tiac.net>

In article <34555560.7242@mail.clairon.edu>,
rob shaffer  <s_rsshaffer@mail.clarion.edu, rshaffer@mail.usachoice.net> wrote:
>i am writing a paper for princples of programming class. 
>	
>	i am looking for some info on this. when and how does perl set up
>storage for its types. the couple books i have do not go into to much
>detail on this.
>	i assume perl sets up pointers for the types at compile time. then
>works with linked lists durning runtime.

You might want to look at Sriram Srinivasan's advanced perl programming
(see http://www.ora.com/catalog/advperl/) or play with the Devel::Peek
module which can be grabbed from CPAN to see what happens to variables -
that's quite east to do in the debugger.

CPAN can be reached via the link at http://www.perl.com or by using ftp
to the master site at ftp.funet.fi and looking in the
/pub/languages/perl/CPAN directory.  The list of mirror sites may let you
go to a "closer" archive to download.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 28 Oct 1997 15:41:26 +0100
From: Fredrik Andersson <fredrik.andersson@egs.ericsson.se>
Subject: Testing the performance of a Perl program?
Message-Id: <3455F995.3AB5F8CA@egs.ericsson.se>

Hi there

I have made a CGI-script in Perl that takes care of a form, does anyone
know of some sort of performance program that could be run to
test how many forms that can be handled per minute or second by my
Perl program.
I would be very happy for some help

thanks,

Fredrik



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

Date: Tue, 28 Oct 1997 07:26:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Fredrik Andersson <fredrik.andersson@egs.ericsson.se>
Subject: Re: Testing the performance of a Perl program?
Message-Id: <Pine.GSO.3.96.971028071208.18883M-100000@usertest.teleport.com>

On Tue, 28 Oct 1997, Fredrik Andersson wrote:

> I have made a CGI-script in Perl that takes care of a form, does anyone
> know of some sort of performance program that could be run to
> test how many forms that can be handled per minute or second by my
> Perl program.

Although it wouldn't be hard to write a script to (for example) submit
your form as many times as possible in one minute, that wouldn't tell you
much useful information - the load on the server and the underlying
processor, disks, and network connection are likely to be much more
significant. (Most similar webserver benchmarks given in vendors' blurbs
are meaningless in the real world anyway.) 

Instead, let's determine what you're looking to know and go from there. 

Do you want to find out how many forms could be submitted more-or-less
simultaneously without any of them taking more than N seconds to generate
a response? 

Do you want to compare your script's running speed with a similar script
written in another language, or using a different technique? (That's a job
for Benchmark.)

Do you want to see what happens to the server's machine load when requests
are coming in to your form at an average rate of N per minute? Or do you
want to find out how many requests per minute it takes to bring the server
down to a barely-acceptable speed?

Does your script protect against concurrency problems by locking a file,
and you want to see if that slows things down terribly? (It might. But
it's better than the alternative. :-)

Do you simply want to find out how fast your script - in the absence of a
webserver - can run? (You could do that with Benchmark, too, or there are
other tools.) 

Some of these tests would require the cooperation (or at least, the
consent) of the machine's sysadmin or webmaster. Some would require an
entirely separate machine to be a fair test. Good luck!

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



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

Date: Tue, 28 Oct 1997 06:26:03 -0800
From: Michael Stearns <michael@datahost.com>
Subject: Using Perl Modules
Message-Id: <3455F5FB.3289@datahost.com>

Hello:

Are there generic instructions available on installing and accessing
Perl Modules? I searched but did not find any.

I got the MIME Lite module, but did not see any "installation"
instructions in the README. I found another module (cgi.pm) and
attempted to use its instructions.

I did:
Makefile MAKEFILE.PL
make
install

This seemed to work to a certain degree, except that I don't have high
enough priveleges on the system I am on to install in the designated
directory.


My questions:

After doing "Makefile" and "make" I certainly got a bunch of stuff
created in my directory. Should everything be there that I need to use
the module?

Can I leave the module in my local directory and use it from there or
does it have to be somewhere else on the system?

I want to use it on another system where I have an account, but I don't
have telnet access. Can I do the install on another machine and copy
certain parts over? If not, is there another way I can do the
installation?

Thanks,
Michael Stearns


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

Date: 28 Oct 1997 15:21:43 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Using Perl Modules
Message-Id: <634vu7$mb@news-central.tiac.net>

In article <3455F5FB.3289@datahost.com>,
Michael Stearns  <michael@datahost.com> wrote:

>My questions:
>
>After doing "Makefile" and "make" I certainly got a bunch of stuff
>created in my directory. Should everything be there that I need to use
>the module?

In general the way to create and test and install a module is to unpack it
and then do:

  perl Makefile.PL
  make
  make test
  make install

>Can I leave the module in my local directory and use it from there or
>does it have to be somewhere else on the system?

It's probably easiest to build in a temporary directory and uer
MakeMaker's PREFIX option to specify where the module it to be installed.
This may mean you have to set PERL5LIB in your environment to pick the
module up (or use the lib pragma in your code)  This is described in the
MakeMaker man page.

       The Makefile to be produced may be altered by adding
       arguments of the form KEY=VALUE. E.g.

         perl Makefile.PL PREFIX=/tmp/myperl5

>I want to use it on another system where I have an account, but I don't
>have telnet access. Can I do the install on another machine and copy
>certain parts over? If not, is there another way I can do the
>installation?

It's probably safest to do the build and install on each machine if
possible as there may be dependencies whoise checks you miss by copying
over the result of a build.  For simple .pm modules without any
architecture specific files it might be OK to copy them into some place
you make user gets searched by use or require.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 28 Oct 1997 07:56:37 -0800
From: Michael Stearns <michael@datahost.com>
To: Mike Stok <mike@stok.co.uk>
Subject: Re: Using Perl Modules
Message-Id: <34560B35.5A7D@datahost.com>

Thanks for these suggestions.

I am new to UNIx and I am unclear what MakeMaker is. Do you mean the
utility called "make" or is it something else that I might need to
install?

Thanks,
Michael

Mike Stok wrote:> 

> In general the way to create and test and install a module is to unpack it
> and then do:
> 
>   perl Makefile.PL
>   make
>   make test
>   make install
> 
> >Can I leave the module in my local directory and use it from there or
> >does it have to be somewhere else on the system?
> 
> It's probably easiest to build in a temporary directory and uer
> MakeMaker's PREFIX option to specify where the module it to be installed.
> This may mean you have to set PERL5LIB in your environment to pick the
> module up (or use the lib pragma in your code)  This is described in the
> MakeMaker man page.
> 
>        The Makefile to be produced may be altered by adding
>


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

Date: 28 Oct 1997 15:46:49 GMT
From: lvirden@cas.org
Subject: Re: Year2000 problem with localtime();
Message-Id: <6351d9$53e$1@srv38s4u.cas.org>


According to John Moreno <phenix@interpath.com>:
:Can anybody come up with a way that a compiler or a compiler portion of
:a IDE could have the Y2P?  Not the libraries, or the code generated, but
:the compiler itself.  Now "make" could have a problem - not likely but

If you want to know possible scenarios, how about:

a compiler which compiles .h files when they have been updated but formats
date and time using a 2 digit year ascii string instead of using a time_t
value?  

Who really knows what possible mental abberations one might have when
writing any program...
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

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

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