[22289] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4510 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 4 09:07:21 2003

Date: Tue, 4 Feb 2003 06:06:03 -0800 (PST)
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, 4 Feb 2003     Volume: 10 Number: 4510

Today's topics:
        Getting username in authenticated CGI site <je@brighton.ac.uk>
    Re: Parse a logfile - 1st column DateStamp; extract lat (Tim Cargile)
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@augustmail.com
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: strange localtime return (Tad McClellan)
    Re: strange localtime return <flavell@mail.cern.ch>
    Re: Until loop not working with multiple conditions (Tad McClellan)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 04 Feb 2003 13:01:59 +0000
From: John English <je@brighton.ac.uk>
Subject: Getting username in authenticated CGI site
Message-Id: <3E3FB9C7.54F56946@brighton.ac.uk>

I've got an Apache server on Linux using LDAP authentication, and I
want my CGI scripts to be able to get at the username supplied when
authenticating access to the site. I can't find anything relevant in
the environment, and "print `whoami`" says "apache" as the effective
user id...

Can anyone tell me how to get at the username please?

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------


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

Date: 4 Feb 2003 05:30:43 -0800
From: tecargile@hotmail.com (Tim Cargile)
Subject: Re: Parse a logfile - 1st column DateStamp; extract latest mods toan  ItemNumber
Message-Id: <8b67aef5.0302040530.52a20df9@posting.google.com>

Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3E3EF593.C8AA9A8@earthlink.net>...
> Mina Naguib wrote:
> [snip]
> > | TimeStamp in YYYYMMDDHHMMSS
> > | format|ItemNumber|Attribute1|Attribute2|Attribute3
> > |
> > | Sample Input File
> > | 20020731114502|0144058Y01|CHRM|LHSG|MISC
> > | 20030109174500|0144058Y01|PLAS|RHSG|MISC
>  [snip]
> > If you want it sorted by the item id as in your "desired output":
> > 
> > perl -naF'\|' -e '$i{$F[1]} = $_ if ($F[0] > $i{$F[1]});
> > END {map {print $i{$_}} sort keys %i}' infilename > outfilename
> 
> There's no need for the map{} there:
> 
>    perl -naF'\|' \
>       -e '$i{$F[1]} = $_ if $F[0] > $i{$F[1]};'
>       -e 'END {print @i{sort keys %i}}' \
>       infilename > outfilename
> 
> See perldoc perldata for more info on hash slices.

Hi Perl Folks;

I tried the above 'non-map' approach and it my Cygwin
system didn't like it.  So I beat on it a little and
came up with this working version (perl #2 - non-map):

  perl -naF'\|' \
	-e '$i{$F[1]} = $_ if ($F[0] > $i{$F[1]});
	END {print @i{sort keys %i}}' \
	f10k.txt >t3.out

Note:  The problem here may not be my Cygwin 'perl' ...

I ran it with a timing comparison of a similar awk
program that was submitted earlier:

   BEGIN{FS="|"}{
      if(a[$2]<$1) {
	   a[$2]=$1
	   b[$2]=$0	}
   }END{for(i in b) print b[i]}

Then I decided to generate 10K-line test data files
to see how perl compared with awk with larger files:

awk
---------------------------------------------------
real	0m0.236s user	0m0.000s sys	0m0.000s
real	0m0.228s user	0m0.000s sys	0m0.000s 
real	0m0.225s user	0m0.000s sys	0m0.000s
real	0m0.228s user	0m0.000s sys	0m0.000s
real	0m0.236s user	0m0.000s sys	0m0.000s

Perl 1 (map)
---------------------------------------------------
real	0m0.438s user	0m0.000s sys	0m0.000s
real	0m0.317s user	0m0.000s sys	0m0.000s 
real	0m0.300s user	0m0.000s sys	0m0.000s
real	0m0.323s user	0m0.000s sys	0m0.000s
real	0m0.306s user	0m0.000s sys	0m0.000s

perl 2 (non-map)
---------------------------------------------------
real	0m0.304s user	0m0.000s sys	0m0.000s
real	0m0.397s user	0m0.000s sys	0m0.000s 
real	0m0.384s user	0m0.000s sys	0m0.000s
real	0m0.300s user	0m0.000s sys	0m0.000s
real	0m0.297s user	0m0.000s sys	0m0.000s 
real	0m0.305s user	0m0.000s sys	0m0.000s


The 10k line data file was generated with this
(miserable, low-tech, gratituious ksh module):

#!/usr/bin/ksh
n=120000
zero=0
for j in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ;do
	l=0
	while true; do
		for i in 20020731114502 20021212114500 20030118194502 20030109174500
20020924114501;do
			echo "$i|${zero}${n}${j}00|JUNK|JUNK|JUNK"
		done

		let n="n + 1"
		let l="l + 1"

		if [ $l -eq 90 ];then
			break
		fi

		if [ $n -eq 130000 ];then
			echo "n = $n" >&2
			exit 0
		fi
	done
done

HTH

Tim - PITA


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

Date: Tue, 04 Feb 2003 06:19:32 -0600
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.3 $)
Message-Id: <3kqdnV61MtRJMqKjXTWcpg@august.net>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.3 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://mail.augustmail.com/~tadmc/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume 

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.perl.com/CPAN-local/authors/Dean_Roehrich/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "Jeopardy" (because the answer comes before the question), or
        "TOFU".

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan <tadmc@augustmail.com> and many others on the
    comp.lang.perl.misc newsgroup.



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

Date: Tue, 04 Feb 2003 13:01:32 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <v3vedcmiq995b6@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 28 Jan 2003 13:07:26 GMT and ending at
04 Feb 2003 12:36:11 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) 2003 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

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

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

Totals
======

Posters:  248
Articles: 780 (277 with cutlined signatures)
Threads:  190
Volume generated: 1542.7 kb
    - headers:    676.8 kb (13,032 lines)
    - bodies:     829.2 kb (27,920 lines)
    - original:   515.9 kb (18,820 lines)
    - signatures: 36.0 kb (899 lines)

Original Content Rating: 0.622

Averages
========

Posts per poster: 3.1
    median: 2.0 posts
    mode:   1 post - 120 posters
    s:      5.2 posts
Posts per thread: 4.1
    median: 3.0 posts
    mode:   1 post - 44 threads
    s:      4.1 posts
Message size: 2025.3 bytes
    - header:     888.5 bytes (16.7 lines)
    - body:       1088.6 bytes (35.8 lines)
    - original:   677.3 bytes (24.1 lines)
    - signature:  47.3 bytes (1.2 lines)

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

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

   40   106.9 ( 44.2/ 57.4/ 49.1)  tadmc@augustmail.com
   31    60.0 ( 23.3/ 36.7/ 14.1)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   26    41.0 ( 23.2/ 17.8/  8.2)  "Jürgen Exner" <jurgenex@hotmail.com>
   24    57.7 ( 22.4/ 29.9/ 14.6)  tassilo.parseval@post.rwth-aachen.de
   22    54.5 ( 19.8/ 30.9/ 18.9)  Benjamin Goldberg <goldbb2@earthlink.net>
   22    53.6 ( 19.5/ 32.5/ 17.9)  Brian McCauley <nobull@mail.com>
   18    35.9 ( 15.3/ 17.9/ 17.3)  abigail@abigail.nl
   15    27.4 ( 12.4/ 14.9/  5.2)  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
   15    26.2 ( 14.3/ 11.9/  6.6)  "Michael Peuser \(h\)" <post@mpeuser.de>
   13    17.9 ( 11.5/  6.4/  4.1)  "Richard S Beckett" <spikey-wan@bigfoot.com>

These posters accounted for 29.0% of all articles.

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

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

 106.9 ( 44.2/ 57.4/ 49.1)     40  tadmc@augustmail.com
  60.0 ( 23.3/ 36.7/ 14.1)     31  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  57.7 ( 22.4/ 29.9/ 14.6)     24  tassilo.parseval@post.rwth-aachen.de
  54.5 ( 19.8/ 30.9/ 18.9)     22  Benjamin Goldberg <goldbb2@earthlink.net>
  53.6 ( 19.5/ 32.5/ 17.9)     22  Brian McCauley <nobull@mail.com>
  41.0 ( 23.2/ 17.8/  8.2)     26  "Jürgen Exner" <jurgenex@hotmail.com>
  35.9 ( 15.3/ 17.9/ 17.3)     18  abigail@abigail.nl
  30.0 ( 13.8/ 16.2/ 13.1)     12  "Alan J. Flavell" <flavell@mail.cern.ch>
  27.6 ( 12.1/ 15.0/ 10.4)     11  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
  27.4 ( 12.4/ 14.9/  5.2)     15  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>

These posters accounted for 32.1% of the total volume.

Top 10 Posters by Volume of Original Content (min. five posts)
==============================================================

        (kb)
Posts   orig  Address
-----  -----  -------

   40   49.1  tadmc@augustmail.com
   22   18.9  Benjamin Goldberg <goldbb2@earthlink.net>
   22   17.9  Brian McCauley <nobull@mail.com>
   18   17.3  abigail@abigail.nl
   24   14.6  tassilo.parseval@post.rwth-aachen.de
   31   14.1  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   12   13.1  "Alan J. Flavell" <flavell@mail.cern.ch>
   11   10.4  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
   26    8.2  "Jürgen Exner" <jurgenex@hotmail.com>
    9    7.9  mgjv@tradingpost.com.au

These posters accounted for 33.2% of the original volume.

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

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

0.963  ( 17.3 / 17.9)     18  abigail@abigail.nl
0.933  (  5.4 /  5.8)      5  Mina Naguib <spam@thecouch.homeip.net>
0.856  ( 49.1 / 57.4)     40  tadmc@augustmail.com
0.832  (  2.9 /  3.5)      6  "Alex Banks" <alex@alexbanks.com>
0.804  ( 13.1 / 16.2)     12  "Alan J. Flavell" <flavell@mail.cern.ch>
0.786  (  3.5 /  4.4)      5  John Ramsden <john_ramsden@sagitta-ps.com>
0.745  (  7.0 /  9.3)      6  Michele Dondi <bik.mido@tiscalinet.it>
0.692  ( 10.4 / 15.0)     11  "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
0.651  (  2.4 /  3.6)      5  "Pons" <pons@gmx.li>
0.646  (  3.2 /  5.0)      5  Hemuda <hemuda@yahoogroups.com>

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

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

0.459  (  8.2 / 17.8)     26  "Jürgen Exner" <jurgenex@hotmail.com>
0.442  (  2.9 /  6.6)      7  "Harald H.-J. Bongartz" <bongie@gmx.net>
0.441  (  3.0 /  6.8)      7  andrew
0.429  (  2.2 /  5.2)      5  Jeff D Gleixner <glex_nospam@qwest.net>
0.385  ( 14.1 / 36.7)     31  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.380  (  4.5 / 12.0)     12  Uri Guttman <uri@stemsystems.com>
0.348  (  5.2 / 14.9)     15  Ben Morrow <mauzo@mimosa.csv.warwick.ac.uk>
0.342  (  2.0 /  5.9)      9  Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
0.332  (  1.0 /  3.1)      6  "John W. Krahn" <krahnj@acm.org>
0.324  (  2.8 /  8.5)     10  Thens <thens@nospam.com>

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

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

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

   25  Next problem.
   23  array slicing
   20  Attitude to Perl in academia
   14  How to search a file (newbie)
   13  Tie::IxHash
   11  inconsistent handling of undefined values?
   10  Tainting individual variables
   10  perl simple script
   10  hash ordering.
   10  what's the best book for learning perl?

These threads accounted for 18.7% of all articles.

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

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

  49.0 ( 17.6/ 30.1/ 17.6)     20  Attitude to Perl in academia
  44.7 ( 20.2/ 24.3/  9.6)     23  array slicing
  41.9 ( 23.2/ 17.5/  9.6)     25  Next problem.
  34.0 (  2.0/ 32.0/ 32.0)      2  Posting Guidelines for comp.lang.perl.misc ($Revision: 1.3 $)
  30.2 ( 11.5/ 17.7/ 11.7)      9  FAQ: How do I handle binary data correctly?
  26.1 (  8.0/ 16.8/ 10.0)      8  APL's relation to perl
  23.2 ( 12.0/ 10.2/  5.7)     13  Tie::IxHash
  22.4 ( 14.2/  7.8/  3.7)     14  How to search a file (newbie)
  21.8 (  9.3/ 11.1/  6.1)     11  inconsistent handling of undefined values?
  20.6 (  8.7/ 11.2/  6.0)     10  Tainting individual variables

These threads accounted for 20.3% of the total volume.

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

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

0.902  ( 10.8/  11.9)      7  cgi-lib to cgi.pm conversion
0.803  (  5.4/   6.7)      6  my sorting is slow
0.788  (  3.2/   4.1)      6  How to close all ports ???
0.787  (  6.7/   8.5)      5  Creating my own Guestbook.
0.759  (  3.0/   4.0)      5  Aren't there any functions in perl similar to print_r in PHP?
0.751  (  3.2/   4.2)      5  Search a text
0.748  (  1.4/   1.9)      5  String to float casting?
0.745  (  7.1/   9.6)      7  Perl standalone programms and copyright
0.743  (  7.7/  10.3)      5  Substituting words in Array with items from a hash?
0.730  (  3.7/   5.0)      6  $G->add_weighted_edge($u, $w, $v, $a) "the uknown $a variable"

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

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

0.463  (  1.3 /  2.8)      6  wondering why this doesn't work
0.455  (  6.0 / 13.2)      5  Why is this script sending 0 byte file attachments?
0.445  (  3.6 /  8.1)      8  purpose of threads?
0.445  (  2.0 /  4.6)     10  hash ordering.
0.437  (  2.8 /  6.5)      6  Problem checking for newline in $_ input line
0.435  (  3.4 /  7.8)      5  Parse a logfile - 1st column DateStamp; extract latest mods to an ItemNumber
0.434  (  3.0 /  7.0)      8  Crossposting (was: Fetchrow Question)
0.400  (  3.2 /  7.9)      9  Timestamps to thousandths of a second.
0.395  (  1.5 /  3.8)      5  Why doesn't  perl -ex 'print 1' work on Windows?
0.394  (  9.6 / 24.3)     23  array slicing

65 threads (34%) had at least five posts.

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

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

      19  alt.perl
      11  comp.lang.awk
      11  comp.unix.shell
       6  mailing.database.mysql
       5  comp.lang.perl.modules
       4  mailing.database.mysql-win32
       3  comp.mail.mime
       3  comp.os.linux.development.apps
       3  comp.lang.perl
       3  comp.mail.sendmail

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

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

       8  fred <fma@doe.carleton.ca>
       7  "Alex Banks" <alex@alexbanks.com>
       6  Andrzej Filip <anfi@Box43.pl>
       5  those who know me have no need of my name <not-a-real-address@usa.net>
       4  "Dr. Yuan Liu" <yliu@stemnet.nf.ca.remove_this>
       4  Tim Cargile <tecargile@hotmail.com>
       4  shree <srigowrisn@hotmail.com>
       4  Mina Naguib <spam@thecouch.homeip.net>
       3  Nishark <john_grisham81@yahoo.com>
       3  Benjamin Goldberg <goldbb2@earthlink.net>


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

Date: Tue, 4 Feb 2003 06:30:35 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: strange localtime return
Message-Id: <slrnb3vcjb.6q2.tadmc@magna.augustmail.com>

Shadowfax <shadowfax@optonline.net> wrote:

> But when I
> run the script, surprisingly 


It is not surprising, it is exactly as it is supposed to be.

If you simply guess at what a function is supposed to do, then
you are pretty much asking for surprises.


> I saw the $year return as "691131", did I
> do something wrong ?


Yes. You did not read the documentation for the functions that
you are using.

That is the programming equivalent of signing a contract without
reading it. You are asking for pain if you do that, so don't do that. :-)


> $org_dir="E:\\temp\\testfolder";


You do not need to use silly slashes:

   $org_dir='E:/temp/testfolder';



> @org_files=readdir(DIR) ;


> 	$mtime=(stat($org_file))[9] ;


   perldoc -f readdir

         If you're planning to filetest the return values
         out of a "readdir", you'd better prepend the
         directory in question.  Otherwise, because we
         didn't "chdir" there, it would have been testing
         the wrong file.


So make that:

   $mtime=(stat("$org_dir/$org_file"))[9] ;


> 	my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime
> mtime;
 ^^
 ^^ where is the dollar sign?


Please see the Posting Guidelines that are posted here frequently:

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.


You should read the docs for the functions that you use:

   perldoc -f localtime

         $year is the number of years since 1900.  That is,
         $year is 123 in year 2023.

         ...

         The proper way to get a complete 4-digit year is
         simply:

                 $year += 1900;


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


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

Date: Tue, 4 Feb 2003 14:39:38 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: strange localtime return
Message-Id: <Pine.LNX.4.53.0302041437390.4005@lxplus089.cern.ch>

On Feb 4, Tad McClellan inscribed on the eternal scroll:

>                  $year += 1900;

Only the other day on the WWW I saw the results of some idiot CGI
script telling me that the current year was 19103.  Ho hum.


-- 
           Manchmal denke ich, ich brauche die ganzen schicken, neuen
           Brauser nur, um mich besser gegen den Autor zu wehren...
                                          - Sybille Kahl on dciwam


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

Date: Tue, 4 Feb 2003 06:36:11 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Until loop not working with multiple conditions
Message-Id: <slrnb3vctr.6q2.tadmc@magna.augustmail.com>

Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
> Paul wrote:
> 
>> Can someone tell me why this until loop is not working in perl?
>> 
>> $param="N";
>> $count=1;
>> until($count==5 || $param=="Y") {
> 
> 
> Change
> 
>   $param == "Y"
> 
> to
> 
>   $param eq 'Y'


And enable warnings so that it will never bite you again.


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


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

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


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