[18992] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1187 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 25 11:07:42 2001

Date: Mon, 25 Jun 2001 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <993481510-v10-i1187@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 25 Jun 2001     Volume: 10 Number: 1187

Today's topics:
    Re: .htaccess help required <postmaster@127.0.0.1>
        converting from a @ array or list to sclar variable <patelnavin@icenet.net>
    Re: converting from a @ array or list to sclar variable <pne-news-20010625@newton.digitalspace.net>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
    Re: fastest way to count lines in a bunch of files. <bill.kemp@wire2.com>
    Re: fastest way to count lines in a bunch of files. (Mark Jason Dominus)
        How can I get rid  of lines with garbage in a large fil <rig01@yahoo.com>
    Re: How can I get rid  of lines with garbage in a large <josef.moellers@fujitsu-siemens.com>
    Re: I have a large file, with garbage inside ; How can  <mike@gatrell.org>
    Re: Merging two scripts <gamtci@mpinet.net>
    Re: mod perl , cgi weirdness <der.prinz@gmx.net>
    Re: mod perl , cgi weirdness <gnarinn@hotmail.com>
    Re: mod perl , cgi weirdness mbower@ibuk.bankgesellschaft.de
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
        Newbie - Compare text files <plarkinNOSPAM@indeliblelink.com>
        perl compilation on HPUX-11 <sgrover@delsoft.com>
    Re: perl compilation on HPUX-11 (Jim Garner)
        Perl script from cron being mysteriously killed.  Any i (Frank)
    Re: Perl script from cron being mysteriously killed.  A <buggs-clpm@splashground.de>
    Re: Perl variable <peb@bms.umist.ac.uk>
    Re: Perl variable (Anno Siegel)
    Re: Perl variable <peb@bms.umist.ac.uk>
    Re: Perl variable <nobody@nowhere.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 25 Jun 2001 14:03:46 +0100
From: Anthony Peacock <postmaster@127.0.0.1>
Subject: Re: .htaccess help required
Message-Id: <3B3736B2.4963645D@127.0.0.1>

Umair Tariq Bajwa wrote:
> 
> I am designing and developing database. To access database the user
> enters his login and password that are in usersfile created through
> htpasswd command. Is there a way to connect to mysql database and check
> for a valid user and password instead of going through that file?
> Actually so many people are going to use that database and I think using
> 
> password file is not a good idea.
> Does anyone know how to do that? Any help will be greatly appreciated.


I don't actually think this is Perl related, but have a look for
mod_auth_mysql.

This is an Apache module that allows you to authnticate via a mysql
database.


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

Date: Mon, 25 Jun 2001 14:21:01 +0530
From: "Aman Patel" <patelnavin@icenet.net>
Subject: converting from a @ array or list to sclar variable
Message-Id: <9h7ek9$cdebj$1@ID-93885.news.dfncis.de>

Whats the best way of converting from a @array or @list to a sclar var.

Is this fast enough: ( i mean, in my application @array tends to be long in
lines and big in memory too).
$scalar_var =  join ( '', @array );

And one more question: does this:
$scalar_var = "@array";
does this internally:
$scalar_var = join ( ' ', @array ); #is this 'internally same as
                # doing $scalar_var = "@array"

let me know...




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

Date: Mon, 25 Jun 2001 16:54:25 +0200
From: Philip Newton <pne-news-20010625@newton.digitalspace.net>
Subject: Re: converting from a @ array or list to sclar variable
Message-Id: <vsjejt4sb6k2ni7q9kbmbckqfleu6mfqeq@4ax.com>

On Mon, 25 Jun 2001 14:21:01 +0530, "Aman Patel" <patelnavin@icenet.net>
wrote:

> And one more question: does this:
> $scalar_var = "@array";
> does this internally:
> $scalar_var = join ( ' ', @array ); #is this 'internally same as
>                 # doing $scalar_var = "@array"

Nearly; it's nearly the same as 'join $", @array', since $" might not
always be a space.

Observe:

: $ perl -MO=Terse -e '@a=(); $a = join $", @a; $a = "@a";'
: LISTOP (0x815bf60) leave
:     OP (0x81d0c90) enter
:     COP (0x815c120) nextstate
:     BINOP (0x815c0f8) aassign [2]
:         UNOP (0x815ce08) null [141]
:             OP (0x815ce30) pushmark
:             OP (0x81d0bd8) stub
:         UNOP (0x81d0bf8) null [141]
:             OP (0x81d0c20) pushmark
:             UNOP (0x81d0bb8) rv2av [1]
:                 SVOP (0x81c9508) gv  GV (0x815ca30) *a
:     COP (0x81c21b0) nextstate

OK, you can ignore the first bit; it's just the assignment to @a. Now
comes the first assignment (with explicit join):

:     BINOP (0x81c2188) sassign
:         LISTOP (0x81c2108) join [4]
:             OP (0x81c2130) pushmark
:             UNOP (0x81c20a8) null [15]
:                 SVOP (0x81c2088) gvsv  GV (0x8158c3c) *"
:             UNOP (0x81c20e8) rv2av [3]
:                 SVOP (0x81c20c8) gv  GV (0x815ca30) *a
:         UNOP (0x815bfa8) null [15]
:             SVOP (0x815bf88) gvsv  GV (0x815ca30) *a

Scalar assignment with a join involving *" (the glob corresponding to
$") and *a (the glob corresponding to @a).

:     COP (0x81d0e58) nextstate

And now the assignment with "@a":

:     BINOP (0x81d0e30) sassign
:         LISTOP (0x81d0de8) stringify [7]
:             OP (0x81d0e10) null [3]
:             LISTOP (0x81d0da0) join [6]
:                 OP (0x81d0dc8) pushmark
:                 UNOP (0x81d0d40) null [15]
:                     SVOP (0x81d0d20) gvsv  GV (0x8158c3c) *"
:                 UNOP (0x81d0d80) rv2av [5]
:                     SVOP (0x81d0d60) gv  GV (0x815ca30) *a
:         UNOP (0x81d0c70) null [15]
:             SVOP (0x81d0c50) gvsv  GV (0x815ca30) *a

Again, a scalar assignment with a join involving *" and *a. The only
difference appears to be the extra 'stringify' op in this case, but
internally, the same thing appears to happen. So whether you write join
$", @a or "@a" is pretty much up to you, as far as I can see.

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: 25 Jun 2001 11:17:20 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_993467647@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Windows
            http://www.gnu.org/software/emacs/windows/ntemacs.html
	    ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

	o   More Emacs resources at 
	    http://tiny-tools.sourceforge.net/emacs-elisp.html


Emacs Perl Modules

    Cperl -- Perl programming mode

        .ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
        .<olson@mcs.anl.gov>           Bob Olson (started 1991)
        .<ilya@math.ohio-state.edu>    Ilya Zakharevich

        Major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

	.http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Grep through all Perl manpages (.pod)
        o   Follow POD manpage references to next pod page with TinyUrl
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.
        o   TinyUrl is used to jump to URLs (other pod pages, man pages etc)
            mentioned in POD pages. (It's a general URL minor mode)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in the Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up datatbases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to run the find for you, You can adjust
        recursive grep options, ignored case, add user grep options.

        You can get `igrep.el' module from <kevinr@ihs.com>. Ask for copy.
	Check also ftp://ftp.ihs.com/pub/kevinr/

    TinyCompile -- Browsing grep results in Emacs *compile* buffer

        TinyCompile is minor mode for *compile* buffer from where
        you can collapse unwanted lines, shorten the file URLs

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->
            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



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

Date: Mon, 25 Jun 2001 14:47:55 +0100
From: "W K" <bill.kemp@wire2.com>
Subject: Re: fastest way to count lines in a bunch of files.
Message-Id: <993476971.16972.0.nnrp-12.c3ad6974@news.demon.co.uk>

>> I know how to count lines conventionally, i would write a method somewhat
>> like:
>
>"...somewhat like...."? Programming is an exacting art affording
>no leeway for somewhat like nor something like. You either write
>your code correctly or incorrectly.


tmtowtdi




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

Date: Mon, 25 Jun 2001 14:30:45 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: fastest way to count lines in a bunch of files.
Message-Id: <3b374af8.6a1d$20c@news.op.net>

In article <9h5esl$c4pr1$1@ID-93885.news.dfncis.de>,
Aman Patel <patelnavin@icenet.net> wrote:
>I need to be able to count lines in a bunch of files (all in 1 directory),
>with fastest performace. Since this is going to a CGI script speed is of
>utmost important.

The fastest way in Perl will probably be

        for (@files) {
          local $/;
          open F, $_ or next;
          my $data = <F>;
          $lines += $data =~ tr/\n//;
        }

But I doubt that it will be much faster than the obvious method, even
speed is of 'utmost importance'.

You said speed is of 'utmost importannce' because it is in a CGI
program, but in my experience the opposite is more likely to be true.

Whenever the web user runs a CGI program, their web browser must set
up a TCP connection to your web site, send an HTTP request, then wait
while your web server processes the request, forks a new process for
the CGI program, sends back the result, and then the user must wait
while the page is rendered.  This all takes time.  While the user is
waiting for all this, they will not notice a small difference in the
run time of the CGI program in the middle.   There is likely to be 0.5
to 1.0 seconds of overhead in fetching a web page, and the user will
not be able to notice a small improvement in CGI execution speed
because the whole process takes so long anyway.

I think you are probably wasting your time.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Mon, 25 Jun 2001 08:04:43 -0700
From: None <rig01@yahoo.com>
Subject: How can I get rid  of lines with garbage in a large file . HELP!!!
Message-Id: <tmkejtcfqpgl0j4fg6tnd3htkah5ve393h@4ax.com>

Hi :


I have a large file, with garbage inside (some lines have garbage),
How can I get rid  of these lines with garbage.

Please help !!! how to do this in Perl?

Thanks in Adavace

Peter


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

Date: Mon, 25 Jun 2001 14:58:47 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How can I get rid  of lines with garbage in a large file . HELP!!!
Message-Id: <3B373587.46CD0DC2@fujitsu-siemens.com>

None wrote:
> =

> Hi :
> =

> I have a large file, with garbage inside (some lines have garbage),
> How can I get rid  of these lines with garbage.
> =

> Please help !!! how to do this in Perl?

Why do you post the same question again under a different subject?
Don't you like the answers you already have?

BTW: What is "garbage"? Just as "noise" ist just everyting but the
signal you want to transmit, one can argue that Shakespeare's collected
works is "garbage" if you expect a cheap SF novel.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett


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

Date: Mon, 25 Jun 2001 12:03:54 +0100
From: "M" <mike@gatrell.org>
Subject: Re: I have a large file, with garbage inside ; How can I get rid  of these lines
Message-Id: <9h75qs$gd5$1@taliesin.netcom.net.uk>

On Mon, 25 Jun 2001 08:00:45 +0100, "None" <rig01@yahoo.com> wrote:

> Hi :
> 
> 
> I have a large file, with garbage inside (some lines have garbage),
> How can I get rid  of these lines with garbage. Please help !!! how to
> do this in Perl?


s/^.+garbage.+$//

should do it.

hth
M
-- 
Sic Itur Ad Astra


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

Date: Mon, 25 Jun 2001 14:52:20 GMT
From: Gary <gamtci@mpinet.net>
Subject: Re: Merging two scripts
Message-Id: <3B375081.54CD@mpinet.net>

One silly but perhaps effective way would be to have the first 
script call the other using the command line (or a temp file)
to pass the database info to the second script.  Then using 
system(perl.exe -w secondscript.pl) call the second script.
When it returns, check its return value (for errors or other
info you might return as an integer) and continue.


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

Date: Mon, 25 Jun 2001 12:22:31 +0200
From: "Stefan Weiss" <der.prinz@gmx.net>
Subject: Re: mod perl , cgi weirdness
Message-Id: <3b371092$1@e-post.inode.at>

<mbower@ibuk.bankgesellschaft.de> wrote:

> I call the script below with one of 2 links...  it uses mod-perl and
> Apache DBI.  I use a self written module to perform functions such as
> database_open, database_close,  get_rows etc
>
> Every now and then the value $tempvar gets an erroneous value from a
> previously run script
>
> If I alter the script so that I pass the value of $cgi_prog it seems
> to correct the problem..but why ????   I use "my" with $cgi_prog so
> shouldn't that keep the variable within the scope of this script ?

(code snipped)

If the script runs fine under CGI but causes problems under mod_perl,
chances are you fell into one of the classical mod_perl traps; in
your case most likely "my() Scoped Variable in Nested Subroutines".

http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S

cheers,
stefan





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

Date: Mon, 25 Jun 2001 10:16:14 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: mod perl , cgi weirdness
Message-Id: <993464174.802112763281912.gnarinn@hotmail.com>

In article <3b36fa4c.435492734@news>,  <mbower@ibuk.bankgesellschaft.de> wrote:
>I call the script below with one of 2 links...  it uses mod-perl and
>Apache DBI.  I use a self written module to perform functions such as
>database_open, database_close,  get_rows etc
>
>Every now and then the value $tempvar gets an erroneous value from a
>previously run script
>
>If I alter the script so that I pass the value of $cgi_prog it seems
>to correct the problem..but why ????   I use "my" with $cgi_prog so
>shouldn't that keep the variable within the scope of this script ?
>
>
>print "Content-type:text/html\n\n";
>print "<HTML>\n";
>print "<BODY>\n";
>use CGI qw(:standard);
>use lib "/usr/local/apache/htdocs/cgi-perl";
>use mb_module;
>
>my $strSQL;
>my $collection='';
>$collection=param('type');
>my $cgi_prog="/cgi-perl/passwd_admin.pl?type=$collection&";
>
>&PrintEntryForm;
>
>end of code............
>
>sub PrintEntryForm {
>
>    my $tempvar = "This is some text ".$cgi_prog." end of line";
>
>}

You must be careful when using mod_perl, as there are limitations
and gotchas you need to be aware of. You should familiarize yourself
with all documetation at http://perl.apache.org/#docs,
specially the mod_perl_traps section
(http://perl.apache.org/dist/mod_perl_traps.html)
and http://perl.apache.org/guide/frequent.html

your particular problem is described in
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S

Use the docs, Luke!
gnari



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

Date: Mon, 25 Jun 2001 13:00:57 GMT
From: mbower@ibuk.bankgesellschaft.de
Subject: Re: mod perl , cgi weirdness
Message-Id: <3b3735ec.450756671@news>

Thanks all....

On Mon, 25 Jun 2001 12:22:31 +0200, "Stefan Weiss" <der.prinz@gmx.net>
wrote:

><mbower@ibuk.bankgesellschaft.de> wrote:
>
>> I call the script below with one of 2 links...  it uses mod-perl and
>> Apache DBI.  I use a self written module to perform functions such as
>> database_open, database_close,  get_rows etc
>>
>> Every now and then the value $tempvar gets an erroneous value from a
>> previously run script
>>
>> If I alter the script so that I pass the value of $cgi_prog it seems
>> to correct the problem..but why ????   I use "my" with $cgi_prog so
>> shouldn't that keep the variable within the scope of this script ?
>
>(code snipped)
>
>If the script runs fine under CGI but causes problems under mod_perl,
>chances are you fell into one of the classical mod_perl traps; in
>your case most likely "my() Scoped Variable in Nested Subroutines".
>
>http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
>
>cheers,
>stefan
>
>
>



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

Date: Mon, 25 Jun 2001 14:41:31 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tjejcr71mdtv80@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 18 Jun 2001 15:43:49 GMT and ending at
25 Jun 2001 16:04:43 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:  118 (36.8% of all posters)
Articles: 181 (21.8% of all articles)
Volume generated: 286.4 kb (19.7% of total volume)
    - headers:    141.7 kb (2,907 lines)
    - bodies:     143.9 kb (4,900 lines)
    - original:   101.5 kb (3,570 lines)
    - signatures: 0.7 kb (18 lines)

Original Content Rating: 0.705

Averages
========

Posts per poster: 1.5
    median: 1.0 post
    mode:   1 post - 84 posters
    s:      1.9 posts
Message size: 1620.5 bytes
    - header:     801.5 bytes (16.1 lines)
    - body:       814.1 bytes (27.1 lines)
    - original:   574.0 bytes (19.7 lines)
    - signature:  3.9 bytes (0.1 lines)

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

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

    7    18.4 (  6.2/ 12.2/  7.3)  "Amittai Aviram" <amittai@amittai.com>
    6     9.8 (  4.4/  5.4/  3.8)  Zur Aougav <aougav@hotmail.com>
    5     7.4 (  4.0/  3.5/  0.9)  mark_chou@hotmail.com
    5     7.4 (  4.2/  3.2/  1.4)  Tobias Gabrielsson <toga@celsiustech.se>
    5     5.7 (  3.3/  2.3/  1.9)  Eli <ELI@PELEPHONE.CO.IL>
    4     4.8 (  2.5/  2.2/  1.8)  Bard Selbekk <bard.selbekk@edbteamco.NO_SPAMcom>
    3     7.5 (  2.2/  5.2/  4.9)  Umair Tariq Bajwa <ub98aa@brocku.ca>
    3     5.0 (  2.8/  2.2/  1.4)  Paul Dempsey <dempsey@dickinson.edu>
    3     3.5 (  1.5/  2.0/  1.8)  CPERL520335 <cperl520335@aol.com>
    3     3.5 (  1.9/  1.7/  0.9)  Cristian Cespedes V <ccespede@anakena.dcc.uchile.cl>

These posters accounted for 5.3% of all articles.

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

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

  18.4 (  6.2/ 12.2/  7.3)      7  "Amittai Aviram" <amittai@amittai.com>
   9.8 (  4.4/  5.4/  3.8)      6  Zur Aougav <aougav@hotmail.com>
   7.5 (  2.2/  5.2/  4.9)      3  Umair Tariq Bajwa <ub98aa@brocku.ca>
   7.4 (  4.0/  3.5/  0.9)      5  mark_chou@hotmail.com
   7.4 (  4.2/  3.2/  1.4)      5  Tobias Gabrielsson <toga@celsiustech.se>
   6.4 (  2.7/  3.6/  1.6)      3  "Ryan Covert" <ryan@don't.think.about.it.com>
   5.9 (  1.7/  4.2/  2.6)      2  Mark Gaither <markg454@hotmail.com>
   5.7 (  3.3/  2.3/  1.9)      5  Eli <ELI@PELEPHONE.CO.IL>
   5.4 (  1.8/  3.6/  2.9)      2  "Sean Casey" <abuse@SCasey.com>
   5.2 (  3.0/  2.1/  0.7)      3  "zoodoo" <zoodoo@infantry.com>

These posters accounted for 5.4% of the total volume.

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

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

1.000  (  0.6 /  0.6)      3  rig01@yahoo.com
1.000  (  2.1 /  2.1)      3  Dale Gerdemann <dg@sfs.nphil.uni-tuebingen.de>
0.926  (  4.9 /  5.2)      3  Umair Tariq Bajwa <ub98aa@brocku.ca>
0.902  (  1.8 /  2.0)      3  CPERL520335 <cperl520335@aol.com>
0.805  (  1.8 /  2.2)      4  Bard Selbekk <bard.selbekk@edbteamco.NO_SPAMcom>
0.800  (  1.9 /  2.3)      5  Eli <ELI@PELEPHONE.CO.IL>
0.696  (  3.8 /  5.4)      6  Zur Aougav <aougav@hotmail.com>
0.653  (  1.4 /  2.2)      3  Paul Dempsey <dempsey@dickinson.edu>
0.616  (  1.9 /  3.1)      3  None <pohanl@aol.com>
0.599  (  7.3 / 12.2)      7  "Amittai Aviram" <amittai@amittai.com>

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

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

0.800  (  1.9 /  2.3)      5  Eli <ELI@PELEPHONE.CO.IL>
0.696  (  3.8 /  5.4)      6  Zur Aougav <aougav@hotmail.com>
0.653  (  1.4 /  2.2)      3  Paul Dempsey <dempsey@dickinson.edu>
0.616  (  1.9 /  3.1)      3  None <pohanl@aol.com>
0.599  (  7.3 / 12.2)      7  "Amittai Aviram" <amittai@amittai.com>
0.557  (  0.9 /  1.7)      3  Cristian Cespedes V <ccespede@anakena.dcc.uchile.cl>
0.452  (  1.4 /  3.2)      5  Tobias Gabrielsson <toga@celsiustech.se>
0.444  (  1.6 /  3.6)      3  "Ryan Covert" <ryan@don't.think.about.it.com>
0.333  (  0.7 /  2.1)      3  "zoodoo" <zoodoo@infantry.com>
0.259  (  0.9 /  3.5)      5  mark_chou@hotmail.com

15 posters (12%) had at least three posts.

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

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

      36  comp.lang.perl.modules
      13  alt.perl
       9  comp.lang.perl
       7  comp.lang.perl.moderated
       7  alt.perl.sockets
       6  comp.unix.questions
       6  comp.mail.sendmail
       5  comp.unix.shell
       5  comp.lang.perl.tk
       1  comp.answers

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

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

       4  Zur Aougav <aougav@hotmail.com>
       4  vorxion@fairlite.com
       4  Demitri Borg <demitri-borg@home.com>
       4  "scotth" <scott@generator.co.za>
       2  "Steven Stalzer" <steve@newmediacreations.com>
       2  Mahesh Asolkar <maheshak@synopsys.com>
       2  "Daniel Czajko" <czajko@ocas.on.ca>
       2  "isaacs" <isaac.sparrow@visicomp.com>
       2  Alexis Huxley <ahuxley@eso.org>
       2  RJF <rfrinder@fginfotech.com>


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

Date: Mon, 25 Jun 2001 14:50:09 GMT
From: "plarkinNOSPAM@indeliblelink.com" <plarkinNOSPAM@indeliblelink.com>
Subject: Newbie - Compare text files
Message-Id: <B75CC7D7.837B%plarkinNOSPAM@indeliblelink.com>


Hi --

I have a task that I hope to write a perl script for...

I'm very green when it comes to perl.

I have a comma delimited file or approx 14,000 lines.  Each line has about
35 fields.  I import it into a MySQL database.  I get sent an updated file
each day.  

What I'd like to do:

When I get a new updated file, I'd like to compare it to yesterdays file.
If a new record was added in the new file, write that line to a "NewRecords"
file.  If the new file is missing a line from the old file, write that line
to an "RemovedRecords" file.  Finally, any record that has changed in any
way, write that to a "ChangedRecord" file.

This way, instead of dealing with these large text files, I have smaller
files to deal with.

Where should I start?  I have had experience with taking the file, slurping
in a line and rewriting it with just the fields I need.  I have never
compared two files and created new files.  I assume I'd have to have PERL
sort the records first.  Each line has a unique ID number (the records are
people).

Thanks...

-- 
Patrick



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

Date: Mon, 25 Jun 2001 18:08:09 +0530
From: Sandeep Grover <sgrover@delsoft.com>
Subject: perl compilation on HPUX-11
Message-Id: <3B3730B1.2B64B5FA@delsoft.com>

I need to install Perl on HPUX-11, 64-bit operating system as we have to
build our software
on the HPUX-11, that software uses Perl internally. Is the Perl's latest
version
64-bit compliant? Can I get the config.sh to compile the Perl on HPUX-11
in 64-bit mode?
Another problem is I don't have ANSI C compiler on this machine. Is it
possible
to compile Perl successfully using HP's native compiler aCC(C++
Compiler) in 64-bit mode?

I tried to compile Perl Version 5.5003 on HPUX-10 using g++ compiler but
it could not
compile ext/ODBM_File/ODBM_File.xs. It says that the implicit
declaration
functions of dbminit() and store(). Is there any solution for this
problem?

regards,



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

Date: 25 Jun 2001 14:41:32 GMT
From: garnerjr@ci.richmond.va.us (Jim Garner)
Subject: Re: perl compilation on HPUX-11
Message-Id: <9h7iis$kgf$1@bob.news.rcn.net>

In article <3B3730B1.2B64B5FA@delsoft.com>, sgrover@delsoft.com says...
>I need to install Perl on HPUX-11, 64-bit operating system as we have to
>build our software
>on the HPUX-11, that software uses Perl internally. Is the Perl's latest
>version
>64-bit compliant? Can I get the config.sh to compile the Perl on HPUX-11
>in 64-bit mode?

Yes, it will compile on a 64-bit system.  Large files (>2GB) are supported.  
Support for 64-bit integer values is optional and not recommended (you probably 
don't need it).  BTW, the HP Porting Archive has perl source code for which the 
configuration has been tuned for HP systems.  
http://hpux.ee.ualberta.ca/hppd/hpux/Languages/perl-5.6.1/ 

>Another problem is I don't have ANSI C compiler on this machine. Is it
>possible
>to compile Perl successfully using HP's native compiler aCC(C++
>Compiler) in 64-bit mode?

I believe the term "native compiler" is used to refer to "cc", the compiler 
that comes free with HP-UX.  You probably won't be able to compile perl with 
cc.  I've never used aCC but my guess would be that it should work, try it.  I 
don't know if the Configure script knows to look for aCC on HP, you might have 
to specify it.

If you succeed in compiling on HP-UX 11.0, let me know your experience with the 
following: I've had a problem with the perl-5.6.1 getpwent() function when 
compiled under HP-UX 11.0 -- it dumps core if I call it at eof.  The pwent() 
test that comes with perl calls the function a fixed number of times (25), so 
if your /etc/passwd is 25 or more entries, the test appears to pass.  I can 
write a C program to call getpwent() past eof and it returns properly, so the 
problem is not with the HP library call.  I'd like confirmation of this problem 
before reporting it as a bug.

-Jim Garner
garnerjr@ci.richmond.va.us



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

Date: 25 Jun 2001 06:32:44 -0700
From: thoennes@pingsite.com (Frank)
Subject: Perl script from cron being mysteriously killed.  Any ideas?
Message-Id: <e0e60454.0106250532.58c46278@posting.google.com>

Hi all,

We have a cron that executes a shell script that executes a perl
script every hour.  There are times when the perl script may take over
an hour to complete processing (it does lots of DB queries and also
sends out emails via sendmail).  We've noticed that if the script
can't complete by the time the cron fires for the next hourly run, the
script is "killed" and the new instance started. (This is verified
through a log file).

When we simulate all this through an interactive login in a
development server, everything seems to work fine.  In production
however, no dice.  Both devel and prod are running Linux RedHat 6.2 (I
believe).

Any ideas?  I would have thought the cron would just start a new
instance of the script.  BY the way - the shell script does nothing
more than a CD to the perl script directory and then launches said
script.

Thanks in advance for any help!

-Frank


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

Date: Mon, 25 Jun 2001 16:44:04 +0200
From: Buggs <buggs-clpm@splashground.de>
Subject: Re: Perl script from cron being mysteriously killed.  Any ideas?
Message-Id: <9h7ihh$54v$01$1@news.t-online.com>

Frank wrote:

> Hi all,
> 
> We have a cron that executes a shell script that executes a perl
> script every hour.  There are times when the perl script may take over
> an hour to complete processing (it does lots of DB queries and also
> sends out emails via sendmail).  We've noticed that if the script
> can't complete by the time the cron fires for the next hourly run, the
> script is "killed" and the new instance started. (This is verified
> through a log file).
> 
> When we simulate all this through an interactive login in a
> development server, everything seems to work fine.  In production
> however, no dice.  Both devel and prod are running Linux RedHat 6.2 (I
> believe).
> 
> Any ideas?  I would have thought the cron would just start a new
> instance of the script.  BY the way - the shell script does nothing
> more than a CD to the perl script directory and then launches said
> script.
> 
> Thanks in advance for any help!

No question about Perl.

man cron

Consider Proc::Daemon.

Buggs


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

Date: Mon, 25 Jun 2001 11:08:41 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Perl variable
Message-Id: <3B370DA9.7297F709@bms.umist.ac.uk>

Thierry wrote:
> 
> Hi,
> 
> I want to get the output of of a call to  system()
> 
> with shell:
> $ nb=`ps -ef|grep toto| wc -l`
> $ echo $nb
> 3
> 
> with perl ???
> something like nb=system(ps -ef|grep toto|wc -l)
> the syntax is approximative, I am not a specialist

I don't think you want the output of a call to system.

I think you want the output of the shell commands.  If so, you should
use backticks instead (just like in the shell script).

HTH

Paul


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

Date: 25 Jun 2001 10:05:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl variable
Message-Id: <9h72cr$9cm$2@mamenchi.zrz.TU-Berlin.DE>

According to Thierry <nobody@nowhere.com>:
> Hi,
> 
> I want to get the output of of a call to  system()
> 
> with shell:
> $ nb=`ps -ef|grep toto| wc -l`
> $ echo $nb
> 3
> 
> with perl ???
> something like nb=system(ps -ef|grep toto|wc -l)
> the syntax is approximative, I am not a specialist

If you are in doubt how to use a Perl function, read its documentation.
In this case, perldoc -f system will point you to a related function
that does what you want.

Anno


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

Date: Mon, 25 Jun 2001 11:10:07 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Perl variable
Message-Id: <3B370DFF.3478F4B5@bms.umist.ac.uk>

Paul Boardman wrote:
> 
> Thierry wrote:
> >
> > Hi,
> >
> > I want to get the output of of a call to  system()
> >
> > with shell:
> > $ nb=`ps -ef|grep toto| wc -l`
> > $ echo $nb
> > 3
> >
> > with perl ???
> > something like nb=system(ps -ef|grep toto|wc -l)
> > the syntax is approximative, I am not a specialist
> 
> I don't think you want the output of a call to system.
> 
> I think you want the output of the shell commands.  If so, you should
> use backticks instead (just like in the shell script).

p.s.  this is a FAQ.

       Why can't I get the output of a command with system()?
 
       You're confusing the purpose of system() and backticks
       (``).  system() runs a command and returns exit status
       information (as a 16 bit value: the low 7 bits are the
       signal the process died from, if any, and the high 8 bits
       are the actual exit value).  Backticks (``) run a command
       and return what it sent to STDOUT.
 
           $exit_status   = system("mail-users");
           $output_string = `ls`;


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

Date: Mon, 25 Jun 2001 13:25:21 +0200
From: "Thierry" <nobody@nowhere.com>
Subject: Re: Perl variable
Message-Id: <9h775p$iv2$1@s1.read.news.oleane.net>

Thanks for your answer ...

"Paul Boardman" <peb@bms.umist.ac.uk> a écrit dans le message news:
3B370DFF.3478F4B5@bms.umist.ac.uk...
> Paul Boardman wrote:
> >
> > Thierry wrote:
> > >
> > > Hi,
> > >
> > > I want to get the output of of a call to  system()
> > >
> > > with shell:
> > > $ nb=`ps -ef|grep toto| wc -l`
> > > $ echo $nb
> > > 3
> > >
> > > with perl ???
> > > something like nb=system(ps -ef|grep toto|wc -l)
> > > the syntax is approximative, I am not a specialist
> >
> > I don't think you want the output of a call to system.
> >
> > I think you want the output of the shell commands.  If so, you should
> > use backticks instead (just like in the shell script).
>
> p.s.  this is a FAQ.
>
>        Why can't I get the output of a command with system()?
>
>        You're confusing the purpose of system() and backticks
>        (``).  system() runs a command and returns exit status
>        information (as a 16 bit value: the low 7 bits are the
>        signal the process died from, if any, and the high 8 bits
>        are the actual exit value).  Backticks (``) run a command
>        and return what it sent to STDOUT.
>
>            $exit_status   = system("mail-users");
>            $output_string = `ls`;




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 1187
***************************************


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