[12628] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 37 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 02:47:21 1999

Date: Tue, 6 Jul 1999 23:37:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 6 Jul 1999     Volume: 9 Number: 37

Today's topics:
    Re: name confusion (William Herrera)
    Re: name confusion (William Herrera)
    Re: name confusion (Abigail)
    Re: name confusion (Tad McClellan)
    Re: name confusion (Jon Bell)
    Re: name confusion (Iain Chalmers)
    Re: name confusion (Marcel)
    Re: name confusion (John G Dobnick)
        Need an advice : C vs Perl <pierre-michel.ansel@steria.fr>
    Re: Need an advice : C vs Perl (Cameron Laird)
    Re: Need an advice : C vs Perl (Abigail)
    Re: Need an advice : C vs Perl <pierre-michel.ansel@steria.fr>
    Re: Need an advice : C vs Perl (Gary O'Keefe)
        Net::POP# problems... <tim@freakville.com>
        Net::Telnet in AS/400 environment <mpelle@epix.net>
    Re: Net::Telnet in AS/400 environment pkolis@lvwebmasters.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 03 Jul 1999 00:41:48 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: name confusion
Message-Id: <377d5a16.122629264@news.rmi.net>

Ah, a problem close to my heart. The following is the first Perl
package I ever wrote (I've been programming since the seventies but
only started using Perl the last 6 months). This is working code, part
of an online HTML-based medical record database system. If you see
bugs, we'd like to know. ( 'suffix' in this program is something like
'Ph.D.' ). The code is probably optimizable, but I haven't wanted to
tinker much with what works.

===========  cut  =============

use strict;


############################
#
# @resultStrings = ParseOutName($searchString, @formatTags, 
#                     @prefixTags, @exclusions, @suffixes);
#
# return undef if nothing found like a name
#
# $searchstring passed by val, all others by reference
############################


sub ParseOutName
{
  my($str) = shift;
  my($fmtRef) = shift;
  my($prefixRef) = shift;
  my($exRef) = shift;
  my($suffixRef) = shift;
  my(@candidates) = (); 
  my(@returnArray) = ();

  my($first, $last, $middle, $suffix);

  foreach(@{$prefixRef})
  {
    if($_ eq "")
    {
      push(@candidates, $str);
    }
    else
    {
      my($s1, $s2);
      ($s1, $s2) = split(/\Q$_/i, $str, 2);
      push(@candidates, $s2) if (defined($s2));
    }
  }

  # now process candidates.
CANDIDATE:
  my($c, $ex);
  foreach $c (@candidates)
  {
    # make sure no exclusions.
    foreach $ex (@{$exRef})
    {
      next CANDIDATE if ($ex ne "" && $c =~ /\Q$ex/);
    }
    # see if we have less than six words in the string.
    my(@words) = split(/\s+/, $c);
    next if( $#words > 5 );  # probably a sentence of text

    $first = "";
    $last = "";
    $middle = "";
    $suffix = "";
    
    # see if matches last name first pattern, return formatted if so.
    if( $c =~ /^\s*([a-zA-Z\Q-.'\E]+),\s*([a-zA-Z\Q-.'\E]+)[\Q
,\E]*([a-zA-Z\Q-.'\E]*)[\Q ,\E]*([a-zA-Z\Q-'.\E]*)/ )
    {
      $first = $2;
      $last = $1;
      if(defined($3) && $3 ne "" && defined($4) && $4 ne "")
      {
        $middle = $3;
        $suffix = $4;
      }
      elsif(defined($3) && $3 ne "")
      {
        # check for any suffixes in $3, if so is suffix, otherwise
middle.
        my($t) = $3;
        my($isSuffix) = 0;
        foreach(@{$suffixRef})
        {
          if( $t =~ /\Q$_/i )
          {
            $suffix = $t;
            $isSuffix = 1;
            last;
          }
        }
        if($isSuffix == 0)
        {
          $middle = $t;
        }
      }
      MakeFormattedList($first, $middle, $last, $suffix, 
                        $fmtRef, \@returnArray);
      return @returnArray;
    }
    
    # if not, see if matches first name first pattern;
    #         return formatted if so.
    if($c =~ /(^\s*[a-zA-Z\Q\'.\E]+)\s+([a-zA-Z\Q-.'\E]+)[\Q
,\E]*([a-zA-Z\Q-'.\E]*)[\Q ,\E]*([a-zA-Z\Q-'.\E]*)/)
    {
      $first = $1;
      if(defined($3) && $3 ne "" && defined($4) && $4 ne "")
      {
        $last = $3;
        $middle = $2;
        $suffix = $4;
      }
      elsif(defined($3) && $3 ne "")
      {
        my($s2) = $2;
        my($s3) = $3;
        # check for any suffixes in $3, if so is suffix, otherwise
last.
        my($isSuffix) = 0;
        foreach(@{$suffixRef})
        {
          if( $s3 =~ /\Q$_/i )
          {
            $last = $s2;
            $suffix = $s3;
            $isSuffix = 1;
            last;
          }
        }
        if($isSuffix == 0)
        {
          $last = $s3;
          $middle = $s2;
        }
      }
      else  # just first last
      {
        $last = $2;
      }
      MakeFormattedList($first, $middle, $last, $suffix, 
                        $fmtRef, \@returnArray);
      return @returnArray;
    }    
  }
  @returnArray = ();
  return;  # nothing found.
}

sub MakeFormattedList
{
  my($first) = shift;
  my($middle) = shift;
  my($last) = shift;
  my($suffix) = shift;
  my($fmtRef) = shift; # pass format array by ref
  my(@fmt) = @{$fmtRef}; # copy of this so will not modify original
  my($retArrayRef) = shift; # ref: what return values are stuffed into
 
  @{$retArrayRef} = ();  # initial return value is ().

  foreach (@fmt)
  {
    my($t);
    $t = ucfirst $first;
    s/\%f/$t/g;
    $t = uc $first;
    s/\%F/$t/g;
    $t = ucfirst $last;
    s/\%l/$t/g;
    $t = uc $last;
    s/\%L/$t/g;
    $t = ucfirst $middle;
    s/\%m/$t/g;
    $t = uc $middle;
    s/\%M/$t/g;
    $t = uc (substr($middle, 0, 1));
    s/%I/$t/g;
    $t = ucfirst $suffix;
    s/\%s/$t/g;
    $t = uc $suffix;
    s/\%S/$t/g;
    push(@{$retArrayRef}, $_);
  }
}

return 1;


On Fri, 02 Jul 1999 22:08:03 GMT, bing-du@tamu.edu wrote:

>Hi,
>
>I am wondering if there is any readily available Perl script for
>formatting person's name.  Seems parents are getting more creative in
>giving names to their child.
>
>In the people file I am going to process, people's lastname, firstname
>and middlename are put into different orders:
>
>lastname firstname middlename Jr (or III, or II)
>lastname Jr (or III, or II) firstname middlename
>
>Some people have double lastnames, firstnames or middlenames(two or more
>words in their lastnames, firstnames or middlenames).
>
>I need to extract the lastname and the firstname from a full name.
>
>Can somebody shed some light on this?
>
>Thanks in advance for any help.
>
>Bing


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Sat, 03 Jul 1999 03:27:23 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: name confusion
Message-Id: <377d813f.132656151@news.rmi.net>

On 2 Jul 1999 18:05:13 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>
>Consider the mellifluous name:
>
>    Doña María Jesús Concepción García Lorca de Jiménez
>
>Her honorific is Doña.
>Her surnames are García Lorca.
>Her fathers's (first) surname is García.
>Her mother's (first) surname is Lorca.
>Her Christian names are María Jesús.
>Her Communion name is Concepción.
>Her husband's (first) surname is Jiménez.
>And she probably goes by Concha. :-)

Actually I have an uncle in Barcelona with a name almost that long.
However, he doesn't sign it that way when he fills out his customs
papers for entry at the airport here :).

>What you ask simply cannot be done, because it's just not determinable.
>The only thing you can do is give someone enough space to write it all in.
>You gave give separate labelled sections if you want to what various
>components are.  Nothing else works.

If you stick to the signatures used in American English letter
dictation in common parlance, you can do it with maybe a 0.5% error
rate, given a database of 60000 dictations ;-). Unfortunately that is
still a lot of errors.

That last percent is maybe impossible then? I really wish there was
someting as reliable as Date::Manip for names.



---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: 3 Jul 1999 03:39:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: name confusion
Message-Id: <slrn7nrj16.31h.abigail@alexandra.delanet.com>

bing-du@tamu.edu (bing-du@tamu.edu) wrote on MMCXXXI September MCMXCIII
in <URL:news:7ljd7r$o18$1@nnrp1.deja.com>:
[] 
[] I need to extract the lastname and the firstname from a full name.


I don't have a lastname.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 3 Jul 1999 06:09:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: name confusion
Message-Id: <8hnkl7.m84.ln@magna.metronet.com>

bing-du@tamu.edu wrote:

: I need to extract the lastname and the firstname from a full name.


   With some names, the lastname is the surname, and the firstname
   is the given name.

   With other names, the firstname is the surname, and the lastname
   is the given name.



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 3 Jul 1999 19:49:01 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: name confusion
Message-Id: <FEB8Dp.7I6@presby.edu>

 Abigail <abigail@delanet.com> wrote:
>bing-du@tamu.edu (bing-du@tamu.edu) wrote on MMCXXXI September MCMXCIII
>in <URL:news:7ljd7r$o18$1@nnrp1.deja.com>:
>[] 
>[] I need to extract the lastname and the firstname from a full name.
>
>I don't have a lastname.

And there's a certain "Artist" (formerly known as...) who doesn't have a
first name, either!  :-)

-- 
Jon Bell <jtbell@presby.edu>


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

Date: Mon, 05 Jul 1999 13:59:59 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: name confusion
Message-Id: <bigiain-0507991400000001@bigman.mighty.aust.com>

<-snip->

> That last percent is maybe impossible then? I really wish there was
> someting as reliable as Date::Manip for names.

Hey, you gurus all forgot to say look in the FAQ^H^H^H CPAN <GRIN>

I haven't played with it, but I have downloaded Lingua::EN::NameParse
(mainly 'cause I told the author I would :-) Hi Kim!)

from the readme:
---------------------------------------------------------------------
Lingua::EN::NameParse - routines for manipulating a persons name

This module takes as input a person or persons name in 
free format text such as,

    Mr AB & M/s CD MacNay-Smith
    MR J.L. D'ANGELO
    Estate Of The Late Lieutenant Colonel AB Van Der Heiden

and attempts to parse it. If successful, the name is broken
down into components and useful functions can be performed like :

- converting upper or lower case values to name case (Mr AB MacNay   )
- creating a personalised greeting or salutation     (Dear Mr MacNay )
- extracting the names individual components         (Mr,AB,MacNay   )
- determining the type of format the name is in      (Mr_A_Smith     )

If the name cannot be parsed you have the option of cleaning the name
of bad characters, or extracting any portion that was parsed and the 
portion that failed.
---------------------------------------------------------------------

I'll bet it still doesn't get Concha's name right, but then I'll bet she's
used to having computers send her letters addressed to "Dear Mr Doña
Jiménez"

cheers

Iain


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

Date: Mon, 05 Jul 1999 09:51:06 GMT
From: marcel.grunauer@lovely.net (Marcel)
Subject: Re: name confusion
Message-Id: <37837faa.3406708@enews.newsguy.com>

On 2 Jul 1999 18:05:13 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>:I need to extract the lastname and the firstname from a full name.
>
>I'm sorry, Bing, but I can't do that.
>
>Consider the mellifluous name:
>
>    Doña María Jesús Concepción García Lorca de Jiménez
>
>Her honorific is Doña.
>Her surnames are García Lorca.
>Her fathers's (first) surname is García.
>Her mother's (first) surname is Lorca.
>Her Christian names are María Jesús.
>Her Communion name is Concepción.
>Her husband's (first) surname is Jiménez.
>And she probably goes by Concha. :-)
>

Along the lines of Lingua::EN::NameParse, if you can deduce all that
just by looking at her name, surely that algorithm/heuristic can be
put into code?


Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: 6 Jul 1999 00:14:19 GMT
From: jgd@alpha1.csd.uwm.edu (John G Dobnick)
Subject: Re: name confusion
Message-Id: <7lrhor$phe$1@uwm.edu>

From article <FEB8Dp.7I6@presby.edu>, by jtbell@presby.edu (Jon Bell):
>  Abigail <abigail@delanet.com> wrote:
>>bing-du@tamu.edu (bing-du@tamu.edu) wrote on MMCXXXI September MCMXCIII
>>in <URL:news:7ljd7r$o18$1@nnrp1.deja.com>:
>>[] 
>>[] I need to extract the lastname and the firstname from a full name.
>>
>>I don't have a lastname.
> 
> And there's a certain "Artist" (formerly known as...) who doesn't have a
> first name, either!  :-)

"Artistic" considerations aside....  a "real world" example:

We had a student at our university who, in fact, did have a legal name
with only one part.  That's what was on their passport, so it must be
"official".

        Q: So was that their first name or last name?
        A: Yes.

How do I know this?   In doing some account "cleanup", I questioned
this person about why there was only one name-part in their "finger"
record.  (Such "unusual" entries are common for manually entered data,
unfortunately.  Gotta clean up that data entry. :-))   This person took
_great_ offense at my even asking!  After suitable apologies on my
part, education and enlightenment ensued.

--
John G Dobnick                          "Knowing how things work is the basis
Information & Media Technologies         for appreciation, and is thus a
University of Wisconsin - Milwaukee      source of civilized delight."
jgd@csd.uwm.edu   ATTnet: (414) 229-5727                    -- William Safire



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

Date: Tue, 06 Jul 1999 12:38:42 GMT
From: Pierre-Michel Ansel <pierre-michel.ansel@steria.fr>
Subject: Need an advice : C vs Perl
Message-Id: <3781F90B.2F7BFB05@steria.fr>

Hello,

What would be the fastest between a C executable and a Perl
script that would both have to do :

- Strings manipulation (75%)
    --> search of keywords
    --> search of values under keywords in column organized buffers
    --> Deleting lines identified by keywords
    --> extraction of strings between keywords
- Data base access (5%)
- Creation, opening and formating of result files (15%)
- Launching other script or executable files (5%)

I'm good at C programming but I known almost nothing about Perl.
I just know that Perl is efficient and powerful to manipulate
strings. I am also attracted by the advantages of script
programming (evolutions are easier, no compilation is needed), but
performance is at least as important for me.

So, from your experience, what is the classical loss in term of
fastness between a compiled program and a perl program?
Would the difference be important in my particuliar case?

If you need more information, don't hesitate to ask.

Best regards.

Pierre-Michel Ansel

PS: If you know a good source of information on the news or on the web
 ...



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

Date: 6 Jul 1999 08:17:20 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Need an advice : C vs Perl
Message-Id: <7lsvl0$g3g$1@Starbase.NeoSoft.COM>

In article <3781F90B.2F7BFB05@steria.fr>,
Pierre-Michel Ansel  <pierre-michel.ansel@steria.fr> wrote:
>Hello,
>
>What would be the fastest between a C executable and a Perl
>script that would both have to do :
>
>- Strings manipulation (75%)
>    --> search of keywords
>    --> search of values under keywords in column organized buffers
>    --> Deleting lines identified by keywords
>    --> extraction of strings between keywords
>- Data base access (5%)
>- Creation, opening and formating of result files (15%)
>- Launching other script or executable files (5%)
>
>I'm good at C programming but I known almost nothing about Perl.
>I just know that Perl is efficient and powerful to manipulate
>strings. I am also attracted by the advantages of script
>programming (evolutions are easier, no compilation is needed), but
>performance is at least as important for me.
>
>So, from your experience, what is the classical loss in term of
>fastness between a compiled program and a perl program?
>Would the difference be important in my particuliar case?
			.
			.
			.
Use Perl.  For most people, Perl is likely to be
*faster* in this application, 'cause its regexps
and related parsing are superior to what they'll
do by hand in C.  I suspect you're good enough
with C that you won't gain any performance with
Perl, but you'll enjoy the other benefits you've
already aptly described.

I suspect your biggest issue with Perl will be
the size of the run-time executable.  All the
techical domains you outline, though (DB access,
gluing external processes, ...), you'll prefer
coding in Perl to what you have to do now in C.

It's hard to estimate speed comparisons without
more data.  If your Perl codings are as bad as
half as fast as the corresponding C, it probably
means there's some structural problem that's
amenable to expert advice.  You should expect
Perl to be, let's say, 60% as fast as C.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com      +1 281 996 8546 FAX


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

Date: 6 Jul 1999 08:22:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need an advice : C vs Perl
Message-Id: <slrn7o40n4.tch.abigail@alexandra.delanet.com>

Pierre-Michel Ansel (pierre-michel.ansel@steria.fr) wrote on MMCXXXV
September MCMXCIII in <URL:news:3781F90B.2F7BFB05@steria.fr>:
:: 
:: What would be the fastest between a C executable and a Perl
:: script that would both have to do :

That depends on how you write them, and on the data involved.
Write them both, and benchmark them.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 06 Jul 1999 14:40:08 GMT
From: Pierre-Michel Ansel <pierre-michel.ansel@steria.fr>
Subject: Re: Need an advice : C vs Perl
Message-Id: <37821581.1B11D627@steria.fr>


--------------3FE3F47CD91EE4B8F62A6F64
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


First, thanks to Cameron and you to have answerd so
quickly.
My Perl coding is close to the void but I am used to learning
languages.
Moreover, I think I'm not so bad in other script languages
like ksh, awk and sed (but that's not Perl I agree).

Here is an example of the column structured buffers I'll have
to treat:

-----------------------------------------------------------------------
       WO      ZC12  07 R3/C PE-08   AT-10       TIME 961119 1511  PAGE    1
        <SUSCP:SNB=37240000,LIST;
        ABONNE - DONNEES
        SNB         DEV             DETY    SUT         SCL      MIS             COS

        37240000    000-01-099              PB          OBA-51
                                                        OCG-8
                                                        CFUV-1


        SERVICE SECRET D'IDENTITE DU DEMANDEUR - DONNEES

        ACT
        NO

        SERVICES DE RENVOI

        RENVOI D'APPEL INCONDITIONNEL, NO VARIABLE              .

        TYPE
        CFUV

        ANNTOCU  BNUMTOC   SDTONE    BARPROG
        NO       YES       YES        0

        ACTIVE   CAC       DIN
        NO
        <

        FIN
-----------------------------------------------------------------------
SNB, DEV, DETY ... are column headers. The kind of work I
have to do on such a buffer could be the following :

1) Find the SUT keyword
2) Look under SUT to see if there is something (PB)
3) If I find something, execute a program
4) If I find nothing, search under SCL
5) For each entry under SCL do some stuff according to the context
6) Delete the line that contains WO and PAGE

Here is another type of buffer :

-----------------------------------------------------------------------
       WO      ZC12  07 R3/C PE-08   AT-10       TIME 961119 1511  PAGE    1
        <SUPXP:SNB=37240000,PXR=ALL;
        NUMERO PBX - DONNEES
        SNB        TYPE  PXR          DETY  PXRD       R1    SI
        37240000   GN    B-O          LI

        DEV              HNB          SNB1             PGN   SFX
        001-01-061                    3724A0000
        OO1-01-062                    3724A0001
        <

        FIN
-----------------------------------------------------------------------

Here, I have to extract the values under SNB1 and put them in
a result file in front of the value of SNB (2nd line).

In fact, I will have to face different kind of buffers, all having
their specificities. Such kind of buffer will have to be treated
by such Perl script, such other by another perl script and so on.
If I introduce a new type of buffer, the concept of script language
should allow me to make my system evolve easily.

Another information I can give you : the database accesses are
typically updates and / or insert (no delete).

At last, to answer Abigail, If I have not done the benchmark, it
is because I am completely new to Perl programming. So it
would take me a lot of time to produce a good benchmark.
Besides, as Cameron said, my knowledge of C and my ignorance
of Perl would have probably unbalanced the results (in favor of C
of course). I am confident in the experience of  the people that
read and write and that newsgroup and that's enough to me.

Thank you all.

Pierre-Michel Ansel

--------------3FE3F47CD91EE4B8F62A6F64
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br>First, thanks to Cameron and you to have answerd so
<br>quickly.
<br>My Perl coding is close to the void but I am used to learning
<br>languages.
<br>Moreover, I think I'm not so bad in other script languages
<br>like ksh, awk and sed (but that's not Perl I agree).
<p>Here is an example of the column structured buffers I'll have
<br>to treat:
<p>-----------------------------------------------------------------------
<br><tt>&nbsp;<font size=-2>&nbsp;</font><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;
WO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ZC12&nbsp; 07 R3/C PE-08&nbsp;&nbsp; AT-10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TIME 961119 1511&nbsp; PAGE&nbsp;&nbsp;&nbsp; 1</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SUSCP:SNB=37240000,LIST;</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ABONNE
- DONNEES</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SNB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DEV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DETY&nbsp;&nbsp;&nbsp; SUT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SCL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
COS</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 37240000&nbsp;&nbsp;&nbsp;
000-01-099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OBA-51</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OCG-8</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CFUV-1</font></tt>
<br><tt><font size=-1></font></tt>&nbsp;<tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SERVICE
SECRET D'IDENTITE DU DEMANDEUR - DONNEES</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACT</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NO</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SERVICES
DE RENVOI</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RENVOI
D'APPEL INCONDITIONNEL, NO VARIABLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 .</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CFUV</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANNTOCU&nbsp;
BNUMTOC&nbsp;&nbsp; SDTONE&nbsp;&nbsp;&nbsp; BARPROG</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
YES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; YES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACTIVE&nbsp;&nbsp;
CAC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DIN</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NO</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FIN</font></tt>
<br>-----------------------------------------------------------------------
<br>SNB, DEV, DETY ... are column headers. The kind of work I
<br>have to do on such a buffer could be the following :
<p>1) Find the SUT keyword
<br>2) Look under SUT to see if there is something (PB)
<br>3) If I find something, execute a program
<br>4) If I find nothing, search under SCL
<br>5) For each entry under SCL do some stuff according to the context
<br>6) Delete the line that contains WO and PAGE
<p>Here is another type of buffer :
<p>-----------------------------------------------------------------------
<br>&nbsp;<tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ZC12&nbsp; 07 R3/C PE-08&nbsp;&nbsp; AT-10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TIME 961119 1511&nbsp; PAGE&nbsp;&nbsp;&nbsp; 1</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SUPXP:SNB=37240000,PXR=ALL;</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMERO
PBX - DONNEES</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SNB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TYPE&nbsp; PXR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DETY&nbsp;
PXRD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; R1&nbsp;&nbsp;&nbsp; SI</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 37240000&nbsp;&nbsp;
GN&nbsp;&nbsp;&nbsp; B-O&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
LI</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HNB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SNB1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PGN&nbsp;&nbsp; SFX</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 001-01-061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3724A0000</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OO1-01-062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3724A0001</font></tt>
<br><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</font></tt><tt><font size=-1></font></tt>
<p><tt><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FIN</font></tt>
<br>-----------------------------------------------------------------------
<p>Here, I have to extract the values under SNB1 and put them in
<br>a result file in front of the value of SNB (2nd line).
<p>In fact, I will have to face different kind of buffers, all having
<br>their specificities. Such kind of buffer will have to be treated
<br>by such Perl script, such other by another perl script and so on.
<br>If I introduce a new type of buffer, the concept of script language
<br>should allow me to make my system evolve easily.
<p>Another information I can give you : the database accesses are
<br>typically updates and / or insert (no delete).
<p>At last, to answer Abigail, If I have not done the benchmark, it
<br>is because I am completely new to Perl programming. So it
<br>would take me a lot of time to produce a good benchmark.
<br>Besides, as Cameron said, my knowledge of C and my ignorance
<br>of Perl would have probably unbalanced the results (in favor of C
<br>of course). I am confident in the experience of&nbsp; the people that
<br>read and write and that newsgroup and that's enough to me.
<p>Thank you all.
<p>Pierre-Michel Ansel</html>

--------------3FE3F47CD91EE4B8F62A6F64--



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

Date: Tue, 06 Jul 1999 14:57:07 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: Need an advice : C vs Perl
Message-Id: <37821190.106625007@news.hydro.co.uk>

On Tue, 06 Jul 1999 12:38:42 GMT, Pierre-Michel Ansel
<pierre-michel.ansel@steria.fr> wrote:

>What would be the fastest between a C executable and a Perl
>script that would both have to do :
>
>- Strings manipulation (75%)
>    --> search of keywords
>    --> search of values under keywords in column organized buffers
>    --> Deleting lines identified by keywords
>    --> extraction of strings between keywords
>- Data base access (5%)
>- Creation, opening and formating of result files (15%)
>- Launching other script or executable files (5%)
>
>I'm good at C programming but I known almost nothing about Perl.
>I just know that Perl is efficient and powerful to manipulate
>strings. I am also attracted by the advantages of script
>programming (evolutions are easier, no compilation is needed), but
>performance is at least as important for me.
>
>So, from your experience, what is the classical loss in term of
>fastness between a compiled program and a perl program?
>Would the difference be important in my particuliar case?

I have no idea what the classical loss in performance is although as a
lot of what Perl does is just to call C libraries the performance hit
is unlikely to be significant unless the files you are processing are
HUGE. What is much more significant would be the development time you
would save using Perl.

This may sound like the reply should be posted to a .advocacy group
but in my own experience, since I gained what little Perl knowledge I
have, it has saved me weeks of work developing C code for manipulating
and reporting on text files (I work on the processing and reporting of
data flow files used in the deregulated electricity market in the UK -
big files, lots of customers). The work you describe above IS WHAT
PERL DOES. It was developed specifically for those purposes. All the
other stuff (like DB access through the DBI module) was added on
because it was handy.

Reckon on about a week to get to grips with the basics of the language
and get yourself a good book like ORA's "Learning Perl" [the llama
book] by Randal L. Schwartz and Tom Christiansen (with a foreward by
Larry Wall). I found it easier to learn good chunks of Perl with this
book than with "Programming Perl" [the camel book] by Wall,
Christiansen, Schwartz and Potter - which a better reference text IMO.
In that time you should be able to cover all the text manipulation and
data structures you need for your script.

>PS: If you know a good source of information on the news or on the web

http://www.perl.org/

Good luck

Gary
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: Sun, 04 Jul 1999 17:51:06 -0400
From: Tim Walker <tim@freakville.com>
Subject: Net::POP# problems...
Message-Id: <377FD74A.8C9E41C6@freakville.com>

I'm at my wits end with Net::POP3. I've tried everything I can think of
to make it work, but I keep getting errors when Net::POP3 does anything
with the $hosts variable. I'm running Active State build 5.18 and the
error I'm getting is:


Global symbol "%NetConfig" requires explicit package name at
c:\website\perl5\lib\Net\POP3.pm line 26.

Here is the code I am calling it with:

sub get_mail {

 $pop = Net::POP3->new($mailserver)
  or die "Can't open connection to $mailserver : $!\n";
 $pop->login($username, $password)
  or die "Can't authenticate: $!\n";
 $messages = $pop->list
  or die "Can't get list of undeleted messages: $!\n";

 foreach $msgid (keys %messages) {
   $message = $pop->get($msgid);
   unless (defined $message) {
    warn "Couldn't fetch $msgid from server: $!\n";
    next;
   }
  # $pop->delete($msgid);
 }
}

Any ideas?
Tim Walker



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

Date: Mon, 05 Jul 1999 22:48:21 GMT
From: Mikey <mpelle@epix.net>
Subject: Net::Telnet in AS/400 environment
Message-Id: <378160A7.6D597E56@epix.net>

I'm currently attempting to use the Net::Telnet module to establish
AS/400 <--> UNIX communication. I am running the Perl script within the
AS/400 environment. However, I cannot seem to get any kind of correct
pattern matching (i.e. Waitfor 'login:') with respect to the data coming
back from the UNIX box. The same script works like a champ when the
communication is strictly UNIX - to - UNIX. Am I correct in assuming
that perhaps some kind of intermediary translation is required at this
point (i.e. ASCII to EBCDIC)?

	Any comments would be welcome.

	Thanks in advance,


	Mike


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

Date: Tue, 06 Jul 1999 01:31:55 GMT
From: pkolis@lvwebmasters.com
Subject: Re: Net::Telnet in AS/400 environment
Message-Id: <7lrmac$uf$1@nnrp1.deja.com>

Mike,

I haven't done what you're attempting, but I've
worked many years on the AS/400 and usually QSYSOPR or
the history log give you enough information to
point you in the right direction.

BTW, where did you get the Perl port for the AS/400?

Pat

In article <378160A7.6D597E56@epix.net>,
  Mikey <mpelle@epix.net> wrote:
> I'm currently attempting to use the Net::Telnet module to establish
> AS/400 <--> UNIX communication. I am running the Perl script within
the
> AS/400 environment. However, I cannot seem to get any kind of correct
> pattern matching (i.e. Waitfor 'login:') with respect to the data
coming
> back from the UNIX box. The same script works like a champ when the
> communication is strictly UNIX - to - UNIX. Am I correct in assuming
> that perhaps some kind of intermediary translation is required at this
> point (i.e. ASCII to EBCDIC)?
>
> 	Any comments would be welcome.
>
> 	Thanks in advance,
>
> 	Mike
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

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

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 V9 Issue 37
************************************


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