[6808] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 433 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 5 14:17:16 1997

Date: Mon, 5 May 97 11:00:26 -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, 5 May 1997     Volume: 8 Number: 433

Today's topics:
     Re: @INC and . (Dan Niles)
     Freelance programmers needed <abc55@dial.pipex.com>
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Mike Stok)
     Re: Loosing clpm regulars (was Re: Perl auto-replier) <gtk@walsh2.med.harvard.edu>
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (I R A Aggie)
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Adam Worrall)
     MANCGI: a centralized multi hosts unix MAN cgi utility <lele@mantegna.casaccia.enea.it>
     Re: MLDBM|Argh my brain is frying! (Gurusamy Sarathy)
     perl 5.0 script required <John@highcs.demon.co.uk>
     Perl FAQ part 0 of 0..9: General Questions [Periodic Po <perlfaq-suggestions@mox.perl.com>
     Re: perl IDE? <stephen+usenet@farrell.org>
     Re: Perl on NT Servers (Luke Brennan)
     Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce <gtk@walsh2.med.harvard.edu>
     Re: Problem with uppercase reg exp (Michael Fuhr)
     Re: Problem with uppercase reg exp <eike.grote@theo.phy.uni-bayreuth.de>
     Re: Q: special characters search and replace in perl (brian d foy)
     String::Approx 2.0 <jhi@alpha.hut.fi>
     Re: Substituting multiple lines <ajohnson@gpu.srv.ualberta.ca>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 May 1997 16:18:33 GMT
From: dan@jane.apg.more.net (Dan Niles)
Subject: Re: @INC and .
Message-Id: <5kl18p$j04$1@news.more.net>

dan@more.net (Dan Niles) writes:
> Why does perl stop printing if I remove '.' from @INC?

Thanks to all who replied, here and in email.  It turned out to
be some wierd behavior introduced by the Safe module and the 
safecgiperl routines.

Dan



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

Date: Mon, 05 May 1997 18:11:17 +0100
From: "." <abc55@dial.pipex.com>
Subject: Freelance programmers needed
Message-Id: <336E14AD.7989@dial.pipex.com>

Hi,

I'm looking to make contact a.s.a.p. with expert programmers of
Perl, C++, Java and Javascript for a variety of Internet projects.

I'm particularly looking for prgrammers residing in London, U.K. but I
would be interested to hear from anyone able to telework on a flxible
basis.

Please send details of your skills and daily rates to
abc55@dial.pipex.com


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

Date: 5 May 1997 14:35:46 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <5kkr82$25v@news-central.tiac.net>

In article <fl_aggie-ya02408000R0505970944190001@news.fsu.edu>,
I R A Aggie <fl_aggie@hotmail.com> wrote:

>+ I wish people would just learn to use www.dejanews.com.
> 
>I wish people would just learn to read the man pages.

So all we need is some way of applying a patch to human nature...

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: 04 May 1997 18:34:58 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <w27mhe988d.fsf@walsh2.med.harvard.edu>

aml@world.std.com (Andrew M. Langmead) writes:

> This groups hasn't had a regularly posted FAQ in years.

That is certainly no longer true.  Today, for example, the 9-part FAQ
immediately followed your article on my server.

> And before that, the person who the FAQ maintainer had instructed to
> post the FAQ on his behalf wasn't posting with "Expires" headers to
> keep the article around. It was also out of date and had little perl
> 5 information.

I don't know about the first issue, but the second is also no longer
true.  The new Perl FAQ has lots of perl 5 information, and the FAQ
posted  on 4 May 1997 had changes as recently as 24 April 1997.

Greg

--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro"    Finger for PGP info



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

Date: Mon, 05 May 1997 09:44:19 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <fl_aggie-ya02408000R0505970944190001@news.fsu.edu>

In article <5kjdlh$8eo@news1-alterdial.uu.net>, Matt Kruse
<mkruse@shamu.netexpress.net> wrote:

[about making a newbie magnet out of clp.wizards]

+ You missed the humor, Randal.  That's the point - attract the newbies, 
+ and no one who knows anything will read .wizards.  So the other groups 
+ wouldnt get the newbie questions.  I like it :)

Except newbies also tend to crosspost to all over the place, so as to
"better the odds of getting an answer". 

+ I wish people would just learn to use www.dejanews.com.
 
I wish people would just learn to read the man pages.

James

-- 
Consulting Minister for Consultants, DNRC

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


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

Date: Mon, 5 May 1997 17:02:32 GMT
From: worrall@maxx.cs.bris.ac.uk.no-spam (Adam Worrall)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <qpafm9etsn.fsf@maxx.cs.bris.ac.uk.no-spam>

>>>>> "Matt" == Matt Kruse <mkruse@shamu.netexpress.net> writes:

    Matt> You missed the humor, Randal. That's the point - attract the
    Matt> newbies, and no one who knows anything will read .wizards. So
    Matt> the other groups wouldnt get the newbie questions. I like it
    Matt> :)

How about secretly moving to a new group, say

	alt.pets.camels

and then saying something obtuse like 

	"... of course, all _real_ Perl programmers are interested in
         Camels, and regularly read alt.pets.camels ..."

in the resources section of the FAQ. Then people who actually read it
will find their way there ...

 - Adam
-- 
-- 
 Adam.Worrall@bristol.ac.uk       http://www.cs.bris.ac.uk/~worrall
 The London Mathematical Society  http://www.lms.ac.uk



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

Date: Mon, 05 May 1997 10:12:30 +0200
From: lombardi emanuele <lele@mantegna.casaccia.enea.it>
Subject: MANCGI: a centralized multi hosts unix MAN cgi utility
Message-Id: <336D966E.167E@mantegna.casaccia.enea.it>

mancgi.pl is a cgi for getting manual pages from various hosts.
The man pages are translated 'on the fly' using a modified version of
man2html (version 2.1.0 of Earl Hood, ehood@convex.com) I called
man2html4cgi

As initial page the cgi presents an help page which can rediplayed
pressing the ? button later.

The user can ask for man pagea or for the man -k (apropos)
informations. In any case all the references to other man pages are 
coverted into hyper link and the user can navigate on the man pages.

The user can select from wich host ask the man informations. 
Of course that implies that user running the web-server has granted some
remote access (via .rhosts) to some other machine. 
If this appens then from the web browser you can select which machine
ask for the man pages.

All this stuff is usefull for having a single web browser to get all 
the man info about all the machine (and operating systems) you work on!

WHERE TO GET IT: ftp://mantegna.casaccia.enea.it/lele/mancgi.tar.gz

PREREQUISITES:  UNIX
                perl    v5.0    or later
                CGI.pm  v2.29   or later

INSTALL:
                mancgi.README   this file
                mancgi.pl       to be installed in /cgi-bin
                man2html4cgi    to be installed in /cgi-bin

NOTES:
                the user running the web-server must have sh as login
shell
                Not any other shell due to the redirection of std-err
                made as 2&1 in mancgi.pl

USAGE:          http://your.server.domain:/cgi-bin/mancgi.pl

TESTED:         netscape communication server running on Digital UNIX
4.0
                remote hosts:   SUNOS 4.1.3
                                CRAY
                                DIGITAL ALPHA SERVER & STATIONS



Enjoy it!
Emanuele Lombardi


I really apreciate comments, suggestions and bug report:

<pre>
+-----------------------------+ Emanuele Lombardi
|  Oh no, why has my screen   |
|  gone blank?                | mail: AMB-GEM-CLIM ENEA Casaccia
|                      \\\\/  |       I-00060 S.M. di Galeria (RM) 
|     _\\|//_           O-O   |       ITALY
|    (' O-O ')           |    | mailto://lele@mantegna.casaccia.enea.it
|---ooO-(_)-Ooo--------  -    | 
|                             | tel     +39 6 30483366
+-----------------------------+ fax     +39 6 30483591
</pre>


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

Date: 5 May 1997 15:06:13 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: MLDBM|Argh my brain is frying!
Message-Id: <5kkt15$6ed@srvr1.engin.umich.edu>


 [ mailed and posted ]

In article <5k0kdk$6ef@lace.colorado.edu>,
Blake Kritzberg <kritzber@ucsub.Colorado.EDU> wrote:
>I am also not clear whether with MDLBM, it's possible to
>reach directly into the hash and yank out a value like
>$active = $req{CO55515}{status}, which would save me a lot
>of work. If it is, I'm not using the right approach.

Yes, $req{'CO55515'}{'status'} will work.

>use Fcntl;
>use MLDBM qw(GDBM_File);
>
>....
>
>$dbm = tie my %pr, "MLDBM", "$db", "O_RD", 0640 or die $!;
                             ^^^^^  ^^^^^^
                                    The tombot must've told
you off about these, one of which isn't damaging, the other is.

>while((my $k, my $v) = each (%pr)) {
>     while ((my $k1, my $v1) = each (%$v)) {
>          if ($k1 eq "openDate") {
>             my $toggleOpen = $v1 if ($mydate >= $thisdate);
>          }
>          if ($k1 eq "closeDate") {
>             my $toggleClose = $v1 if ($mydate <= $thisdate);
>          }
>       }
>       if ($toggleOpen && $toggleClose) {
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
            this will never be true, 'cause they aren't alive here.

>          $mystatus = "ACTIVE";
>          $reloop = "on";
           ^^^^^^^
           Hmm, I hope this $reloop thing is global on purpose.

>       } else {
>          $mystatus = "INACTIVE";
>       }
>       $tmp = $pr{$k};
>       $tmp->{status} = "$mystatus";
                         ^^^^^^^^^^^
                         more tombot fodder.
>       $pr{$k} = $tmp;
>
>### stolen from T. Christianson's Ye Olde Data Cookbooke
>
>       if ($reloop eq "on") {
>           $num = $k;
------
>           $rec = {};
>           $req{$num} = $rec;
            ^^^^^^^^^^^^^^^^^
            This line should go *after* the while loop following.

>           while ((my $k1,my $v1) = each (%$v)){
>               $rec->{$k1} = $v1;
>           }
------
I daresay you can replace that while block with just:
            $req{$num} = $v;

>       }
>}
>
>untie(%pr);


 - Sarathy.
   gsar@umich.edu


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

Date: Mon, 5 May 1997 17:55:11 +0100
From: John Dickson <John@highcs.demon.co.uk>
Subject: perl 5.0 script required
Message-Id: <USFhqAAvDhbzEwfG@highcs.demon.co.uk>

I represent a small business which designs web sites for it's metier.
We are unable to work out a client requirement which I believe is best
solved in Perl.
The client wants a form that sends it's input to the server where it is
stored for 6 months as an ASCII text file. And a button to appear
elsewhere on the site which retreives the file from the server and posts
it to an address specified in the `button` tag.

Ideally we feel that a student might wish to undertake this work as we
are not a large company that can offer decadent rates.
However we can offer decent renumeration, and definately more work in
the future.
If this project appears to be of interest to you please e-mail me
A.S.A.P. and I'll send a spec and details as you require.
All contributions welcome,

John Dickson,
(on behalf of the High Cs Partnership)


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

Date: 4 May 1997 21:45:22 GMT
From: PerlFAQ <perlfaq-suggestions@mox.perl.com>
Subject: Perl FAQ part 0 of 0..9: General Questions [Periodic Posting]
Message-Id: <5kj01i$90a$1@csnews.cs.colorado.edu>

NAME
    perlfaq - frequently asked questions about Perl 
		($Date: 1997/04/24 22:46:06 $)

DESCRIPTION
    This document is structured into the following sections:

    perlfaq: Structural overview of the FAQ.
        This document.

    the perlfaq1 manpage: General Questions About Perl
        Very general, high-level information about Perl.

    the perlfaq2 manpage: Obtaining and Learning about Perl
        Where to find source and documentation to Perl, support and
        training, and related matters.

    the perlfaq3 manpage: Programming Tools
        Programmer tools and programming support.

    the perlfaq4 manpage: Data Manipulation
        Manipulating numbers, dates, strings, arrays, hashes, and
        miscellaneous data issues.

    the perlfaq5 manpage: Files and Formats
        I/O and the "f" issues: filehandles, flushing, formats and
        footers.

    the perlfaq6 manpage: Regexps
        Pattern matching and regular expressions.

    the perlfaq7 manpage: General Perl Language Issues
        General Perl language issues that don't clearly fit into any of
        the other sections.

    the perlfaq8 manpage: System Interaction
        Interprocess communication (IPC), control over the user-interface
        (keyboard, screen and pointing devices).

    the perlfaq9 manpage: Networking
        Networking, the Internet, and a few on the web.

  Where to get this document

    This document is posted regularly to comp.lang.perl.announce and
    several other related newsgroups. It is available in a variety of
    formats from CPAN in the /CPAN/doc/FAQs/FAQ/ directory, or on the web
    at http://www.perl.com/perl/faq/ .

  How to contribute to this document

    You may mail corrections, additions, and suggestions to perlfaq-
    suggestions@perl.com . Mail sent to the old perlfaq alias will merely
    cause the FAQ to be sent to you.

  What will happen if you mail your Perl programming problems to the authors

    Your questions will probably go unread, unless they're suggestions of
    new questions to add to the FAQ, in which case they should have gone
    to the perlfaq-suggestions@perl.com instead.

    You should have read section 2 of this faq. There you would have
    learned that comp.lang.perl.misc is the appropriate place to go for
    free advice. If your question is really important and you require a
    prompt and correct answer, you should hire a consultant.

Credits
    When I first began the Perl FAQ in the late 80s, I never realized it
    would have grown to over a hundred pages, nor that Perl would ever
    become so popular and widespread. This document could not have been
    written without the tremendous help provided by Larry Wall and the
    rest of the Perl Porters.

Author and Copyright Information
    Copyright (c) 1997 Tom Christiansen and Nathan Torkington. All rights
    reserved.

  Noncommercial Reproduction

    Permission is granted to distribute this document, in part or in full,
    via electronic means or printed copy providing that (1) that all
    credits and copyright notices be retained, (2) that no charges beyond
    reproduction be involved, and (3) that a reasonable attempt be made to
    use the most current version available.

    Furthermore, you may include this document in any distribution of the
    full Perl source or binaries, in its verbatim documentation, or on a
    complete dump of the CPAN archive, providing that the three
    stipulations given above continue to be met.

  Commercial Reproduction

    Requests for all other distribution rights, including the
    incorporation in part or in full of this text or its code into
    commercial products such as but not limited to books, magazine
    articles, or CD-ROMs, must be made to perlfaq-legal@perl.com. Any
    commercial use of any portion of this document without prior written
    authorization by its authors will be subject to appropriate action.

  Disclaimer

    This information is offered in good faith and in the hope that it may
    be of use, but is not guaranteed to be correct, up to date, or
    suitable for any particular purpose whatsoever. The authors accept no
    liability in respect of this information or its use.

Changes
    24/April/97
        Style and whitespace changes from Chip, new question on reading
        one character at a time from a terminal using POSIX from Tom.

    23/April/97
        Added http://www.oasis.leo.org/perl/ to the perlfaq2 manpage.
        Style fix to the perlfaq3 manpage. Added floating point precision,
        fixed complex number arithmetic, cross-references, caveat for
        Text::Wrap, alternative answer for initial capitalizing, fixed
        incorrect regexp, added example of Tie::IxHash to the perlfaq4
        manpage. Added example of passing and storing filehandles, added
        commify to the perlfaq5 manpage. Restored variable suicide, and
        added mass commenting to the perlfaq7 manpage. Added Net::Telnet,
        fixed backticks, added reader/writer pair to telnet question,
        added FindBin, grouped module questions together in the perlfaq8
        manpage. Expanded caveats for the simple URL extractor, gave LWP
        example, added CGI security question, expanded on the email
        address answer in the perlfaq9 manpage.

    25/March/97
        Added more info to the binary distribution section of the perlfaq2
        manpage. Added Net::Telnet to the perlfaq6 manpage. Fixed typos in
        the perlfaq8 manpage. Added mail sending example to the perlfaq9
        manpage. Added Merlyn's columns to the perlfaq2 manpage.

    18/March/97
        Added the DATE to the NAME section, indicating which sections have
        changed.

        Mentioned SIGPIPE and the perlipc manpage in the forking open
        answer in the perlfaq8 manpage.

        Fixed description of a regular expression in the perlfaq4 manpage.

    17/March/97 Version
        Various typos fixed throughout.

        Added new question on Perl BNF on the perlfaq7 manpage.

    Initial Release: 11/March/97
        This is the initial release of version 3 of the FAQ; consequently
        there have been no changes since its initial release.

-- 
	Tom Christiansen	tchrist@jhereg.perl.com

            /* dbmrefcnt--;  */     /* doesn't work, rats */
        --Larry Wall in hash.c from the v4.0 perl source code


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

Date: Sun, 4 May 1997 22:37:01 GMT
From: stephen farrell <stephen+usenet@farrell.org>
Subject: Re: perl IDE?
Message-Id: <877mhe7tki.fsf@phaedrus.uchicago.edu>


brdavis@orion.ac.hmc.edu (Brooks Davis) writes:

> Bryan Green (green@primenet.com) wrote:
> : Is there any kind of IDE for perl? 
> 
> Not specificaly, that I know of.  I don't think the Perl community could
> agree on what an editor should do enough to actually create a single
> standard IDE.
> 
> However, there is an emacs mode which tries to make your code conform to
> its programmer's idea of perl code.  Also, nvi and elvis have have syntax
> highlighting modes for perl.  I think BBEdit has a perl mode and I've
> heard good things about it as a PC/Mac editor.  As to Visual C++, I really
> don't know.
> 
> -- Brooks

I agree with these comments, and personally (of course) use perl-mode
in emacs for programming in perl.  However, the original poster might
be interested in a GUI builder for Tk/Perl which is available:

	http://www.keck.ucsf.edu/~kvale/specperl.html

It requires specTcl from sunsoft:

	http://www.sunlabs.com/research/tcl/spectcl/

but from what I've seen is pretty nifty.

--steve farrell


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

Date: 5 May 1997 11:24:24 GMT
From: L.Brennan@isu.usyd.edu.au (Luke Brennan)
Subject: Re: Perl on NT Servers
Message-Id: <5kkg18$abb@metro.usyd.edu.au>


In article <336C007A.12CC@mail.idt.net>
John Giblin <giblin@mail.idt.net> wrote:

> 
> Hey all,
> 
> I just moved from a unix to a NT Server.  I have change the ext. to .pl,

  CONGRATULATIONS! Another UNIX box gets turned off :-)

> but when I hit the submit button it asks me where to save the script. 
> Do I have to do anything else?

  Yes - configure your IIS server correctly. (CGI, not PERL problem)
  PERL from web pages on NT server?

  Under IIS, check out Knowledge Base articles Q156755 and Q150629. 
  Without these, Perl may not run correctly.
  Then just call the script from a form:
  <form method="POST" name="/cgi-bin/scriptname.pl">

  Luke




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

Date: 04 May 1997 18:28:10 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
Message-Id: <w2911u98jp.fsf@walsh2.med.harvard.edu>


tcyang@netcom.com (Tung-chiang Yang) writes:
> 
> A. Deckers (I-hate-cyber-promo@man.ac.uk) wrote:
> 
> : (deleted)
> 
> : >Second, if a posting is rejected, will there be notification that it
> : >was rejected?  Speaking for myself, if I did not see the post in a
> : [...]
> : >Finally, if a post has been rejected, would there be anything telling
> : >me why it had been rejected?  In light of some of the criteria (
> : [...]
> 
> : Yes and yes. The article would be returned together with the group's
> : charter and an explanation of why the article was rejected.
> 
> To enable this, you had better clearly specify either of the followings:
> 
> (1) posts with valid return address only, or
> (2) if the poster chooses to use a munged address, he/she would not receive
>     any explanations for being rejected.

Right on.  I'd vote for (1).

--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro"    Finger for PGP info



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

Date: 5 May 1997 10:18:54 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Problem with uppercase reg exp
Message-Id: <5kl19e$8lk@nova.dimensional.com>

    [ cc to author ]
mel@west.net writes:

> I'm somewhat new to PERL and am having a problem with case pattern
> matching. Specifically, I'm trying to convert, for example,
> weight_unit to Weight Unit. So far I've done this:
>
> $x = "weight_unit";
> $x =~ s/_/ /g;                         # convert underscores to spaces
> $x =~ s/^\ba-z/A-Z/g;   # convert 1st letter of each word to uppercase
>
> But all I get back is: weight unit. Can someone help with me with
> this? I've tried some sensible variations, but none worked.

Here's one way:

    $x = "weight_unit";
    $x =~ tr/_/ /;
    $x =~ s/\b([a-z])/\u$1/g;

Hope this helps.
-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Mon, 05 May 1997 14:54:37 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Problem with uppercase reg exp
Message-Id: <336DD88D.446B@theo.phy.uni-bayreuth.de>

Hi,

mel@west.net wrote:
> 
> Hi,
> 
> I'm somewhat new to PERL and am having a problem with case pattern
> matching. Specifically, I'm trying to convert, for example,
> weight_unit to Weight Unit. So far I've done this:
> 
> $x = "weight_unit";
> $x =~ s/_/ /g;                         # convert underscores to spaces
> $x =~ s/^\ba-z/A-Z/g;   # convert 1st letter of each word to uppercase
> 
> But all I get back is: weight unit. Can someone help with me with
> this? I've tried some sensible variations, but none worked.

O.K., let's do this step by step ...

1)   $x = "weight_unit";

     seems to be alright    ;-)

2)   $x =~ s/_/ /g;   

     works, too, but often better (faster) is

     $x =~ tr/_/ /;    # replacement of single characters

3)   $x =~ s/^\ba-z/A-Z/g;

     better forget about this one ...

     I think you wanted something like this:

     $x =~ s/\b([a-z])/\u$1/g;

     Some notes:
     - '^' matches only the beginning of the _whole_ string
     - '[a-z]' matches any character of the class a,b,c,d,...,z
     - '([a-z])' assigns this (matched) character to the special 
       variable $1
     - '\u' produces the uppercase version of the following character
       (which in this case is the matched one in variable $1).

     - Just in case you want to uppercase only one word you can
       simply say
                      $upper_case = "\u$lower_case";
       or
                      $upper_case = ucfirst($lower_case);


Bye, Eike

======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: Mon, 05 May 1997 12:59:58 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Q: special characters search and replace in perl
Message-Id: <comdog-0505971259580001@nntp.netcruiser>

In article <e9127005-0505971728500001@sozgr.htu.tuwien.ac.at>,
e9127005@stud1.tuwien.ac.at (Sascha Kerschhofer) wrote:

> In need to search for characters which hexcode is known (since I want to
> recive messages from a HTML Form in german).
> 
> e.g. 
> replace each characters which hexcode is C4 with "&Auml;".
> 
> the command 
>                 %data =~ s/\xC4/&Auml;/g;
> doesnt work, since the s/// operator works only for scalar variables.

work with the individual key/value pairs:

foreach ( keys %data )
   {
   $data{$key} =~ s/\xC4/&Auml;/g;
   }

# or

while ( ($key, $value) = each %data )
   {
   $data{$key} =~ s/\xC4/&Auml;/g;
   }

-- 
brian d foy                              <URL:http://computerdog.com>                       
unsolicited commercial email is not appreciated


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

Date: 5 May 1997 16:41:20 GMT
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: String::Approx 2.0
Message-Id: <5kl2jg$k9v$1@nadine.teleport.com>


String::Approx ANNOUNCE

String::Approx v2.0

This Perl module implements approximate matching aka fuzzy matching.
Also the substitution operation is supported.

This release should be several times faster than the previous
major release, v1.*, of String::Approx.

The call syntax of this release is not directly downward compatible
with the previous major release but there is a backward compability
mode available.  This change was made both because of the speed-up
work and because of the need to match also from somewhere else than
just the $_.  I am sorry about this change but I hope the new speed
and features make up for the inconvenience.

The new release is available from

  http://www.perl.com/CPAN/modules/by-module/String/String-Approx-2.0.tar.Z

-- 
Jarkko Hietaniemi <jhi@iki.fi>




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

Date: Mon, 05 May 1997 09:49:03 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Substituting multiple lines
Message-Id: <336DF35F.101CC2F0@gpu.srv.ualberta.ca>

Tad McClellan wrote:
! 
! Kilpilinna Sami (k113973@cc.tut.fi) wrote:
! 
! : I have a small real life problem which many of you can solve
! : easily, I'm sure. I have a large number of HTML files and each
! : of them has, among other things, these four lines of code:
! 
! 
! : <CENTER><TABLE WIDTH=97%><TR><TD ALIGN=left>
! : <A HREF=../menu.html onMouseOver="window.status='Go to
! : menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30
! : HEIGHT=30 BORDER=0></A>
! : </TD>
! : <TD ALIGN=right>
! 
! 
! : Now, I would like to cut out this part:
! 
! : <TD ALIGN=left>
! : <A HREF=../menu.html onMouseOver="window.status='Go to
! : menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30
! : HEIGHT=30 BORDER=0></A>
! : </TD>
! 
! : Which means that these things remain:
! 
! : <CENTER><TABLE WIDTH=97%><TR>
! : <TD ALIGN=right>
! 
snip
! 
! It does handle multiple lines. The problem is getting the
! multiple lines into a variable to s///g against. The -p
! switch only gets you one line at a time...
! 
! So, you could read the entire HTML file into a string, and
! then apply the substitution:
! 
! 
! $htmlfile = join '', <>;              # or set: $/ = '';
! $htmlfile =~ s#<TD.*?</TD>##s;        # UNTESTED!
! 
! 
! or as a one-liner:
! 
! perl -pi -0777 -e 's#<TD.*?</TD>##s' *.html
! 

I would only add that the substitution pattern should 
specify enough of the table cell that is to be removed
to make it unique---the above would remove all of
the table entries in the html files, while the original
example posted suggests that only one of many table entries
is to be removed.

perhaps 
s#<TD ALIGN=left>.*?</TD>##s

would be enough to identify the cell you want removed, or
perhaps it would be necessary to include some of the anchor
as well.

regards
andrew


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

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

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