[18304] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 472 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 12 14:05:46 2001

Date: Mon, 12 Mar 2001 11:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984423913-v10-i472@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 12 Mar 2001     Volume: 10 Number: 472

Today's topics:
    Re: complex pattern matching with backslashes <terrence.brannon@oracle.com>
    Re: complex pattern matching with backslashes chaim@www.net-post.com
    Re: complex pattern matching with backslashes (Randal L. Schwartz)
    Re: complex pattern matching with backslashes <dpc29@hermes.cam.ac.uk>
    Re: create a text file in DOS format. <pne-news-20010312@newton.digitalspace.net>
    Re: Find parent nodes in a hash <scottb@wetcanvas.com>
        Got it solved Re: CGI question <rother@nortelnetworks.com>
    Re: How do I delete (ignore) part of a string? (Tad McClellan)
    Re: How do I get the name of a variable as a string? <mjcarman@home.com>
    Re: How do I get the name of a variable as a string? <pne-news-20010312@newton.digitalspace.net>
    Re: How do I get the name of a variable as a string? (Anno Siegel)
    Re: How do I get the name of a variable as a string? <bart.lateur@skynet.be>
    Re: Macbeth and Perl threads <dan@tuatha.sidhe.org>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
        Newbie SSI Time Format <paanwa@hotmail.com>
        perl2exe performance problem <uwe_sprave@hp.com>
        Removing spaces from a string. <u7rjb@csc.liv.ac.uk>
    Re: Removing spaces from a string. <galen.menzel@mail.utexas.edu>
    Re: Removing spaces from a string. (Tad McClellan)
    Re: Removing spaces from a string. (Tad McClellan)
    Re: Removing spaces from a string. <b_nospam_ill.kemp@wire2.com>
        Reverse echo server failure - socket problem? <djberge@uswest.com>
    Re: Reverse echo server failure - socket problem? <djberge@uswest.com>
    Re: RFC: FAQ3 update -- Using less memory (Anno Siegel)
        SSI in CGI? <paanwa@hotmail.com>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Typeglob assignment confusion <h.camp@scm.de>
    Re: Typeglob assignment confusion <h.camp@scm.de>
    Re: Typeglob assignment confusion (Peter Scott)
    Re: usage of $SIG{__WARN__} and $SIG{__DIE__} (Peter Scott)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Mar 2001 09:07:43 -0800
From: Terrence Monroe Brannon <terrence.brannon@oracle.com>
Subject: Re: complex pattern matching with backslashes
Message-Id: <3AAD025F.24B9E85C@oracle.com>



Hugo Bouckaert wrote:

> Hi
>
> I need to do some complex pattern matching and I don't seem to be able
> to get it right.

The book for this is "Mastering Regular Expression" by Jeffrey Freidl. Alternatively,
you can meet the top Perl regex hackers live online at www.perlmonks.org

>
>
> I want to to do the following:
>
> I have the following path when I am on a windows machine:
>
> \\SomeComputer\directory1\directory2\directory3\filename.doc
>
> I would like to convert this to
>
> /directory2/directory3/filename.doc

Why do you want to do this? Perl uses "/" internally always regardless of machine...
further, most file path operations are handled by the File:: modules bundled with Perl
or available at kobesearch.cpan.org.

In your case, I think File::Basename is in order. type perldoc File::Basename to see
it's usage.

>
>
> Note that there could be more than 3 directories ie I could have
>
> \\SomeComputer\directory1\directory2\directory3\directory4\directory5\filename.doc
>
> which should become:
>
> /directory2/directory3/directory4/directory5/filename.doc
>
> With all the backslashes and forward slashes interpreted wrongly, I am
> running into trememdous problems.
>
> Basically what I want to do is: see if this general pattern of filepath
> occurs, and if so, do a substitution:
>
> if  ( Stringvariable =~
> \\SomeComputer\directory1\directory2\directory3\filename.doc ) {
>
>      $anothervariable = s/     /     /;
>
> }
>

It seems easy to me:

$str =~ s!\\{1,2}!/!g

--
Terrence Brannon
Oracle Corporation
500 Oracle Parkway
M/S 3op1556a
Redwood Shores, CA 94065
(650) 607-5482




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

Date: Mon, 12 Mar 2001 17:53:58 GMT
From: chaim@www.net-post.com
Subject: Re: complex pattern matching with backslashes
Message-Id: <3aad0cd1.975552599@192.115.106.27>

>Hugo Bouckaert <hugo@fractalgraphics.com.au> wrote:
>: Hi
>\\SomeComputer\directory1\directory2\directory3\directory4\directory5\filena:
>: which should become:
>: /directory2/directory3/directory4/directory5/filename.doc

use File::Spec;



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

Date: 12 Mar 2001 10:27:57 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: complex pattern matching with backslashes
Message-Id: <m1k85udeqa.fsf@halfdome.holdit.com>

>>>>> "Terrence" == Terrence Monroe Brannon <terrence.brannon@oracle.com> writes:

Terrence> Why do you want to do this? Perl uses "/" internally always
Terrence> regardless of machine...  

No.  Perhaps you are getting confused recalling that Windows permits
either / or \ in filepaths at the program level (not at the command
level), so you can write programs (mostly) portable between Unix and
Windows by always using forward slashes.

However, MacPerl and VMS perl and OS/2 Perl are certainly not going to
be accepting slashes. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Mon, 12 Mar 2001 18:42:22 +0000
From: David Chan <dpc29@hermes.cam.ac.uk>
Subject: Re: complex pattern matching with backslashes
Message-Id: <Pine.SOL.4.21.0103121840510.823-100000@red.csi.cam.ac.uk>

On 12 Mar 2001, Randal L. Schwartz wrote:

> However, MacPerl and VMS perl and OS/2 Perl are certainly not going to
> be accepting slashes. :)

That's interesting - is there a reason why this can't be made to work?  
IIRC, Windows doesn't allow "/" to appear in a filename at all - I imagine
the same is true on OS/2?

Thanks,
David
-- 
"If all things are one, what room is there for speech?  If [speech] does
exist, we have two; and two and one, three; from which point onwards, even
the best mathematicians will fail to reach the ultimate."  ---  Zhuang Zi



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

Date: Mon, 12 Mar 2001 17:30:12 +0100
From: Philip Newton <pne-news-20010312@newton.digitalspace.net>
Subject: Re: create a text file in DOS format.
Message-Id: <qbupatkgutstuusmv2vc3j52krkii8g2gs@4ax.com>

On Sat, 10 Mar 2001 15:04:46 -0000, Chris Stith
<mischief@velma.motion.net> wrote:

> End all your lines with qq{\r\l}

ITYM qq{\r\n}.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Mon, 12 Mar 2001 11:54:36 -0800
From: Scott Burkett <scottb@wetcanvas.com>
Subject: Re: Find parent nodes in a hash
Message-Id: <3AAD297C.EBBAA9BC@wetcanvas.com>


One more note (sorry, my brain is fried today).  The depth of the tree itself
can be unlimited.  In others words, a node can have a parent node, which is a
child of another parent node, etc.

Okay, I promise - no more corrections. :-) Thanks to those who've responded
via email.

Cheers.
Scott



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

Date: Mon, 12 Mar 2001 11:22:04 -0500
From: Gabe Rother <rother@nortelnetworks.com>
Subject: Got it solved Re: CGI question
Message-Id: <3AACF7AC.3F4804D6@nortelnetworks.com>

Thanx for the help.  The problem is solved.

Gabe


> 
> Brian J wrote:
> >
> > I presume you have something like this -
> >
> > print "<a href=\"$file\">whatever</a>\n";
> >
> > try -
> >
> > print "<a href=\"../$file\">whatever</a>\n";
> >
> > or -
> >
> > print "<a href=\"/$file\">whatever</a>\n";
> >
> > --
> > Brian
> >
> > ______________________________________________________________________
> > Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
> >  With Servers In California, Texas And Virginia - The Worlds Uncensored News Source
> >


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

Date: Mon, 12 Mar 2001 17:21:22 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How do I delete (ignore) part of a string?
Message-Id: <slrn9aptj3.t1t.tadmc@tadmc26.august.net>

James Taylor <james@NOSPAM.demon.co.uk> wrote:
>In article <slrn9apgou.sip.tadmc@tadmc26.august.net>, Tad McClellan
><URL:mailto:tadmc@augustmail.com> wrote:
>>
>> Nancy <pigpen@easynews.com> wrote:
>> > I first looked through the FAQ at
>> > http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq4.html
>> 
>> You do not need to go web surfing to find the very same file that
>> is already on your hard disk

>Personally I find it very helpful when someone posts a URL because I
>don't have a working perldoc on my system. 


You have a broken system. We have gone over that before.


>Also, as a general rule
>there is no reason to assume that the machine that someone uses for
>reading Usenet is the same machine that has Perl installed. 


I don't see where I made such an assumption.

"your hard disk" was refering to the hard disk on the machine
where they run Perl, which I assume they have access to.

Perl is free. Install it once, and you have easy access to
the docs for evermore.


>Please
>don't knock people for posting URLs, they're very helpful.


I did not knock people. I did not say you should not post URLs.
I just pointed out that there is an easier way to get at Perl's
standard docs than surfing the web.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Mar 2001 08:25:43 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: How do I get the name of a variable as a string?
Message-Id: <3AACDC67.FE14AF36@home.com>

Prem wrote:
> 
> [...] I feel, stating my question as a "reliable indicator of a poor
> design" was done without being aware of finer details.

Tad didn't say "You have a bad design." He said that your question
*indicates* one. In other words, nine times out of ten when someone asks
a question like this it's because they don't properly understand the
problem. Maybe you're the rare exception, but we tend to play the odds
here, and that influenced Tad's response.

As a side note, the advice and comments offered in this newsgroup are
constructive criticism, so don't take any of it personally. Being a
little thick-skinned will keep your blood pressure much lower.

-mjc


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

Date: Mon, 12 Mar 2001 17:44:46 +0100
From: Philip Newton <pne-news-20010312@newton.digitalspace.net>
Subject: Re: How do I get the name of a variable as a string?
Message-Id: <v1vpatkkuujkge9tbj417md3k78hb5ih2u@4ax.com>

On Fri, 09 Mar 2001 23:38:12 +0000, Prem
<donotreply@interbulletin.bogus> wrote:

> $myvar1str=GetVarNameAsString($myvar1);
> # GetVarNameAsString should return "myvar1"

What if: *apple = *myvar1; *orange = *myvar1;

Should GetVarNameAsString($myvar1) return qw(myvar1 apple orange)?
They're all names for the same variable. Hence, they are all "the
name" of the variable.

(It's a bit like asking, on Unix, "how do I get the file name, given
its (inode|file handle)?". A file can have multiple names, or even
none at all. If it has more than one name, none of the names is
special in any way.)

And then there's the question of what

    GetVarNameAsString( @{ [ 2, 4, 6 ] } )

should return (anonymous variables).

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: 12 Mar 2001 16:49:50 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I get the name of a variable as a string?
Message-Id: <98iune$bui$3@mamenchi.zrz.TU-Berlin.DE>

According to Bart Lateur  <bart.lateur@skynet.be>:
> Juha Laiho wrote:
> 
> >>Question: Is it possible to get the variable name as a string, if so how?
> >
> >Hmm.. I think it should be doable via the symbol table, but I don't know
> >the details (never needed this).
> 
> Indeed. a little while back, I posted some code here that could trace a
> reference to a sub back to its name. The same principle applies here.
> 
> But it can only ever work for global variables, NOT for lexicals, those
> variables declared with "my", because these are not in any symbol table.

Even for package variables you can only hope to find one (or all)
existing aliases.  The concept of *the* variable name doesn't apply.
In other cases, a reference may point to an anonymous item.  So there
can be zero to many variable names associated with a reference.

The original poster actually asked for a sub get_varname (or so) that
worked like this: "$name = get_varname( $var)".  This, of course, is
entirely impossible.  If "$var = 3", all the sub ever sees is 3.  It
doesn't even make sense to ask for the variable name for that.

Anno


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

Date: Mon, 12 Mar 2001 18:04:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How do I get the name of a variable as a string?
Message-Id: <aq3qatofjir8316nnnpvdlh1e0fjnicqop@4ax.com>

Anno Siegel wrote:

>The original poster actually asked for a sub get_varname (or so) that
>worked like this: "$name = get_varname( $var)".  This, of course, is
>entirely impossible.  If "$var = 3", all the sub ever sees is 3.  It
>doesn't even make sense to ask for the variable name for that.

It's not impossible. Perl passes its sub parameters by reference. 

	sub getref {
	    \(shift);
	}
	$x = 3;
	($\, $,) = ("\n", "\t");
	print \$x, getref($x);
-->
	SCALAR(0x8a62150)	SCALAR(0x8a62150)

That does look like two times the same ref to me.
	
-- 
	Bart.


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

Date: Mon, 12 Mar 2001 18:24:59 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Macbeth and Perl threads
Message-Id: <%v8r6.28690$Ok4.2836471@news1.rdc1.ct.home.com>

Peter van den Hamer <vdhamer@msn.com> wrote:
> Dan Sugalski <dan@tuatha.sidhe.org> wrote

>> Peter van den Hamer <vdhamer@msn.com> wrote:
>> > Question: is it possible for one Perl (5.005-type) thread to kill
>> > another thread in that thread's sleep?
>>
>> Nope. You can't do this safely with threads in general, and perl's
>> threads are no exception.
>>
>> Dan

> Wow, the Perl threading guru himself!

Yeek. I don't think I'd go that far. I'm not sure we have any perl
threading gurus. (And I have no doubt Gozilla! will step in if
I get too full of myself)

> Rather than ask the man for his signature,

Well, you're welcome to it. I've pasted it in at the end. :)

> I would appreciate
> a pointer to what's in store for threading in future versions of Perl.

Generally speaking:

*) The underlying implementation won't have nearly so many race conditions,
   whoopses, and critical sections
*) Far less data will be shared by default
*) Shared data access will probably be a touch more expensive, but since
   there will be less of it, that won't be bad
*) It'll probably look rather like what we have now to the average perl
   programmer
*) It'll be easier for 3GL extensions to be thread-safe without much
   trouble

> I was recently confronted with a confusing array of info on threads in
> today's Perl. It took about a week worth of free time to figure out:
> * in typical configurations perl -v says "multi-threading" but the multi
> and the threading didn't mean what one would expect.

That's typical only on Windows--it's the default build that ActiveState
uses. Necessary for the emulated fork(). It's not the default most other
places because it puts some extra overhead into perl that you generally
don't have any need for in normal perl usage.

> * p-threads require a recompile (I managed on Win32, but not what
> I can ask my users to do) and are "experimental", although some
> of the documentation (and a tutorial ;-) pretends it's the way to go.

Most of that was written before the decision to back off on the perl 5
codebase was made. The internals are a mess in some places, and making
things thread-safe and not slow would've required massive hacking.
(Making them threadsafe and slow still took a lot of hacking, but
not nearly so much. Alas the resultant perl performed really badly)

There are still a bunch of things you can do with threads safely, if you're
careful. I'll work up a list at some point.

> * Interpreter threads probably work, but don't have much of an interface.

Interpreter threads don't have any interface outside of fork() on Windows.
mod_perl for Apache 2.x may well use them, but you still won't have a perl
interface to them.

> * there are a slew of alternative RFC's on threading for Perl 6

There aren't that many. :-) Still, most of them won't go anywhere, since
the proposals, while seemingly simple, would make things both slow and
horribly complex under the hood. 

> Whence will Perl threading evolve?

Perl 6.

> What time scale till a decision?

Good question. Larry's still mulling things over and working on the
language design.

> And till a release?

Whenever perl 6 makes it out.

And here's the promised signature:


					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk




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

Date: Mon, 12 Mar 2001 16:30:25 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tapud1ap47k3ea@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 05 Mar 2001 16:30:14 GMT and ending at
12 Mar 2001 13:20:24 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  140 (38.5% of all posters)
Articles: 245 (21.0% of all articles)
Volume generated: 446.2 kb (20.2% of total volume)
    - headers:    206.2 kb (4,031 lines)
    - bodies:     233.1 kb (7,458 lines)
    - original:   151.5 kb (5,187 lines)
    - signatures: 6.7 kb (175 lines)

Original Content Rating: 0.650

Averages
========

Posts per poster: 1.8
    median: 1.0 post
    mode:   1 post - 87 posters
    s:      1.4 posts
Message size: 1865.1 bytes
    - header:     861.7 bytes (16.5 lines)
    - body:       974.4 bytes (30.4 lines)
    - original:   633.1 bytes (21.2 lines)
    - signature:  27.9 bytes (0.7 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

    8    20.8 (  8.7/ 12.1/  4.9)  "Suzanne" <sbucciarelli1@home.com>
    6    12.8 (  5.6/  7.2/  2.9)  "Michael Rolfe" <mumble[anti-spam]@maths.uct.ac.za>
    6    15.9 (  4.9/ 10.9/  6.0)  "null" <nospamplease@thankyou.com>
    6     8.5 (  3.8/  4.6/  1.5)  John Lockwood <john@particlewave.com>
    5     9.9 (  6.1/  3.6/  1.1)  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
    5     5.0 (  4.4/  0.6/  0.5)  "Hernux" <hernux@etherac.com.ar>
    5     6.9 (  4.1/  2.9/  1.1)  "Eric" <mail@ericmarques.net>
    5    13.5 (  5.1/  7.2/  5.8)  Ilmari Karonen <usenet11387@itz.pp.sci.fi>
    4     5.4 (  3.2/  2.1/  0.8)  "Pierre-Alain Fayolle" <fayolle@enseirb.fr>
    4     6.9 (  3.3/  2.6/  2.0)  Charles Gimon <gimonca@mirage.skypoint.com>

These posters accounted for 4.6% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  20.8 (  8.7/ 12.1/  4.9)      8  "Suzanne" <sbucciarelli1@home.com>
  15.9 (  4.9/ 10.9/  6.0)      6  "null" <nospamplease@thankyou.com>
  13.5 (  5.1/  7.2/  5.8)      5  Ilmari Karonen <usenet11387@itz.pp.sci.fi>
  12.8 (  5.6/  7.2/  2.9)      6  "Michael Rolfe" <mumble[anti-spam]@maths.uct.ac.za>
  12.5 (  4.3/  8.1/  1.4)      4  "Jeff S Wheeler" <jsw+nospam@five-elements.com>
  11.9 (  3.9/  8.1/  5.8)      4  "alan scanlon" <alan@afdsolutions.com>
   9.9 (  6.1/  3.6/  1.1)      5  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
   8.9 (  2.7/  3.8/  3.0)      3  Graham Ellis <graham@wellho.net>
   8.9 (  2.5/  6.3/  5.4)      3  "David Charles" <administrator@playauction.com>
   8.5 (  3.8/  4.6/  1.5)      6  John Lockwood <john@particlewave.com>

These posters accounted for 5.6% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.940  (  1.9 /  2.0)      4  "Brandon Thornburg" <centreman_19@yahoo.com>
0.868  (  0.5 /  0.6)      5  "Hernux" <hernux@etherac.com.ar>
0.850  (  5.4 /  6.3)      3  "David Charles" <administrator@playauction.com>
0.831  (  3.4 /  4.1)      3  "Peter van den Hamer" <vdhamer@msn.com>
0.829  (  1.3 /  1.6)      3  Paul <m0rejunkmail@home.com>
0.808  (  5.8 /  7.2)      5  Ilmari Karonen <usenet11387@itz.pp.sci.fi>
0.778  (  2.0 /  2.6)      4  Charles Gimon <gimonca@mirage.skypoint.com>
0.777  (  3.0 /  3.8)      3  Graham Ellis <graham@wellho.net>
0.724  (  5.8 /  8.1)      4  "alan scanlon" <alan@afdsolutions.com>
0.696  (  2.8 /  4.0)      3  Jay Tilton <tiltonj@erols.com>

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.444  (  1.2 /  2.6)      3  "Stephanie" <wleung@engin.umich.edu>
0.404  (  4.9 / 12.1)      8  "Suzanne" <sbucciarelli1@home.com>
0.402  (  0.7 /  1.8)      3  "Garrett Groff" <groffg@gmgdesign.com>
0.397  (  2.9 /  7.2)      6  "Michael Rolfe" <mumble[anti-spam]@maths.uct.ac.za>
0.397  (  0.8 /  2.1)      4  "Pierre-Alain Fayolle" <fayolle@enseirb.fr>
0.391  (  1.1 /  2.9)      5  "Eric" <mail@ericmarques.net>
0.351  (  1.2 /  3.3)      3  nis <nissj@zdnetonebox.com>
0.324  (  1.5 /  4.6)      6  John Lockwood <john@particlewave.com>
0.311  (  1.1 /  3.6)      5  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
0.168  (  1.4 /  8.1)      4  "Jeff S Wheeler" <jsw+nospam@five-elements.com>

25 posters (17%) had at least three posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      23  comp.lang.perl.modules
      16  comp.lang.java.misc
      16  comp.lang.java.programmer
      15  comp.lang.perl.moderated
      13  comp.lang.java.help
      13  alt.html
      12  comp.lang.perl
      10  alt.php
      10  alt.html.tags
      10  comp.lang.java.databases

Top 10 Crossposters
===================

Articles  Address
--------  -------

      12  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
      12  Raman Sinha <raman@raman-sinha.com>
      12  "Darren" <darrenls21@yahoo.com>
       6  justin@indent.com.au
       6  Ken Tuck <webmaster@eyecreate.net>
       6  "Brucie" <althtml@brucies.com>
       6  "keTTle_drum" <kettle_drum@yahoo.com>
       6  * Tong * <sun_tong_001@yahoo.com>
       3  remove .ORG <lorin@pobox.usit.com.ORG>
       3  "Alfred Schetelig" <schetelig@web.de>


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

Date: Mon, 12 Mar 2001 12:53:06 -0500
From: "PaAnWa" <paanwa@hotmail.com>
Subject: Newbie SSI Time Format
Message-Id: <taq39gt9tus2b8@corp.supernews.com>

I am trying to insert the last date modified in my HTML pages.  The
instructions provided by the webhosting company need interpreting...can you
help?

<!--#config timefmt="strftime_formatting_string"-->

So, what does the bit in the quotes mean?  I want the formate to appear as
Month day, Year - this means I need to convert the time using %B %d, %Y
format, but I don't know how to put it all together.

PAW




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

Date: Mon, 12 Mar 2001 17:10:30 +0100
From: Uwe Sprave <uwe_sprave@hp.com>
To: uwe_sprave@hp.com
Subject: perl2exe performance problem
Message-Id: <3AACF4F6.CB9F054F@hp.com>

Hi 

I recently bought the perl2exe tool from www.indigostar.com to "compile"
my perl application. Unfortunately the performance went dramatically
down compared to the interpreted version. 

We see now a runtime of 5-6 seconds instead of 3! My perl application
named sas.pl creates the source code of a HTML webpage and responds in 3
seconds while being run as sas.pl interpreted by perl.exe (ActiveState
Perl 5.6.0 623). If we use sas.exe instead, the performance is much much
slower.

Unfortunately the CPAN Time::HiRes timer does not compile with perl2exe
(sas.pl does run fine) to make detailed performance analysis about
loadtime, runtime etc.

I have no idea, how to troubleshoot this problem further down. Maybe you
have some experiences or thoughts that you like to share with me? 

Some details about my configuration:
Webserver: Microweb (www.Indigostar.com)
Perl: ActiveState 5.6.0 / 623
Perl2exe: V4.03 (www.Indigostar.com)

Commandline to compile:
perl2exe -perloptions="-p2x_noshow_includes" -small -tiny sas.pl

Files created with their size in bytes:
   554.187 sas.exe 
    20.480 Base64.dll
    28.672 Dumper.dll
    20.480 Hostname.dll
    24.576 IO.dll
   643.072 p2x560.dll
    77.824 POSIX.dll
    86.016 re.dll
    24.576 Socket.dll

Any idea is welcome.

regards,

Uwe Sprave
uwe_sprave@hp.com


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

Date: Mon, 12 Mar 2001 16:14:24 GMT
From: "R.J. Brown" <u7rjb@csc.liv.ac.uk>
Subject: Removing spaces from a string.
Message-Id: <3AACF5E0.D7E219B2@csc.liv.ac.uk>

I'm new to programming in Perl and have a problem.
I have a string $url that is read from a database and so it has spaces
appended on to the end of the text part of the string and so when I try
to print on screen it looks messy.  How can I truncate the string down
so that there is no spaces in it at all?

Thanks in advance,
Roger
u7rjb@csc.liv.ac.uk


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

Date: Mon, 12 Mar 2001 10:55:00 -0600
From: Galen Menzel <galen.menzel@mail.utexas.edu>
Subject: Re: Removing spaces from a string.
Message-Id: <3AACFF64.4E4E2850@mail.utexas.edu>

"R.J. Brown" wrote:

> How can I truncate the string down
> so that there is no spaces in it at all?

$string =~ tr/ //d;

galen


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

Date: Mon, 12 Mar 2001 17:21:23 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Removing spaces from a string.
Message-Id: <slrn9apu4k.t1t.tadmc@tadmc26.august.net>

R.J. Brown <u7rjb@csc.liv.ac.uk> wrote:

>I'm new to programming in Perl and have a problem.
     ^^^^^^                ^^^^

There have been tens of thousands of people there before you.

Think maybe your problem occured for any of them?

Why waste everyone's time with reanswering the already answered question?

   perldoc -q space

      "How do I strip blank space from the beginning/end of a string?"


You are expected to check the Perl FAQ *before* posting to
the Perl newsgroup.


>I have a string $url that is read from a database and so it has spaces
>appended on to the end of the text part of the string and so when I try
>to print on screen it looks messy.  

>How can I truncate the string down
>so that there is no spaces in it at all?


Don't you mean "so that there are no spaces at the end" instead?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Mar 2001 17:21:22 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Removing spaces from a string.
Message-Id: <slrn9aptt8.t1t.tadmc@tadmc26.august.net>

Galen Menzel <galen.menzel@mail.utexas.edu> wrote:
>"R.J. Brown" wrote:
>
>> How can I truncate the string down
>> so that there is no spaces in it at all?
>
>$string =~ tr/ //d;


That answers the question asked, but I think Galen asked the wrong 
question, based on the snipped part of the OP.

The quality and usefulness of answers are directly proportional
to the quality of the question.

Take care in phrasing your question, else you are likely to get
an answer that you cannot use.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Mar 2001 17:26:01 -0000
From: "W K" <b_nospam_ill.kemp@wire2.com>
Subject: Re: Removing spaces from a string.
Message-Id: <984418162.312.0.nnrp-07.c3ad6974@news.demon.co.uk>


Galen Menzel wrote in message <3AACFF64.4E4E2850@mail.utexas.edu>...
>"R.J. Brown" wrote:
>
>> How can I truncate the string down
>> so that there is no spaces in it at all?
>
>$string =~ tr/ //d;
>

 ... although from the rest of the OPs description he might not want what
that question is asking for.

$string =~ s/ +$//;
or
$string =~ s/\s+$//;





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

Date: Mon, 12 Mar 2001 12:24:55 -0600
From: Daniel Berger <djberge@uswest.com>
Subject: Reverse echo server failure - socket problem?
Message-Id: <3AAD1477.F5325BA8@uswest.com>

Hi all,

I'm running Perl 5.6 on Solaris 8 x86 here.

I copied the tcp_echo_serv2.pl program from Lincoln Stein's "Network
Programming with Perl", p.116.  However, as soon as I run it, it closes
the socket rather than waiting for clients.  Any ideas on why that is
happening?

Here's a (slightly) modified version of the code:

#!/usr/bin/perl -w

use strict;
use IO::Socket qw(:DEFAULT :crlf);
use constant MY_ECHO_PORT => 6666;

$/ = CRLF;

my $quit = 0;

$SIG{INT} = $quit++;

my $port = shift || MY_ECHO_PORT;

my $sock = IO::Socket::INET->new(
   Listen    => 20,
   LocalPort => $port,
   Timeout   => 60*60,
   Reuse     => 1
)
or die "Can create listening socket: $!\n";

warn "Waiting for incoming connections on port $port...\n";
while(!$quit){
   next unless my $session = $sock->accept;

   my $peer = gethostbyaddr($session->peeraddr,AF_INET) ||
$session->peerhost;
   my $newport = $session->peerport;
   warn "Connection from [$peer,$newport]\n";

   while(<$session>){
      my $msgout = (scalar reverse $_) . CRLF;
      print $session $msgout;
   }

   warn "Connection from [$peer,$newport] finished\n";
   $session->close;

}

warn "Connection closed\n";
close $sock;

When running, it immediately exits the loop and warns "Connection
closed".

Thanks in advance for any help.

Sincerely,

Daniel Berger



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

Date: Mon, 12 Mar 2001 12:40:35 -0600
From: Daniel Berger <djberge@uswest.com>
Subject: Re: Reverse echo server failure - socket problem?
Message-Id: <3AAD1823.E4286D8@uswest.com>

Daniel Berger wrote:

> Hi all,
>
> I'm running Perl 5.6 on Solaris 8 x86 here.
>
> I copied the tcp_echo_serv2.pl program from Lincoln Stein's "Network
> Programming with Perl", p.116.  However, as soon as I run it, it closes
> the socket rather than waiting for clients.  Any ideas on why that is
> happening?
>
> Here's a (slightly) modified version of the code:
>
> #!/usr/bin/perl -w
>
> use strict;
> use IO::Socket qw(:DEFAULT :crlf);
> use constant MY_ECHO_PORT => 6666;
>
> $/ = CRLF;
>
> my $quit = 0;
>
> $SIG{INT} = $quit++;
>
> my $port = shift || MY_ECHO_PORT;
>
> my $sock = IO::Socket::INET->new(
>    Listen    => 20,
>    LocalPort => $port,
>    Timeout   => 60*60,
>    Reuse     => 1
> )
> or die "Can create listening socket: $!\n";
>
> warn "Waiting for incoming connections on port $port...\n";
> while(!$quit){
>    next unless my $session = $sock->accept;
>
>    my $peer = gethostbyaddr($session->peeraddr,AF_INET) ||
> $session->peerhost;
>    my $newport = $session->peerport;
>    warn "Connection from [$peer,$newport]\n";
>
>    while(<$session>){
>       my $msgout = (scalar reverse $_) . CRLF;
>       print $session $msgout;
>    }
>
>    warn "Connection from [$peer,$newport] finished\n";
>    $session->close;
>
> }
>
> warn "Connection closed\n";
> close $sock;
>
> When running, it immediately exits the loop and warns "Connection
> closed".
>
> Thanks in advance for any help.
>
> Sincerely,
>
> Daniel Berger

MEA CULPA!  Stupid typo.  Make that "$SIG{INT} = sub{ $quit++ }.
Err...nevermind.



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

Date: 12 Mar 2001 16:01:10 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: RFC: FAQ3 update -- Using less memory
Message-Id: <98irs6$bui$2@mamenchi.zrz.TU-Berlin.DE>

[f'ups set]

According to Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>:
> On Tue, 06 Mar 2001, Michael Carman wrote:
> 
> > Don't read an entire file into memory if you can process it line
> > by line. Whenever possible, use this:
> > 
> > 	while (<FILE>) {
> > 	   # ...
> > 	}
> > 
> > instead of this:
> > 
> > 	@data = <FILE>;
> > 	foreach (@data) {
> > 	    # ...
> > 	}
> > 
> > and B<never> use this:
> > 
> > 	for (<FILE>) {
> > 	   # ... 
> > 	}
> > 
> > When the files you're processing are small, it doesn't much matter
> > which way you do it, but it makes a huge difference when they start
> > getting larger. The latter method keeps eating up more and more
> > memory, while the former method scales to files of any size.
> 
> Does it make sense to use the terms `former' and `latter' when there
> are three items?  What about the middle item, then?

Well, there are only two cases here, really.  The first example
avoids reading all of the file at once, the other two do.  The only
difference is that the middle example *may* be justified if something
else is done with @array later (and it had better be non-sequential).
The third approach is indefensible because it reads the file into an
anonymous array and then goes over it sequentially.  There's no way
the array can be put to any use, it's just wasted space.

Anno


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

Date: Mon, 12 Mar 2001 13:43:43 -0500
From: "PaAnWa" <paanwa@hotmail.com>
Subject: SSI in CGI?
Message-Id: <taq68f4jdc2d76@corp.supernews.com>

Is it possible to display the contents of a text file at the end of a CGI?
I would like to display an HTML file at the end of a perl script....what is
the syntax?  I tried to use a regular SSI but that only works in HTML.

PAW




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

Date: Mon, 12 Mar 2001 16:30:19 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <tapucrbvvjtce3@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 05 Mar 2001 16:30:14 GMT and ending at
12 Mar 2001 13:20:24 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org

Totals
======

Posters:  364
Articles: 1167 (500 with cutlined signatures)
Threads:  281
Volume generated: 2210.3 kb
    - headers:    993.2 kb (18,850 lines)
    - bodies:     1141.4 kb (37,068 lines)
    - original:   704.2 kb (25,200 lines)
    - signatures: 74.6 kb (1,779 lines)

Original Content Rating: 0.617

Averages
========

Posts per poster: 3.2
    median: 1.0 post
    mode:   1 post - 198 posters
    s:      6.2 posts
Posts per thread: 4.2
    median: 3 posts
    mode:   1 post - 88 threads
    s:      9.3 posts
Message size: 1939.5 bytes
    - header:     871.5 bytes (16.2 lines)
    - body:       1001.5 bytes (31.8 lines)
    - original:   617.9 bytes (21.6 lines)
    - signature:  65.5 bytes (1.5 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   58   122.4 ( 35.9/ 76.7/ 42.0)  Chris Stith <mischief@velma.motion.net>
   52    77.2 ( 47.6/ 29.2/ 16.3)  Bart Lateur <bart.lateur@skynet.be>
   34    68.2 ( 30.5/ 34.2/ 22.6)  "Godzilla!" <godzilla@stomp.stomp.tokyo>
   30    66.8 ( 30.3/ 32.3/ 17.0)  tadmc@augustmail.com
   30    79.2 ( 29.6/ 43.6/ 25.6)  mgjv@tradingpost.com.au
   26    71.7 ( 27.2/ 40.5/ 37.9)  abigail@foad.org
   23    47.5 ( 21.8/ 18.9/  8.4)  Uri Guttman <uri@sysarch.com>
   19    33.2 ( 17.0/ 16.2/  9.7)  Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
   19    31.6 ( 16.0/ 13.0/  6.4)  Gwyn Judd <tjla@guvfybir.qlaqaf.bet>
   18    29.6 ( 13.6/ 14.7/  9.2)  nobull@mail.com

These posters accounted for 26.5% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 122.4 ( 35.9/ 76.7/ 42.0)     58  Chris Stith <mischief@velma.motion.net>
  79.2 ( 29.6/ 43.6/ 25.6)     30  mgjv@tradingpost.com.au
  77.2 ( 47.6/ 29.2/ 16.3)     52  Bart Lateur <bart.lateur@skynet.be>
  71.7 ( 27.2/ 40.5/ 37.9)     26  abigail@foad.org
  68.2 ( 30.5/ 34.2/ 22.6)     34  "Godzilla!" <godzilla@stomp.stomp.tokyo>
  66.8 ( 30.3/ 32.3/ 17.0)     30  tadmc@augustmail.com
  47.5 ( 21.8/ 18.9/  8.4)     23  Uri Guttman <uri@sysarch.com>
  36.3 ( 13.1/ 20.9/ 20.3)     15  "Scott R. Godin" <webmaster@webdragon.munge.net>
  33.2 ( 17.0/ 16.2/  9.7)     19  Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
  31.6 ( 16.0/ 13.0/  6.4)     19  Gwyn Judd <tjla@guvfybir.qlaqaf.bet>

These posters accounted for 28.7% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.972  ( 20.3 / 20.9)     15  "Scott R. Godin" <webmaster@webdragon.munge.net>
0.937  ( 37.9 / 40.5)     26  abigail@foad.org
0.868  (  0.5 /  0.6)      5  "Hernux" <hernux@etherac.com.ar>
0.863  (  8.9 / 10.3)      5  "Mahesh A" <maheshasolkar@yahoo.com>
0.858  (  5.3 /  6.2)      6  BUCK NAKED1 <dennis100@webtv.net>
0.808  (  5.8 /  7.2)      5  Ilmari Karonen <usenet11387@itz.pp.sci.fi>
0.768  (  7.7 / 10.0)      5  "Alan J. Flavell" <flavell@mail.cern.ch>
0.747  (  8.2 / 10.9)     11  ZepHead <groovyt@erols.com>
0.736  (  2.6 /  3.5)      7  "John Lin" <johnlin@chttl.com.tw>
0.684  (  7.7 / 11.3)      8  Michael Carman <mjcarman@home.com>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.404  (  4.9 / 12.1)      8  "Suzanne" <sbucciarelli1@home.com>
0.397  (  2.9 /  7.2)      6  "Michael Rolfe" <mumble[anti-spam]@maths.uct.ac.za>
0.391  (  1.1 /  2.9)      5  "Eric" <mail@ericmarques.net>
0.374  (  1.1 /  2.8)      5  =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
0.324  (  1.5 /  4.6)      6  John Lockwood <john@particlewave.com>
0.311  (  1.1 /  3.6)      5  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
0.303  (  2.8 /  9.1)     10  Jonathan Stowe <gellyfish@gellyfish.com>
0.293  (  2.2 /  7.4)      9  "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
0.275  (  2.4 /  8.9)     11  blahblah <blah@blah.com>
0.210  (  1.6 /  7.8)      7  "John W. Krahn" <krahnj@acm.org>

54 posters (14%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   44  flock and close   with  empty read strangeness
   43  Can a regex do this?
   26  Help to Install Perl
   22  RFC: FAQ3 update -- Using less memory
   18  Maintaining the number format and not exponential
   18  grabbing last word of a string
   17  Grokking map and grep
   16  Use PERL or Java? Which is faster?
   16  Trying to capture current directory in variable
   15  What's wrong with (remedial)...

These threads accounted for 20.1% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

 101.3 ( 50.6/ 46.5/ 28.6)     44  flock and close   with  empty read strangeness
  82.2 ( 43.9/ 34.9/ 16.7)     43  Can a regex do this?
  55.0 ( 23.7/ 29.7/ 16.5)     26  Help to Install Perl
  49.9 ( 19.6/ 29.3/ 17.4)     22  RFC: FAQ3 update -- Using less memory
  41.6 ( 14.2/ 25.6/ 13.4)     17  Grokking map and grep
  36.8 ( 16.2/ 18.1/ 11.8)     18  Maintaining the number format and not exponential
  34.1 (  8.1/ 25.0/ 22.7)      8  Perl fortune database - where? (was: Dynamic naming of arrays or hashes)
  33.9 ( 20.8/ 11.6/  4.6)     16  Use PERL or Java? Which is faster?
  33.0 ( 14.6/ 15.0/  8.7)     18  grabbing last word of a string
  29.8 ( 13.3/ 14.9/  6.4)     16  Trying to capture current directory in variable

These threads accounted for 22.5% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.910  ( 22.7/  25.0)      8  Perl fortune database - where? (was: Dynamic naming of arrays or hashes)
0.895  ( 15.0/  16.8)      7  Tk based alarm clock
0.844  (  6.4/   7.6)      5  Setting cookies in header to pass to Web Server?
0.841  (  1.5/   1.8)      5  ASP in Perl
0.779  (  5.3/   6.8)      6  pack double-network-order
0.766  (  4.3/   5.6)      6  Help!  Function call gives error 500!
0.764  (  5.1/   6.7)      9  cgi redirect not working
0.752  (  3.5/   4.7)      6  Time Conversion
0.745  (  4.0/   5.4)      6  Macbeth and Perl threads
0.744  (  3.3/   4.4)      6  Help Matt with small programs

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.429  (  5.5 / 12.8)      8  Programmer with vision required
0.429  (  6.4 / 14.9)     16  Trying to capture current directory in variable
0.418  (  0.9 /  2.2)      5  Feeding value pairs to ASP scripts?
0.415  (  3.6 /  8.8)      8  execution problem
0.406  (  2.4 /  5.8)      6  How to email an HTML page in Perl?????
0.402  (  3.9 /  9.7)     12  (Linux beginner) How to de-install and re-install Perl on Linux
0.401  (  4.6 / 11.6)     16  Use PERL or Java? Which is faster?
0.400  (  1.9 /  4.7)      8  Perl Newbie ???
0.319  (  0.9 /  2.9)      5  perl-ize and optimize
0.228  (  1.4 /  6.1)      8  Is Perl right for me?

82 threads (29%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      23  comp.lang.perl.modules
      16  comp.lang.java.misc
      16  comp.lang.java.programmer
      15  comp.lang.perl.moderated
      13  comp.lang.java.help
      13  alt.html
      12  comp.lang.perl
      10  alt.php
      10  alt.html.tags
      10  comp.lang.java.databases

Top 10 Crossposters
===================

Articles  Address
--------  -------

      12  "Darren" <darrenls21@yahoo.com>
      12  Harri Haataja <harri@tolppa.kotisivupalvelu.fi>
      12  Raman Sinha <raman@raman-sinha.com>
       8  =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
       6  "Brucie" <althtml@brucies.com>
       6  justin@indent.com.au
       6  * Tong * <sun_tong_001@yahoo.com>
       6  "keTTle_drum" <kettle_drum@yahoo.com>
       6  Chris Stith <mischief@velma.motion.net>
       6  Uri Guttman <uri@sysarch.com>


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

Date: Mon, 12 Mar 2001 17:18:50 +0100
From: H. Camphausen <h.camp@scm.de>
Subject: Re: Typeglob assignment confusion
Message-Id: <98isku$jal$1@surz18.uni-marburg.de>

[F'up zu James Taylor's Posting vom Mon, 12 Mar 2001 15:10:26 +0000]

> >       *bar = $foo;      # $bar = 'modified!' sets $foo to 'modified!'
> 
> Do you mean *bar = \$foo ?

Oops. Yes.

> [...]
> Yes, sadly this would seem to be the best way forward. It is a pity I
> cannot do what I want without creating global variables.

FMPOV, the @{...} and $...->[n]-syntaxes are perfectly readable, plus, 
they make it easy to see what you are working on (the passed reference).

Keep in mind, that prototyping your sub will only work the way you expect 
it to do if you call your sub like 

	testsub (...);

It will not work if you say

	&testsub (...);

Plus it will not work if called as a method.

Maybe you should consider passing an arrayref directly, without relying 
on the prototying-mechanism

	testsub {
	  unless (ref ($_[0]) eq 'ARRAY'){
	    warn "Not an array reference: $_[0]\n"; return
	  }
	  my $aref = shift;
	  #...
	}


	testsub (\@my_array);
 

> > hth + mfg, Hartmut
> 
> I know that HTH = Hope That Helps but am I right in thinking
> that MFG = More Friendly Garbage ?

Hmmm. Nearly.
In this world it means "Mit freundlichen Grüßen", i.e. kind of 
"w/ best regards", "cheers" and the like.


hth + iklgiapita + mfg, Hartmut


-- 
CREAGEN Computerkram     Fon: 06422/850527
Hartmut Camphausen       Fax: 06422/850528
Am kleinen Born 1        E-Mail: h.camp@creagen.de
35287 Amöneburg          WWW: http://www.creagen.de


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

Date: Mon, 12 Mar 2001 17:23:02 +0100
From: H. Camphausen <h.camp@scm.de>
Subject: Re: Typeglob assignment confusion
Message-Id: <98issq$jal$2@surz18.uni-marburg.de>

[F'up zu Anno Siegel's Posting vom 12 Mar 2001 15:34:35 GMT]

  
> > I know that HTH = Hope That Helps but am I right in thinking
> > that MFG = More Friendly Garbage ?
> 
> "Mit freundlichen Gruessen", a conventional letter-ending in German,
> much like "regards".  So you were pretty close, actually.

In fact, he was :-))


mfg, Hartmut 

-- 
CREAGEN Computerkram     Fon: 06422/850527
Hartmut Camphausen       Fax: 06422/850528
Am kleinen Born 1        E-Mail: h.camp@creagen.de
35287 Amöneburg          WWW: http://www.creagen.de


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

Date: Mon, 12 Mar 2001 16:39:11 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: Typeglob assignment confusion
Message-Id: <PY6r6.27751$V6.106030@news1.gvcl1.bc.home.com>

In article <ant121356868fNdQ@oakseed.demon.co.uk>,
 James Taylor <james@NOSPAM.demon.co.uk> writes:
>In article <98ih1m$249hj$3@fu-berlin.de>, Tina Mueller
><URL:mailto:tinamue@zedat.fu-berlin.de> wrote:
>>
>> put
>> use vars qw(@array);
>> 
>> at the beginning.
>
>Do you mean at the beginning of the whole program? If so then I would
>prefer to avoid creating what is in effect a global variable just for
>the sake of clarity within one subroutine. That seems rather like
>cutting off my nose to spite my face.
>
>Is it possible to say:
>
>sub testsub (\@) {
>    use vars qw(@array);
>    local *array = shift;
>    ...etc
>
>and would this scope the @array variable to the inside of the
>subroutine?

I don't know why no-one has mentioned it yet, but you can just say

	no strict 'vars';

inside your subroutine before the use of @array and its effect will
last only to the end of the enclosing scope, i.e., the subroutine.
And you could restrict it further by creating a smaller lexical
scope with braces.

HTH.

-- 
Peter Scott


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

Date: Mon, 12 Mar 2001 16:31:13 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: usage of $SIG{__WARN__} and $SIG{__DIE__}
Message-Id: <lR6r6.27747$V6.106030@news1.gvcl1.bc.home.com>

In article <98hen8$mfu@netnews.hinet.net>,
 "John Lin" <johnlin@chttl.com.tw> writes:
>When I first learned Perl, I often used $SIG{__WARN__}
>and $SIG{__DIE__} in cron jobs to capture and redirect
>error messages to log files.  They often caused trouble
>if other modules also use $SIG{__DIE__}.
>
>Until I learned the usage of open(STDERR,">>logfile"),
>now I doubt whether my previous usage of $SIG{__DIE__}
>and $SIG{__WARN__} was inappropriate.
>
>Since exceptions are catchable by eval {}, in what
>situation will you use $SIG{__DIE__} ?

A number of people think that __DIE__ is more of a liability
than an asset, since it ends up being called even when an
eval {} is in place.  There are periodic intense discussions on
the meaning of 'fatal exception.'

Nevertheless, you might use it either where you want its effects
over more code than you care to wrap in an eval {}, or where you
are not in a position to do so, i.e., writing a module.  CGI::Carp
uses it for this purpose.

>The same question on $SIG{__WARN__}, in what situation
>would $SIG{__WARN__} be considered useful?

I just had occasion to use it where I am using a CPAN module that calls
warn() in many situations where I would like to suppress it.
Rather than clone the module, I just set up a __WARN__ handler
that looks at the message and drops it on the floor if it matches
a certain pattern.

-- 
Peter Scott


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 472
**************************************


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