[11307] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4907 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 16 14:07:14 1999

Date: Tue, 16 Feb 99 11:01:43 -0800
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, 16 Feb 1999     Volume: 8 Number: 4907

Today's topics:
        perl, cgi ,help wanted <jay@moorcourt.demon.co.uk>
        print "Content-type: text/html\n\n"; (Robert Saunders)
    Re: print "Content-type: text/html\n\n"; <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: redefining a sub <jdf@pobox.com>
    Re: Redirectiong STDERR (Bart Lateur)
    Re: Redirectiong STDERR (Tad McClellan)
    Re: Regular expression for Currency ??? <jwarner@tivoli.com>
    Re: Regular expression for Currency ??? <rbobo@spd.dsccc.com>
        Server Software (Bababozorg)
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: String Compare (Andre L.)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 16 Feb 1999 10:35:59 -0000
From: "Jay" <jay@moorcourt.demon.co.uk>
Subject: perl, cgi ,help wanted
Message-Id: <919188632.20178.0.nnrp-10.c1ed439a@news.demon.co.uk>


Hi.
Can someone please give me some help setting up everyauction?
Its in perl script and i dont have have a clue how to set it up or modify
it. I'm willing to learn but i need some help.
You can check out the script at: http://www.everysoft.com/auction/
Its a cool peice of software and its totally free.
I just dont know how to use it which is so frustrating.
Please help.
All as i know how to do is create simple web pages and upload them to my
space given to me by my ISP. And I know a bit of very basic html.
You can icq me on 8776268 or email me. or we could even speak on the phone
if you live in the UK.
Thanks very much,
Jay







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

Date: Tue, 16 Feb 1999 17:00:42 GMT
From: robert@iminet.com (Robert Saunders)
Subject: print "Content-type: text/html\n\n";
Message-Id: <ACD58E828E6EDFB1.7169F268B01151C5.BEB12D18706FAC57@library-proxy.airnews.net>

Question.. 

In a perl program once you have used the statement print
"Content-type: text/html\n\n"; to have your html print something is
there a way later in the program to do something like 
print "Location: http://www.whatever.com \n\n"; 

My problem is I am working with a very large program that passes the
Content-type tag early on in the program.. and I am adding a
subroutine that is going to do a redirect to another server.

If I need to make this clearer please ask and will try.. 

Robert Saunders






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

Date: 16 Feb 1999 18:03:19 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: print "Content-type: text/html\n\n";
Message-Id: <836792qo14.fsf@vcpc.univie.ac.at>

Re: print "Content-type: text/html\n\n";, Robert
<robert@iminet.com> said:

Robert> Question..  In a perl program once you have
Robert> used the statement print "Content-type:
Robert> text/html\n\n"; to have your html print
Robert> something is there a way later in the
Robert> program to do something like print
Robert> "Location: http://www.whatever.com \n\n";

Yes, you put in a statement that does

    print "Location: ....\n\n";

(CGI module has simple shortcuts for doing HTTP
headers)

Of course, that won't do what you intend it to do
because you've already output the stream header :-)

Robert> My problem is I am working with a very large
Robert> program that passes the Content-type tag
Robert> early on in the program.. and I am adding a
Robert> subroutine that is going to do a redirect to
Robert> another server.

Only output where and when it is needed.  Once the
header is "out there" it's too late.

You could output into a buffer/temp. file I suppose
instead of stdout and go back and edit the header
out if necessary, but that's not very nice.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 16 Feb 1999 12:08:55 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Ekkis" <ekkis@arix.com>
Subject: Re: redefining a sub
Message-Id: <m3ogmuqnrs.fsf@joshua.panix.com>

"Ekkis" <ekkis@arix.com> writes:

> #!/bin/ksh
         ^^^
Shouldn't you be addressing these questions to a newgroup that deals
with *ksh*?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Tue, 16 Feb 1999 16:43:58 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Redirectiong STDERR
Message-Id: <36cb9f92.7345834@news.skynet.be>

Jalil Feghhi wrote:

>I would like to redirect STDERR to a file. How should I do that?

Just open a file with it as the file handle. You can also duplicate an
existing open handle, for example FH, by opening ">&FH" as the filename.
Example:
	open(STDERR, ">&STDOUT");

	Bart.


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

Date: Tue, 16 Feb 1999 11:39:40 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Redirectiong STDERR
Message-Id: <sgaca7.gm3.ln@magna.metronet.com>

Jalil Feghhi (jalilf@home.com) wrote:
: I would like to redirect STDERR to a file. How should I do that?


   You should do it like everyone else does.

   They check the Perl FAQ before posting.

   Perl FAQ, part 8:

      "How can I capture STDERR from an external command?"


   If you want to redirect STDERR from invoking perl itself
   rather than from an external command that you call from
   within Perl, then you don't have a Perl question.

   In that case, you do it the way that you would redirect
   STDERR for any other command. It is a Unix or shell question.


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


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

Date: Tue, 16 Feb 1999 10:00:14 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Regular expression for Currency ???
Message-Id: <36C9960E.4A83C823@tivoli.com>

I have something that does something similar.  However, it doesn't verify the
format you want.  I was dealing with data in a description field from a db where
sales reps would put in dollar amounts in a variety of formats.  I have included
my code below to help jump start you.

#!/usr/local/bin/perl -w
use DBI;
use DBD::Oracle;
open LOG, ">$0.log" or die "Cannot open log file. $!\n";
$srvr = 'SomeDB';  #Must be a defined System DSN
$uname = 'SomeUser';
$upwd = 'SomePwd';
$dbtype = 'Oracle';
$sqlstmt = 'SELECT ID,DESCRIPTION FROM SOME_TABLE';
die "Cannot prepare statement: $DBI::errstr\n" unless $sth =
$dbh->prepare("$sqlstmt");
$sth->execute;

#-----crunch data
print "ROW\tPROBLEM_ID\tDESCRIPTION\n";
print LOG "ROW\tPROBLEM_ID\tDESCRIPTION\n";
$count = 0;
while(@row = $sth->fetchrow()){
    $pid = $row[0];
    $_ = $row[1];
    #Scan for numbers in a variety of formats.

@nums=m<\-?\$\d{1,3}(?:\,?\d{3})*(?:\.?\d{0,2}?)?(?!\d)\s*[million|thousand|m|k]*>gi;

    if(@nums){
        print "$count\t$pid\t",join(",",@nums),"\n";
        print LOG "$count\t$pid\t",join(",",@nums),"\n";
    }
    $count++;
}
$sth->finish;
$dbh->disconnect;
close LOG;
exit;


bill_mcintyre@my-dejanews.com wrote:

> I am having a brain lock on this.
>
> What would the regular expression be to test the proper format of currency.
>
> For example $123,234.00 (I want to ensure 2 decimal places and a comma every
> thousand)
>
> Thanks for your help.
>
> Bill
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



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

Date: Tue, 16 Feb 1999 12:04:29 -0600
From: Richard Bobo <rbobo@spd.dsccc.com>
Subject: Re: Regular expression for Currency ???
Message-Id: <36C9B32C.EC7FE9EB@spd.dsccc.com>

How about this?

if ( $temp =~ /,/) {
   if ( $temp =~ /\$(\d{1,3},)?(\d{3},)*\d{3}.\d\d$/ ) {
      print "looks good.\n";
      }
   else {
      print "looks bad.\n";
      }
   }
else {
   if ( $temp =~ /\$\d{0,3}\.\d\d$/ ) {
      print "looks good.\n";
      }
   else {
      print "looks bad.\n";
      }
   }

*** The opinions expressed are not those of Alcatel USA, Inc ***





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

Date: 16 Feb 1999 18:28:54 GMT
From: bababozorg@aol.com (Bababozorg)
Subject: Server Software
Message-Id: <19990216132854.09721.00001092@ng144.aol.com>

hi
i need a server software which supports .cgi/.pl files and .htaccess files
at the moments i use OmniHTTPd server but it doesnt sopport .htaccess
or i dont know how to do it.
can you help please
thanks
hamed


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

Date: 16 Feb 1999 17:40:03 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7acahj$erd$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 08 Feb 1999 16:50:26 GMT and ending at
14 Feb 1999 04:19:28 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) 1998 Greg Bacon.  All Rights Reserved.
      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\@mox\.perl\.com

Totals
======

Posters:  462
Articles: 1209 (466 with cutlined signatures)
Threads:  380
Volume generated: 1990.3 kb
    - headers:    902.2 kb (17,891 lines)
    - bodies:     1005.0 kb (32,942 lines)
    - original:   684.9 kb (24,345 lines)
    - signatures: 82.0 kb (1,637 lines)

Original Content Rating: 0.681

Averages
========

Posts per poster: 2.6
    median: 1.0 post
    mode:   1 post - 303 posters
    s:      5.2 posts
Posts per thread: 3.2
    median: 2.0 posts
    mode:   1 post - 134 threads
    s:      3.9 posts
Message size: 1685.8 bytes
    - header:     764.2 bytes (14.8 lines)
    - body:       851.2 bytes (27.2 lines)
    - original:   580.1 bytes (20.1 lines)
    - signature:  69.4 bytes (1.4 lines)

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

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

   46    71.9 ( 32.9/ 29.5/ 18.3)  Jonathan Stowe <gellyfish@btinternet.com>
   40    60.8 ( 31.7/ 23.3/ 22.3)  abigail@fnx.com
   39    68.1 ( 36.9/ 21.2/ 11.6)  rjk@linguist.dartmouth.edu (Ronald J Kimball)
   34    65.3 ( 24.3/ 37.3/ 24.2)  lr@hpl.hp.com (Larry Rosler)
   31    65.9 ( 23.9/ 41.2/ 31.7)  jglascoe@giss.nasa.gov
   25    38.4 ( 14.1/ 24.2/ 16.6)  tadmc@metronet.com (Tad McClellan)
   22    31.1 ( 18.0/ 11.3/  7.3)  Jonathan Feinberg <jdf@pobox.com>
   20    27.7 ( 11.8/ 15.8/  7.0)  Eric Bohlman <ebohlman@netcom.com>
   19    27.5 ( 16.9/ 10.6/  7.1)  bart.lateur@skynet.be (Bart Lateur)
   17    25.3 ( 14.9/ 10.4/  5.0)  ilya@math.ohio-state.edu (Ilya Zakharevich)

These posters accounted for 24.2% of all articles.

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

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

  71.9 ( 32.9/ 29.5/ 18.3)     46  Jonathan Stowe <gellyfish@btinternet.com>
  68.1 ( 36.9/ 21.2/ 11.6)     39  rjk@linguist.dartmouth.edu (Ronald J Kimball)
  65.9 ( 23.9/ 41.2/ 31.7)     31  jglascoe@giss.nasa.gov
  65.3 ( 24.3/ 37.3/ 24.2)     34  lr@hpl.hp.com (Larry Rosler)
  60.8 ( 31.7/ 23.3/ 22.3)     40  abigail@fnx.com
  38.4 ( 14.1/ 24.2/ 16.6)     25  tadmc@metronet.com (Tad McClellan)
  31.6 ( 10.9/ 16.3/ 10.6)     16  Russ Allbery <rra@stanford.edu>
  31.1 ( 18.0/ 11.3/  7.3)     22  Jonathan Feinberg <jdf@pobox.com>
  30.3 ( 14.2/ 10.0/  4.7)     16  merlyn@stonehenge.com (Randal L. Schwartz)
  27.7 ( 11.8/ 15.8/  7.0)     20  Eric Bohlman <ebohlman@netcom.com>

These posters accounted for 24.7% of the total volume.

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

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

0.990  (  2.9 /  2.9)      7  fl_aggie@thepentagon.com
0.957  ( 22.3 / 23.3)     40  abigail@fnx.com
0.818  (  5.5 /  6.8)      7  mjd@op.net (Mark-Jason Dominus)
0.812  (  5.0 /  6.1)      6  dragnovich@my-dejanews.com
0.768  ( 31.7 / 41.2)     31  jglascoe@giss.nasa.gov
0.749  (  3.3 /  4.4)      5  "Mike Watkins" <mwatkins@promotion4free.com>
0.746  (  7.2 /  9.7)     16  webmaster@wondertek.com
0.716  (  5.4 /  7.5)     11  Daniel Grisinger <dgris@moiraine.dimensional.com>
0.692  (  2.6 /  3.7)      8  evil Japh <jeffp@crusoe.net>
0.684  ( 16.6 / 24.2)     25  tadmc@metronet.com (Tad McClellan)

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

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

0.465  (  4.7 / 10.0)     16  merlyn@stonehenge.com (Randal L. Schwartz)
0.465  (  5.5 / 11.7)     11  sholden@cs.usyd.edu.au
0.463  (  3.6 /  7.7)     15  Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
0.444  (  7.0 / 15.8)     20  Eric Bohlman <ebohlman@netcom.com>
0.440  (  2.9 /  6.6)      5  keydet89@yahoo.com
0.431  (  3.6 /  8.4)     10  Uri Guttman <uri@home.sysarch.com>
0.407  (  1.3 /  3.1)      6  Bill Garrett <bgarrett@hamilton.net>
0.334  (  1.5 /  4.4)      6  "Fuzzy " <fuzzy825@hotmail.com>
0.298  (  4.0 / 13.3)      8  topmind@technologist.com
0.287  (  2.0 /  6.8)      6  "Matthew O. Persico" <mpersico@erols.com>

45 posters (9%) had at least five posts.

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

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

   26  fun with strings...
   24  change column of nmbers to 2 dim array
   22  Perl 'zine
   17  Python vs. Perl vs. tcl ?
   16  Converting CSV to LDIF
   15  Calculate yesterdays date
   15  Comments in Perl code
   13  performance penalty: bareword, single quoting, double quoting
   12  String splitting.
   12  Does Perl restrict regular expressions?

These threads accounted for 14.2% of all articles.

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

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

  48.0 ( 22.0/ 22.2/ 13.5)     26  fun with strings...
  43.9 ( 20.1/ 23.4/ 12.3)     22  Perl 'zine
  42.6 ( 16.4/ 25.2/ 16.2)     17  Python vs. Perl vs. tcl ?
  42.5 ( 20.7/ 18.5/ 13.2)     24  change column of nmbers to 2 dim array
  31.9 (  5.4/ 26.3/ 24.2)      8  HELP on assoc. array
  30.0 ( 10.5/ 18.0/ 13.0)     11  PFR: UTC_to_Epoch
  27.6 ( 12.3/ 15.3/  5.1)     10  Perl Criticism
  26.3 ( 12.9/ 12.1/  5.8)     15  Comments in Perl code
  24.7 ( 13.1/ 10.5/  5.7)     16  Converting CSV to LDIF
  24.5 ( 10.8/ 12.1/  8.6)     15  Calculate yesterdays date

These threads accounted for 17.2% of the total volume.

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

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

0.920  ( 24.2/  26.3)      8  HELP on assoc. array
0.868  (  8.8/  10.1)      8  Perl function to reboot NT Server?
0.856  (  3.2/   3.8)      5  No. of lines in a file
0.814  (  4.4/   5.3)      6  passing multiple arrays to a subroutine
0.810  (  2.8/   3.5)      9  newbie: hitcounter
0.796  (  3.4/   4.3)      6  Help editing script
0.783  (  1.6/   2.1)      5  Help extracting Internet Address with Regular Expression.
0.780  (  4.8/   6.1)      6  Advance Data Structure Question
0.771  (  3.5/   4.5)      5  How do I use CGI.pm to fetch parameters?
0.765  (  3.2/   4.2)      6  please,please,please help me for my sanity. SSI execing?

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

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

0.515  (  3.1 /  6.0)     12  String splitting.
0.488  (  2.4 /  4.8)      5  Interactive Programs and Perl
0.478  (  3.6 /  7.6)      6  Newbie: Help to convert korn script
0.477  (  5.8 / 12.1)     15  Comments in Perl code
0.470  (  3.3 /  6.9)      6  perl floating points [benchmarking]
0.467  (  3.7 /  8.0)     12  Does Perl restrict regular expressions?
0.464  (  3.7 /  8.0)     10  Question: Arrays of associative arrays
0.432  (  2.9 /  6.7)      8  Bug and cool debugging technique (5.004_04)
0.401  (  2.5 /  6.2)      8  \n won't work
0.330  (  5.1 / 15.3)     10  Perl Criticism

77 threads (20%) had at least five posts.

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

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

      49  comp.lang.perl.modules
      31  comp.lang.perl.moderated
      26  comp.lang.python
      20  comp.lang.perl
       8  alt.perl
       4  alt.2600.crackz
       4  comp.lang.javascript
       4  alt.cracks
       4  alt.binaries.pictures.erotic.cowgirls
       4  alt.binaries.pictures.erotic.female

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

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

     112  haslawww@friko7.onet.pl (Best Passwords to sex pages )
       8  lr@hpl.hp.com (Larry Rosler)
       7  vitus@wagner.rinet.ru (Victor Wagner)
       7  bt@Gaia.teknon.de (Volker Borchert)
       7  webmaster@wondertek.com
       7  Philip Shotton <phil@iisc.co.uk>
       7  Justin Wills <justin@nectar.com.au>
       6  ilya@math.ohio-state.edu (Ilya Zakharevich)
       6  TechNET Staff <technet@cyberghost.org>
       6  Lars Marius Garshol <larsga@ifi.uio.no>


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

Date: Tue, 16 Feb 1999 12:59:15 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: String Compare
Message-Id: <alecler-1602991259150001@dialup-703.hip.cam.org>

In article <fg3ba7.1re.ln@magna.metronet.com>, tadmc@metronet.com (Tad
McClellan) wrote:

>    if ( $MyStr =~ /[^\w@._-]/ )
                           ^

Underscore (_) is part of \w.  [^\w@.-]

Andre


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4907
**************************************

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