[7128] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 753 Volume: 8

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

Date: Mon, 21 Jul 97 17:00:17 -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, 21 Jul 1997     Volume: 8 Number: 753

Today's topics:
     Re: How to call a subroutine from a variable? (Steve O'Hara Smith)
     Re: National Medal of Technology: Let's nominate Larry! (Bob Shair)
     Perl Coders - New Site? <pdenman@ims.ltd.uk>
     Re: Perl for DOS <leonstep@cedep.com>
     Re: Perl Processing Speed / E-mail Forms / Virtual Seve <bkyan@mindcast.com>
     Re: perl5.003 (M.J.T. Guy)
     Re: splitting a list of strings? (Paul D. Smith)
     Re: Using ANSIColor in write formatted screen output <rra@stanford.edu>
     Re: Wordwrap for form to Email (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 Jul 1997 11:19:15 GMT
From: sohara@mardil.elsevier.nl (Steve O'Hara Smith)
Subject: Re: How to call a subroutine from a variable?
Message-Id: <5qvgjj$j2$1@ns.elsevier.nl>

Toutatis (toutatis@remove.this.toutatis.net) wrote:
: My code:

: use strict;
: foreach $var(@vars){
:    $subroutine = "check_$var";
:    &$subroutine($arguments);
: }

	This would not work as you are trying to call a string (which happens
to have the same text as the name of a function). A better answer would be
to create a hash of function references indexed by whatever is in the @vars
array, Something like :

%checkers = (
	A_var => \&check_A_var,
	B_var => \&check_B_var,
	...
);

foreach $var (@vars)
{
	&{$checkers{$var}}($arguments);
}


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

Date: 21 Jul 1997 17:23:09 GMT
From: rmshair@uiuc.edu (Bob Shair)
Subject: Re: National Medal of Technology: Let's nominate Larry!
Message-Id: <5r05tt$am9$1@vixen.cso.uiuc.edu>

Mark Atwood <zot@ampersand.com> writes:

>The Perl Institute should probably be the one to submit
>the application, but it probably would not be hard to get at least the
>minimum 6 Letters Of Recommendation. I'm reasonably sure one can be
>shaken out of my employer (we do a *LOT* of Perl stuff).

I was hoping someone would know who the appropriate nominator would be.
If no one else does it, I will.
 
>Hey, Perl Institute, you want want to do this? Maybe we should start
>an online campaign, "Give Larry a Medal". (semi-serious)
 
I just did!
-- 
Bob Shair                          Open Systems Consultant
1018 W. Springfield Avenue         rmshair@uiuc.edu
Champaign, IL 61821		   217/356-2684
< Not employed by or representing the University of Illinois >


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

Date: Mon, 21 Jul 1997 13:57:38 +0100
From: "Paul Denman" <pdenman@ims.ltd.uk>
Subject: Perl Coders - New Site?
Message-Id: <0dmvq5.agq.ln@gate.imsport.co.uk>

Hello to all you Perl Coders out there,

I am currently going throught the learning curve of the
"Pathologically Eclectic Rubbish Lister", and would like
to set up a web site to hopefully help fellow newbies
like myself.

Are there any Perl coders from the UK, preferrably in the
West Yorkshire area, who would be interested in pooling
efforts?

I can obtain free web space, so that is no problem, and
eventually a unique domain name.

Anyone interested, please get back to me.

Kind regards,

Paul Denman
pdenman@ims.ltd.uk




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

Date: Mon, 21 Jul 1997 00:19:17 -0700
From: Leon Stepanian <leonstep@cedep.com>
Subject: Re: Perl for DOS
Message-Id: <33D30D75.5575@cedep.com>

Hi; You can get Perl5 for Dos at

ftp://ftp.cs.colorado.edu/pub/perl/CPAN/ports/msdos/perl5/

Works fine on my punny 486 50 DX.

Leon                        "Perl....from an ocean of human kinds"


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

Date: Sun, 20 Jul 1997 22:53:52 -0700
From: Benjamin Kyan <bkyan@mindcast.com>
To: Davek <davek@ix.netcom.com>
Subject: Re: Perl Processing Speed / E-mail Forms / Virtual Severs
Message-Id: <33D2F970.B8FDCFE8@mindcast.com>

Davek wrote:
> 
> I am using Perl for the first time to process E-Mail forms.
> The problem is that a form hosted on a virtual server may take
> anywhere from 6 seconds to over a minute to process (the same 
> script) due to server load?.

	6 seconds??  Wow...  That's quite a server load...

> My first instinct was to send an immediate confirmation and process
> the form in the background.  This turned out to be a little too 
> advanced for me considering I couldn't find an adequate example or 
> tutorial on the Net. Can anyone help here?

	The easiest way to do this, would be to write two Perl
	scripts.  The cgi script would dump the form input into
	a temp file and then fork() itself.  The parent would
	output HTML back to the user, and the child would exec()
	the batch script with the name/path of the temp file
	as an argument/parameter.	
 
> My second instinct is to bite the bullet and set up a Linux operating
> system and build and install on this virtual server one of the C
> programs (CGIEMAIL) that I am familiar with. Question: Will this be 
> a solution to the processing speed noted above.

	The differences in processing speed between Perl and C, 
	in your case should be pretty minimal; both should take
	care of the job in less than half a second, if that, on
	a server with a *normal* load.

-- 

Best Regards,
Benjamin Kyan
bkyan@mindcast.com

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


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

Date: 21 Jul 1997 15:32:44 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: perl5.003
Message-Id: <5qvves$asl@lyra.csx.cam.ac.uk>

In article <5qlg1t$oku$1@d2.tufts.edu>,
C4@r!3$   <cpeterma@emerald.tufts.edu> wrote:
>Anyone know where I can find the src code for this ??  I need to reinstall
>the old version to clean up some fubar over here.....

Look on CPAN:

       $CPAN/src/5.0/perl5.003.tar.gz


Mike Guy


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

Date: 21 Jul 1997 08:44:04 -0400
From: psmith@baynetworks.com (Paul D. Smith)
Subject: Re: splitting a list of strings?
Message-Id: <p5yb70fucr.fsf@baynetworks.com>

%% mike@stok.co.uk (Mike Stok) writes:

  ms> would

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

  ms> be a start?

I guess that would do it; I thought of two maps but it seemed a little
overkill.  It turns out that the join method is slightly faster:

  #!/usr/local/bin/perl

  use Benchmark;

  @a = ('one two', 'three', 'four five six', 'seven eight');

  timethese(15000, {
    'join' => '@b = map { ; } split /[ ,]/, join(",", @a)',
    '2map' => '@b = map { ; } map { split /[ ,]/ } @a'
                });

Yields:

  $ ./bench.pl
  Benchmark: timing 15000 iterations of 2map, join...
        2map:  2 secs ( 2.17 usr  0.00 sys =  2.17 cpu)
        join:  2 secs ( 1.87 usr  0.00 sys =  1.87 cpu)

Although I think the double-map method is more readable (to me, anyway :)

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@baynetworks.com>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.


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

Date: 20 Jul 1997 23:06:03 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Using ANSIColor in write formatted screen output
Message-Id: <m34t9pym5w.fsf@windlord.Stanford.EDU>

Jeff Eidsness <jeidsnes@tekchek.com> writes:

> you said you already tried using escape secuenses, so this mught not
> help very much, but what works for me is:

> print "\033[32;1m Colors \033[0m";

This is what Term::ANSIColor does for you.  The reason why I wrote the
module (with help from Zenin) is that we were tired of having to remember
all the escape sequences.  :)

No, there's definitely a bug in format that prevents it from sending ANSI
escape sequences along to the screen.  I've reported it to perl5-porters
and we'll see if someone has the round tuition to fix it.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sun, 20 Jul 1997 18:27:42 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Wordwrap for form to Email
Message-Id: <et6uq5.in2.ln@localhost>

Davek (davek@ix.netcom.com) wrote:
: I am using Perl for the first time to process e-mail forms.  The problem is
: that most e-mail clients will not wrap long textarea input strings.  This

Actually most email clients don't even have a concept of "textarea 
input strings"   ;-)

Sounds like a WWW thing...


: problem is most noticeable when you print out the e-mail to paper (i.e. the
: text is truncated).  

: Can someone guide me towards a possible Perl solution.

The Perl FAQ can:

----------------------------------
=head2 How do I reformat a paragraph?

Use Text::Wrap (part of the standard perl distribution):

    use Text::Wrap;
    print wrap("\t", '  ', @paragraphs);
----------------------------------


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

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