[12017] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5617 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 10 10:07:18 1999

Date: Mon, 10 May 99 07:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 10 May 1999     Volume: 8 Number: 5617

Today's topics:
        ActivePerl under W95 <haytounet@my-dejanews.com>
        apache/mod_perl: error calling Text::ParseWords::parse_ <lamb@huntsville.sparta.com>
    Re: Character codes in Perl foxxii@my-dejanews.com
    Re: combining data in a text delimited file <rms1@cec.wustl.edu>
    Re: cybercash help <mimo@interdata.com.pl>
        e-Mail to SMS perl script <katigaebler@hotmail.com>
        email attachment <david@icon-design.com>
    Re: email attachment <ebohlman@netcom.com>
        FAQ "I still don't get locking ..." and use strict <flavell@mail.cern.ch>
    Re: FAQ "I still don't get locking ..." and use strict <ebohlman@netcom.com>
    Re: If first record....Please read!!! jeffrey_f@my-dejanews.com
    Re: If first record....Please read!!! (Michel Dalle)
    Re: If first record....Please read!!! (Jim Britain)
        matching resource ID's <dstiff@symantec.com>
    Re: Msgbox question <maaskant@frg.eur.nl>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: ODBC and Access memo fields <michaelw@palawnet.com>
    Re: Oraperl question (newbie) <rhardicr@hotmail.com>
    Re: Passing an array through wanted in File::Find (Andrea L. Spinelli)
    Re: reqiure script <ged@fortec.tuwien.ac.at>
    Re: Runninf external programs from Perl on NT (Scott McMahan)
    Re: Socket.pm - How to change the timeout? <revjack@radix.net>
    Re: Sorting is too slow for finding top N keys... - BEN (Michel Dalle)
    Re: Sorting is too slow for finding top N keys... - UPD (Marko R. Riedel)
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        Warnings about uninintialised variables despite use str tertullian@my-dejanews.com
    Re: Web form "debugger" for MacPerl (Chris Nandor)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 10 May 1999 15:23:56 +0200
From: "Arnaud Limbourg" <haytounet@my-dejanews.com>
Subject: ActivePerl under W95
Message-Id: <7h6lv6$1h524@norma.bull.net>

Hello,

i am desperately trying to make the activestate version of perl work under
my machine (W95, personal web server 4).

Each time i call a perl script i get a 405 method not allowed error.

Could somebody tell me how to set activePerl up properly ?




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

Date: Mon, 10 May 1999 14:00:32 +0000
From: Patrick Lamb <lamb@huntsville.sparta.com>
Subject: apache/mod_perl: error calling Text::ParseWords::parse_line
Message-Id: <3736E680.23EE4E15@huntsville.sparta.com>

I have a CGI script that used to work, and I really don't think I've
changed anything since it worked, but now it's sporadic.  It looks like
one out of five servers will process the request correctly, and the
other four barf with error messages like:

[Mon May 10 08:21:20 1999] [error] PerlRun: `[Mon May 10 08:21:20 1999]
mwc.pl: Undefined subroutine &Text::ParseWords::parse_line called at
satellite.pl line 1073, <GEN0> chunk 10.'

perl_status?Text::ParseWords reports:

Embedded Perl version 5.00404 for Apache/1.3.3 (Unix) mod_perl/1.16_02
process 1425, 
running since Sun May 9 15:08:48 1999

 arrays     Text::ParseWords::EXPORT, Text::ParseWords::EXPORT_FAIL,
Text::ParseWords::EXPORT_OK, Text::ParseWords::ISA,
Text::ParseWords::lines

 functions  Text::ParseWords::nested_quotewords,
Text::ParseWords::old_shellwords, Text::ParseWords::parse_line,
Text::ParseWords::quotewords,
          Text::ParseWords::shellwords
 hashes
 ios
 packages
 scalars    Text::ParseWords::VERSION
 unknowns


The same script works find from the command line, with /usr/bin/perl. 
If I run it using a cgi_bin/ path (i.e., not using the cgi_perl path
that enables mod_perl), it works OK.  Any clues or suggestions would be
appreciated and welcomed!
	
	Pat
-- 
Patrick Lamb, Ph.D.           lamb@huntsville.sparta.com


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

Date: Mon, 10 May 1999 12:05:56 GMT
From: foxxii@my-dejanews.com
Subject: Re: Character codes in Perl
Message-Id: <7h6i33$uft$1@nnrp1.deja.com>

There is no ASCII value for "left-arrow", "right-arrow", etc. They are
character sequences. What character we're you expecting?
                                            3
Go to any number of ASCII references on the w.

-S


In article <3733de14.17869722@news.intac.com>,
  gondorff@shaws.com (Henry Gondorff) wrote:
> Hi,
> 	I'm having problems with the ord() function in perl...  it
> returns zero for several keys, including the arrow and function keys.
> Is this due to Perl itself or to DOS?
> 	Basically, I am looking for a way to differentiate between
> user keystrokes; currently, I have no way to tell the difference
> between 'F1' and 'Left Arrow' (or 'Right Arrow' or NULL, etc).
> I have tried both sysread() calls and the Term::ReadKey module.
> Getting the key from the console is no problem, but figuring out
> which key an ord() value of zero belongs to is my problem.
> 	I've seen a few attempts at answers to similar questions on
> CPAN, but I'm not anxious to use C header files to fix this...  I am
> wondering if there is a 100% Perl solution.
> 	I am running ActivePerl 5.15 on Windows 98/DOS 7.
> Any help will be greatly appreciated.
>
> Thanks in advance,
> DTD
>


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


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

Date: Mon, 10 May 1999 08:55:07 -0500
From: Rhett Sutphin <rms1@cec.wustl.edu>
To: dejanews@fearsome.net
Subject: Re: combining data in a text delimited file
Message-Id: <3736E53B.1C608714@cec.wustl.edu>

I am just learning Perl, too, but I think I can help with this.

I am assuming that you already have the file read in and can put a line
at a time into a string (in a while loop, or by reading the whole file
into a list, or whatever).

You can use the "split" function to do what you want.  It's documented
in perlfunc.  Here's how I'd suggest you use it (briefly):

($product,$quantity,$price) = split(/|/,$line);

And then you can just add $price to a running total.

Hope that helps (and that it's a good way to do it -- any opinions?).

Rhett Sutphin


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

Date: Mon, 10 May 1999 11:22:52 +0200
From: Michal Mosiewicz <mimo@interdata.com.pl>
Subject: Re: cybercash help
Message-Id: <3736A56C.2B921E33@interdata.com.pl>

Steven Kim wrote:
> 
> Hello,
> 
> I was wondering if I could get some help on scripting for cybercash. I have
> a cybercash account that I need my script to start transactions but I can't
> seem to find any sample script even at the Cybercash's site.

Download Cybercash Merchant Server, there are examples. You're going to
need it anyhow.

Mike

-- 
WWW: http://www.lodz.pdi.net/~mimo  tel: Int. Acc. Code + 48 42 2148340
add: Michal Mosiewicz  *  Bugaj 66 m.54 *  95-200 Pabianice  *   POLAND


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

Date: Mon, 10 May 1999 13:04:44 +0200
From: Kati Gdbler <katigaebler@hotmail.com>
Subject: e-Mail to SMS perl script
Message-Id: <3736BD4C.598B4348@hotmail.com>

Hello,

I'm looking for some kind of e-mail to SMS perl script, that can grab
first 160 characters, including, the senders email address, the subject
line, and a part of the message. Then forward the content as one SMS
message to a cellular phone. Has anyone seen such a script somewhere?

Thanks,

Kati


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

Date: Mon, 10 May 1999 13:04:20 +0100
From: "David Craig" <david@icon-design.com>
Subject: email attachment
Message-Id: <ciAZ2.377$T3.1063@newsr2.u-net.net>

Does anyone know how to attach a file to an email from a perl script?

I have a program which creates the file, and I want to be able to email it
to an address.  I can get the email part ok, but how do I encode and send
the attached file?

Thanks
David Craig
david@icon-design.com




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

Date: Mon, 10 May 1999 13:54:23 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: email attachment
Message-Id: <ebohlmanFBIryn.1Dz@netcom.com>

David Craig <david@icon-design.com> wrote:
: Does anyone know how to attach a file to an email from a perl script?

MIME::Lite can handle most people's attachment needs.



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

Date: Mon, 10 May 1999 13:27:53 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: FAQ "I still don't get locking ..." and use strict
Message-Id: <Pine.HPP.3.95a.990510131916.26032H-100000@hpplus01.cern.ch>


I have a problem (no, NOT a web page counter!!!) for which the
FAQ "I still don't get locking..." offers what seems the ideal
solution.

However, I'm trying to discipline myself to "use strict", and I'm
not quite sure on this point.  This:

    use Fcntl;
    sysopen(FH, "numfile", O_RDWR|O_CREAT, 0644) or die [...]

causes the error 

  Bareword "O_RWDR" not allowed while "strict subs" in use

The "perldiag" suggestion for this error message is "perhaps you need to
predeclare a subroutine?", but surely these are not subroutines...?

What, please, is the right thing to do here?



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

Date: Mon, 10 May 1999 13:52:52 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: FAQ "I still don't get locking ..." and use strict
Message-Id: <ebohlmanFBIrw5.1CH@netcom.com>

Alan J. Flavell <flavell@mail.cern.ch> wrote:
: However, I'm trying to discipline myself to "use strict", and I'm
: not quite sure on this point.  This:

:     use Fcntl;
:     sysopen(FH, "numfile", O_RDWR|O_CREAT, 0644) or die [...]

: causes the error 

:   Bareword "O_RWDR" not allowed while "strict subs" in use

Are you sure you have it spelled correctly?  Fcntl.pm exports O_RDWR by 
default, and the above code (with strict enabled) works for me.

: The "perldiag" suggestion for this error message is "perhaps you need to
: predeclare a subroutine?", but surely these are not subroutines...?

Actually, they are.  Fcntl.pm uses the autoload mechanism to define the 
various modes as subroutines returning constant values (one of the common 
Perl tricks for defining constants).



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

Date: Mon, 10 May 1999 11:45:59 GMT
From: jeffrey_f@my-dejanews.com
Subject: Re: If first record....Please read!!!
Message-Id: <7h6gtn$tn0$1@nnrp1.deja.com>

In article <MPG.11a00a13299a83b4989682@news>,
  design@raincloud-studios.com (Charles R. Thompson) wrote:
> In article <7h5a3i$4cs$1@nnrp1.deja.com>, jeff@indexfinger.com says...
>
> > I need the "If
> > its the first record in the database, it should do
> > one
> > thing.  If not, do something else."  part.
>
> if ($whatever_designates_your_first_record){
>   # do stuff
> }else{
>   # do other stuff
> }


Thats the problem....I dont know what it is!!!

I have:


   open (DB, file.txt);
   @db_lines = <DB>;

   foreach $db_line (@db_lines) {
   HERES WHERE I DO MY STUFF
   }

Would it be:
   if (db_line[0] {}

or what??

Thanks again.

Jeff



>
> > I appreciate all help.
>
> no prob. If I can be any more vague in return, just ask.
>
> --
> Charles R. Thompson
> RainCloud Studios
> --posted with evaluation copy of MicroPlanet Gravity(PC)--
> --please email if software causes problems in newsgroup--
>


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


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

Date: Mon, 10 May 1999 12:22:03 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: If first record....Please read!!!
Message-Id: <7h6j0u$dfr$3@news.mch.sbs.de>

In article <7h6gtn$tn0$1@nnrp1.deja.com>, jeffrey_f@my-dejanews.com wrote:
>In article <MPG.11a00a13299a83b4989682@news>,
>  design@raincloud-studios.com (Charles R. Thompson) wrote:
>   open (DB, file.txt);
>   @db_lines = <DB>;
>
>   foreach $db_line (@db_lines) {
>   HERES WHERE I DO MY STUFF
>   }
>
>Would it be:
>   if (db_line[0] {}
Try $db_lines[0], or if your file is bigger :

open(DB, "<file.txt") || die "can't open file.txt : $!";
$firstline = <DB>;
while (<DB>) {
        # the rest
}
close(DB);

Hint : read some Perl book. That might help for such 'basic' questions...

Michel.

--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html


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

Date: Mon, 10 May 1999 12:28:37 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: If first record....Please read!!!
Message-Id: <3736cd77.179203478@news>

On Mon, 10 May 1999 11:45:59 GMT, jeffrey_f@my-dejanews.com wrote:

>In article <MPG.11a00a13299a83b4989682@news>,
>  design@raincloud-studios.com (Charles R. Thompson) wrote:
>> In article <7h5a3i$4cs$1@nnrp1.deja.com>, jeff@indexfinger.com says...
>>
>> > I need the "If
>> > its the first record in the database, it should do
>> > one
>> > thing.  If not, do something else."  part.
>>
>I have:
>
>
>   open (DB, file.txt);
>   @db_lines = <DB>;
>
>   foreach $db_line (@db_lines) {
>   HERES WHERE I DO MY STUFF
>   }
>
>Would it be:
>   if (db_line[0] {}
>
>or what??

Since you have the lines in a list, already...

open (DB, file.txt);
>   @db_lines = <DB>;
  my $first_line = shift @db_lines ;
>   foreach $db_line (@db_lines) {
>   HERES WHERE I DO MY STUFF
>   }


Since the first line only occurs once -- there's no need (or desire)
to do that portion within the loop..  Shift it out before the loop
starts.

And your head doesn't go screwy thinking about the efficiency of
testing for the first line for the rest of the array..


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

Date: Mon, 10 May 1999 08:52:58 -0400
From: "David Stiff" <dstiff@symantec.com>
Subject: matching resource ID's
Message-Id: <7h6jrc$gdc$1@news2.symantec.com>

I am trying to create a pattern match to separate resource names in a header
file with their ID number. Unfortunately some of the ID numbers have
comments after them which is causing a problem. Here is some sample data

@idList = ( '#define NOTRANS_WFXPGR_REGKEYROOT_NAME          1',
   '#define IDNAME_ENTRY_NAME             28722',
   '#define IDNAME_VIEWER_SECTION          0x3035',
   '#define IDNAME_MSG_RESET        0x0007 // why doesnt this work',
   '#define IDNAME_MSG_RESET        0x0007 /* comments cause problems
*/'
    );

and here is the match:

if ( $id =~ m/IDNAME.* ([0-9x0-9a-zA-Z]*) .*/ ) {

    $idName   = $1;

}

In the first three cases the match works correctly for either decimal or hex
values. The last two fail. My understanding was the brackets () would force
the match to be placed in the $1. But for some reason if the comment exists
after the ID number, $1 is the entire line.

Any help?

Thanks,
Dave Stiff
Symantec




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

Date: Mon, 10 May 1999 13:05:49 +0200
From: Robert Maaskant <maaskant@frg.eur.nl>
Subject: Re: Msgbox question
Message-Id: <3736BD8D.86F31066@frg.eur.nl>

Believe it or not: I did that!

- Robert

Dave Evans wrote:

> Try including the words "Press return to continue" in the message perhaps?
> :-)
>
> Robert Maaskant wrote in message <37369F05.4BD9A8C0@frg.eur.nl>...
> >...
> >But some people don't understand (really!!!) that they must first press
> >the OK-button for the script to continue



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

Date: 10 May 1999 13:37:01 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <7h6ndt$qi$2@info2.uah.edu>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 03 May 1999 13:38:17 GMT and ending at
10 May 1999 07:24:14 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) 1999 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:  252 (46.2% of all posters)
Articles: 369 (20.7% of all articles)
Volume generated: 616.1 kb (20.0% of total volume)
    - headers:    273.0 kb (5,577 lines)
    - bodies:     338.1 kb (10,475 lines)
    - original:   247.1 kb (8,184 lines)
    - signatures: 4.7 kb (113 lines)

Original Content Rating: 0.731

Averages
========

Posts per poster: 1.5
    median: 1.0 post
    mode:   1 post - 187 posters
    s:      1.3 posts
Message size: 1709.7 bytes
    - header:     757.5 bytes (15.1 lines)
    - body:       938.2 bytes (28.4 lines)
    - original:   685.6 bytes (22.2 lines)
    - signature:  13.0 bytes (0.3 lines)

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

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

    9    12.1 (  6.8/  5.3/  3.3)  "Dave Evans" <devans@radius-retail.kom>
    8    12.0 (  8.2/  3.8/  3.6)  mriedel@neuearbeit.de (Marko R. Riedel)
    7     9.8 (  4.8/  5.0/  3.9)  "Alex Black" <enigma@turingstudio.com>
    7    14.1 (  5.4/  8.6/  6.8)  same-as-above
    6    13.2 (  4.4/  8.8/  3.0)  writer@wi.net
    5     7.0 (  4.5/  2.5/  2.5)  Phil Voris <pvorishatesspam@earthlink.net>
    5     8.1 (  3.9/  4.2/  3.0)  Matija Exel <Matija.Exel@lag.ensieg.inpg.fr>
    4    14.3 (  3.5/ 10.5/  9.9)  silver <silver@silverchat.com>
    4     5.2 (  3.4/  1.8/  1.8)  news@i-tradeonline.com
    4     7.3 (  2.9/  4.4/  2.7)  Sebastian Frankfurt <sf@tellux.de>

These posters accounted for 3.3% of all articles.

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

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

  44.1 (  2.5/ 41.6/ 19.8)      3  jefflv@usol.com (Jeff Vannest)
  14.3 (  3.5/ 10.5/  9.9)      4  silver <silver@silverchat.com>
  14.1 (  5.4/  8.6/  6.8)      7  same-as-above
  13.2 (  4.4/  8.8/  3.0)      6  writer@wi.net
  12.1 (  6.8/  5.3/  3.3)      9  "Dave Evans" <devans@radius-retail.kom>
  12.0 (  8.2/  3.8/  3.6)      8  mriedel@neuearbeit.de (Marko R. Riedel)
   9.8 (  4.8/  5.0/  3.9)      7  "Alex Black" <enigma@turingstudio.com>
   8.1 (  3.5/  4.6/  3.4)      4  "Stephen Warren" <swarren@www.wwwdotorg.org>
   8.1 (  3.9/  4.2/  3.0)      5  Matija Exel <Matija.Exel@lag.ensieg.inpg.fr>
   7.3 (  2.9/  4.4/  2.7)      4  Sebastian Frankfurt <sf@tellux.de>

These posters accounted for 4.6% of the total volume.

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

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

1.000  (  2.5 /  2.5)      5  Phil Voris <pvorishatesspam@earthlink.net>
1.000  (  1.8 /  1.8)      4  news@i-tradeonline.com
0.948  (  3.6 /  3.8)      8  mriedel@neuearbeit.de (Marko R. Riedel)
0.942  (  9.9 / 10.5)      4  silver <silver@silverchat.com>
0.819  (  2.1 /  2.6)      3  "Jody Fedor" <JFedor@datacom-css.com>
0.784  (  6.8 /  8.6)      7  same-as-above
0.782  (  1.8 /  2.3)      3  vepxistqaosani@my-dejanews.com
0.780  (  3.9 /  5.0)      7  "Alex Black" <enigma@turingstudio.com>
0.772  (  1.7 /  2.1)      3  smith157@marshall.edu
0.744  (  3.4 /  4.6)      4  "Stephen Warren" <swarren@www.wwwdotorg.org>

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

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

0.693  (  1.7 /  2.5)      3  e.pavis@silicomp.com
0.623  (  2.7 /  4.4)      4  Sebastian Frankfurt <sf@tellux.de>
0.622  (  3.3 /  5.3)      9  "Dave Evans" <devans@radius-retail.kom>
0.621  (  1.2 /  1.9)      3  vepxistqaosani <fbart@sprynet.com>
0.573  (  1.5 /  2.7)      3  rstacy@nf.sympatico.ca (R. S.)
0.565  (  1.0 /  1.9)      3  "Jerry Raynor" <jerryr001NO-SPAM@yahoo.com>
0.476  ( 19.8 / 41.6)      3  jefflv@usol.com (Jeff Vannest)
0.449  (  0.4 /  0.9)      3  duke@no.spam.ee
0.344  (  3.0 /  8.8)      6  writer@wi.net
0.339  (  1.4 /  4.1)      4  fidelman@world.std.com (Miles R. Fidelman)

21 posters (8%) had at least three posts.


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

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

      15  Intelz@nospam.net (Intel No Privacy)
       9  Steve van Dongen <svandong@uniserve.com>
       9  smurphy*NOSPAM*@schange.com (Sean Murphy)
       9  MPCM <Matt@mpcm.com>
       9  "Rick Price" <rick@hpdi.demon.co.uk>
       9  andrew@micron.net
       6  Rob Hughes <rdhughes@home.com>
       4  Sebastian Frankfurt <sf@tellux.de>
       3  demas@sunspot.tiac.net (Charles Demas)
       3  "Tom Ashbrook" <tashbrook@edisonenterprises.com>


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

Date: Mon, 10 May 1999 13:32:18 GMT
From: gregarine <michaelw@palawnet.com>
Subject: Re: ODBC and Access memo fields
Message-Id: <7h6n52$1md$1@nnrp1.deja.com>

Thank you - By the way, what is DBI?
>
> Actually if you are using DBI you need to look at the documentation
> for LongReadLen
>
> $dbh->{LongReadLen}=1500;
>
> Change this value to something larger than the largest entry in your
> memo field, and you should be okay.
>
> gus
>
>


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


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

Date: Mon, 10 May 1999 09:32:45 +0100
From: Richard H <rhardicr@hotmail.com>
Subject: Re: Oraperl question (newbie)
Message-Id: <373699AD.216303AC@hotmail.com>

Jared Hecker wrote:
> 
> Hi, all -
> 
> I am an Oracle DBA with light perl experience, getting to know Oraperl.
> 
> I have a perl script that writes a multi-column array to a flat file.  I
> would like to amend it to write to an Oracle table.
> 
> I have the latest Oracle DBD installed, along with the latest perl
> release.  I have been reviewing the 'commit.pl' example script included
> with the DBD distribution and wondered how one inserts multiple records
> into a table out of an array.   Does one set up a small loop and do it one
> record at a time? That would be inefficient, and doesn't seem a perl-ish
> approach to me.
> 
The standard way of multi-row insert is via a cursor mechanism which DBI
provides, and yes that would be in a loop. only a single connect and a
statement declaration would be required, though, i dont see how you
could do a block insert into any DB?

Richard H


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

Date: Mon, 10 May 1999 11:52:30 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: Passing an array through wanted in File::Find
Message-Id: <3736c2d5.266931012@news.inet.it>

Hi,

summary of what I am going to say:
1. what you are doing cannot possibly work
2. you must use closures to achieve your goal
3. not everybody will agree that 2. is such a good solution.

For point 1., consider the following snippet:

sub foo
{
    print "\@_ = @_\n";
    my $value = 'boing';
}

$x = \(&foo( 1,2,3 ));
print "\$x = $x\n";;
print "dereferencing gives : ${$x}\n";

$x = \&foo( 1,2,3 );
print "\$x = $x\n";;
print "dereferencing gives : ${$x}\n";

You will note (results are equal) that in you original code

>find(\&findkeywords(@keyword_list), "/drv1/web/sites/web6517e/");

you are actually _calling_ findkeywords and [after!]
dereferencing the result. So findkeywords is called just
once and the address its result, which seems to be \$_,
is passed to find. find obviously chokes.

Now let's look at point 2.

Consider the code (consider it an explanation,
not the best thing possible, nor a solution to
your problem):

use File::Find;

sub foo {
  my @keywords = qw( foo bar baz perlfaq7 barbaz );
  return sub {
  foreach my $k (@keywords ){
    if( /$k/i ){
      print "Found $_ in directory File::Find::dir\n";
    }
   }
  };
}

my $ref = foo();
find( $ref, 'c:/bin/perl/html' );

Now foo() returns a pointer to an anonymous subroutine,
and magically the @keywords array continues to live
even after foo's exit, and you have a way of passing
an array to every instance of foo.

3. The main difference between using a global variable,
such as @main::keywords, and a closure is that in a closure
you may specify a _my_ variable.  Now, if you expect
to call _find_ several times in different point of your
code, using closures might make sense. If not, I think
it will be better to use a global variable and stop
using Cruise missiles to kill flies (or peaceful embassies).

See ya
   Andrea


--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209  Fax: +39-035-302999


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

Date: Mon, 10 May 1999 15:11:48 +0200
From: Georg Edelmayer <ged@fortec.tuwien.ac.at>
Subject: Re: reqiure script
Message-Id: <3736DB14.DA564C6A@fortec.tuwien.ac.at>



Hi!
 
I am trying to import code to a script using require. The script runns
under use strict.
Obviously i cannot access global data (as defined with 'my' in the main
script) by subs i have in the required script.
(Use of uninitialised value.......)
 
Here a small example:

# testscript...i know here should be the shebang thingie, but i use perl
for win32.....
use strict;
require "import.pl";
 
print "making hash\n";
my %hash = (
        'a',1,'b',2,'c',3,'d',4,
         );
         print $hash{'a'};
         print $hash{'d'};
         print "\n";
print "making array\n";
my @array = (1,2,3,4);
print $array[0];
print $array[3];
         print "\n";
 &import;
 __END__
 
and here comes the cod i like to import:

# import.pl
 sub import{
 print "hash \n";
 print $hash{'b'};
 print $hash{'c'};
 print"\n";
 print "array\n";
 print $array[1];
 print $array[2];
 print"\n";
 }
 1;
 
If i include the sub directely in the above script, there is no problem.
btw it makes no difference where i put the require directive, as long as
it is before the subroutine call.

Thank you for anny help

 Georg
Ps: Perl Version 5
PPS.: if it is in the faq please bang my had on it.


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

Date: 10 May 1999 12:21:55 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Runninf external programs from Perl on NT
Message-Id: <3736cf63.0@news.new-era.net>

Jonathan Stowe (gellyfish@gellyfish.com) wrote:
> > However, in my case, it seems that perl launches the program and goes
> > straight to the next instruction.
> > 
> > Is there a way around that?

Use start /w

The start command does all the black magic for you. It involves
calls I don't think you could do from Perl.

Scott


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

Date: 10 May 1999 12:27:59 GMT
From: Templeton Conner <revjack@radix.net>
Subject: Re: Socket.pm - How to change the timeout?
Message-Id: <7h6jcf$5eu$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Jonathan Stowe explains it all:

:On 9 May 1999 13:26:49 GMT Stratton Haley wrote:
:> 
:> The problem is, I want the call:
:> 
:>   gethostbyaddr( inet_aton ( $ip ), AF_INET )
:> 
:> to timeout after (say) 10 seconds, instead of the several minutes it now
:> takes. 

:You cannot specify a timeout for this operation explicitly but you can
:use alarm() to cause the operation to be interrupted by a SIGALRM

Thanks for the reply, I'll try it. It's about time I learned that anyway.

:Anyhow, and this might be impolite to ask in public but hey !, why is it
:that you have a different name every time you post - including but not
:limited to :

[snip]

Idle foolishness. "Jack Lyons" just doesn't have that *zing*, you know? 
Plus I was curious about whether or not random capitalized words from
/usr/dict/words would look like names, and more importantly, why I would
think so (or not). Language baffles me. Those million monkeys can type for
an eternity and no matter how many sonnets they crank out, they'll never
be able to tell you why "butter knife" is so different from "plastic
knife", or glean any meaning from "the green is made of moon cheese".  I
just bought that Julian Jaynes book, so it'll probably get worse before it
gets better. 

:I figure there's some program at work there - care to elucidate ?

Thank you for giving me the opportunity to mention perl, it's just a short
perl script that might even be executed more efficiently with simple shell
commands, but I did it in perl anyway. It puts two random capitalized
words on the "mail_address=" line of my .tinrc. 

If it's causing problems for anyone, please e-mail me and tell me so, and
I'll just pick one and stick with it.

-- 
  /~\  censor ambuscade involute Celanese locale dough dispelling burg
 C oo  Haney upside soldier Latinate magnesium travel Millard bedazzle
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://www.radix.net/~revjack/mnj             revjack@radix.net


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

Date: Mon, 10 May 1999 12:14:49 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Sorting is too slow for finding top N keys... - BENCH
Message-Id: <7h6ij5$dfr$1@news.mch.sbs.de>

In article <lzyaix8gkh.fsf@linux_sexi.neuearbeit.de>, mriedel@neuearbeit.de (Marko R. Riedel) wrote:
>
>Greetings.
>
>Yesterday's (05/10/99) version corrupted the source array. The one
>included with this message sorts in place and preserves the source
>array.
>
>Marko R. Riedel
[snip]

Benchmark: timing 100 iterations of Bart1, Larry1, Larry2, Marko2, Michel3...
     Bart1: 59 secs (59.11 usr  0.00 sys = 59.11 cpu)
    Larry1: 72 secs (71.58 usr  0.00 sys = 71.58 cpu)
    Larry2: 94 secs (94.52 usr  0.00 sys = 94.52 cpu)
    Marko2: 110 secs (109.57 usr  0.00 sys = 109.57 cpu)
   Michel3: 114 secs (114.64 usr  0.00 sys = 114.64 cpu)

with :
Bart1 : reverse the hash (since many of the values are identical in this case)
Larry1 : keep top N keys in array and splice when necessary
Larry2 : generalisation of Larry1 for arrays&hashes, max&min, numeric&alpha
Michel3 : forefather (not really perl-like) of Larry1
Marko2 : quick select algorithm

Out of range :
Michel1 : simple Perl sort (!) - xx minutes
Michel2 : sort and slice for each key - 19 seconds
Andy1 : sort and slice when needed - 13 seconds

Note : Marko1 & Marko2 sort an array rather than a hash, so I had to
modify it. Since I'm not another Perl hacker (and the source also has to
be "perlified" according to the todo-list of Marko), my modifications are
probably pretty inefficient. The underlying algorithm seems to be pretty
fast, though...

If anyone could make a 'Marko3' for hashes, I could test it more fairly :-)
Other suggestions are also welcome...

Michel.


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

Date: 10 May 1999 15:08:13 +0200
From: mriedel@neuearbeit.de (Marko R. Riedel)
Subject: Re: Sorting is too slow for finding top N keys... - UPDATE
Message-Id: <lz4sllvzr6.fsf@linux_sexi.neuearbeit.de>


Benchmarks; 1 bug, 1 warning fixed.

Marko R. Riedel

[SNIP] > ./qseltime.pl 2000 4 160 100
constructing permutations ... done.
Benchmark: timing 100 iterations of QselCopy, QselInPlace...
  QselCopy: 35 wallclock secs (28.83 usr +  0.21 sys = 29.04 CPU)
QselInPlace: 28 wallclock secs (22.34 usr +  0.20 sys = 22.54 CPU)


#! /usr/bin/perl -w
#

use Benchmark;


sub qsel1 {
  local ($aref, $min, $max) = @_;
  local ($temp, $pivot);
  local (@lower, @upper);

  return $aref if(!$#$aref);

  if($#$aref==1){
    if($$aref[0]>$$aref[1]){
      $temp=$$aref[0];
      $$aref[0]=$$aref[1];
      $$aref[1]=$temp;
    }

    return $aref;
  }

  $pivot=$$aref[0];
  for $element (@$aref[1..$#$aref]){
    if($element<$pivot){
      push @lower, $element;
    }
    else{
      push @upper, $element;
    }
  }

  if($#lower!=-1 && $min<=$#lower){
    &qsel1(\@lower, $min, $max);
    @$aref[0..$#lower]=@lower;
  }

  $$aref[$#lower+1]=$pivot;

  if($#upper!=-1 && $max>=$#lower+2){
    &qsel1(\@upper, $min-($#lower+2), $max-($#lower+2));
    @$aref[$#lower+2..$#$aref]=@upper;
  }

  return $aref;
}

sub qsel {
  local ($aref, $min, $max, $lower, $upper) = @_;
  local ($temp, $pivot, $i, $j);

  return $aref if($lower>=$upper);

  if($lower==$upper-1){
    if($$aref[$lower]>$$aref[$upper]){
      $temp=$$aref[$lower];
      $$aref[$lower]=$$aref[$upper];
      $$aref[$upper]=$temp;
    }

    return $aref;
  }

  $pivot=$$aref[$lower];

  $i=$lower+1; $j=$upper;
  while($i<=$j){
    while($i<=$j && $$aref[$i]<$pivot){
      $$aref[$i-1]=$$aref[$i];
      $i++;
    };
    while($i<=$j && $$aref[$j]>=$pivot){ $j-- };

    if($i<=$j-1){
      $temp=$$aref[$i];
      $$aref[$i]=$$aref[$j];
      $$aref[$j]=$temp;
    }
  }

  $$aref[$i-1]=$pivot;

  &qsel($aref, $min, $max, $lower, $i-2) 
    if($i>$lower+1 && $min<$i-1);

  &qsel($aref, $min, $max, $i, $upper)
    if($i<$upper && $max>=$i);

  return $aref;
}


sub makeperm {
  local ($size)=@_;
  local ($i);
  local @perm=(-1) x $size;
  local @source=(0..$size-1);

  for($i=$size; $i>0; $i--){
    $invs=int(rand($i));
    $perm[$source[$invs]]=$i; 
    splice @source, $invs, 1;
  }

  return \@perm;
}


MAIN: {
  local ($size, $min, $max, $count)=@ARGV;
  local (@perma, @permb, $i);
    
  $|=1;

  print 'constructing permutations ... ';
  for($i=0; $i<$count; $i++){
    my ($ref, @copy);

    $ref=&makeperm($size);
    @copy=@$ref[0..$size-1];

    $perma[$i]=$ref; 
    $permb[$i]=\@copy;
  }
  print "done.\n";

  $i=0; timethese
    ($count,
     {
      QselCopy => sub 
      { 
	&qsel1($perma[$i++], $min, $max, 0, $size-1)
      },
      QselInPlace => sub 
      { 
	&qsel($permb[--$i], $min, $max, 0, $size-1)
      }
     }
    );
}


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

Date: 10 May 1999 13:37:00 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7h6nds$qi$1@info2.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 03 May 1999 13:38:17 GMT and ending at
10 May 1999 07:24:14 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) 1999 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

Totals
======

Posters:  546
Articles: 1784 (665 with cutlined signatures)
Threads:  480
Volume generated: 3081.0 kb
    - headers:    1343.1 kb (26,485 lines)
    - bodies:     1612.1 kb (50,908 lines)
    - original:   1067.2 kb (37,139 lines)
    - signatures: 124.1 kb (2,987 lines)

Original Content Rating: 0.662

Averages
========

Posts per poster: 3.3
    median: 1.0 post
    mode:   1 post - 332 posters
    s:      9.7 posts
Posts per thread: 3.7
    median: 2.0 posts
    mode:   2 posts - 129 threads
    s:      4.8 posts
Message size: 1768.5 bytes
    - header:     770.9 bytes (14.8 lines)
    - body:       925.3 bytes (28.5 lines)
    - original:   612.6 bytes (20.8 lines)
    - signature:  71.2 bytes (1.7 lines)

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

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

  119   243.7 ( 83.8/147.0/ 89.3)  lr@hpl.hp.com (Larry Rosler)
   96   164.1 ( 73.7/ 76.9/ 43.5)  Jonathan Stowe <gellyfish@gellyfish.com>
   76   106.6 ( 44.6/ 62.0/ 36.8)  tadmc@metronet.com (Tad McClellan)
   75   127.2 ( 63.8/ 62.7/ 46.5)  "Charles R. Thompson" <design@raincloud-studios.com>
   68   158.4 ( 60.1/ 77.5/ 39.4)  Uri Guttman <uri@sysarch.com>
   62    97.6 ( 55.2/ 42.4/ 27.6)  bart.lateur@skynet.be (Bart Lateur)
   42    85.9 ( 34.5/ 42.6/ 23.6)  David Cassell <cassell@mail.cor.epa.gov>
   29    43.5 ( 20.9/ 22.6/ 11.0)  sowmaster@juicepigs.com (Bob Trieger)
   28    39.7 ( 16.0/ 23.6/ 12.4)  Eric Bohlman <ebohlman@netcom.com>
   25    45.0 ( 20.6/ 21.4/ 17.4)  tchrist@mox.perl.com (Tom Christiansen)

These posters accounted for 34.8% of all articles.

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

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

 243.7 ( 83.8/147.0/ 89.3)    119  lr@hpl.hp.com (Larry Rosler)
 164.1 ( 73.7/ 76.9/ 43.5)     96  Jonathan Stowe <gellyfish@gellyfish.com>
 158.4 ( 60.1/ 77.5/ 39.4)     68  Uri Guttman <uri@sysarch.com>
 127.2 ( 63.8/ 62.7/ 46.5)     75  "Charles R. Thompson" <design@raincloud-studios.com>
 106.6 ( 44.6/ 62.0/ 36.8)     76  tadmc@metronet.com (Tad McClellan)
  97.6 ( 55.2/ 42.4/ 27.6)     62  bart.lateur@skynet.be (Bart Lateur)
  85.9 ( 34.5/ 42.6/ 23.6)     42  David Cassell <cassell@mail.cor.epa.gov>
  45.9 ( 18.7/ 21.5/ 13.1)     25  rjk@linguist.dartmouth.edu (Ronald J Kimball)
  45.0 ( 20.6/ 21.4/ 17.4)     25  tchrist@mox.perl.com (Tom Christiansen)
  44.1 (  2.5/ 41.6/ 19.8)      3  jefflv@usol.com (Jeff Vannest)

These posters accounted for 36.3% of the total volume.

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

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

1.000  (  2.5 /  2.5)      5  Phil Voris <pvorishatesspam@earthlink.net>
0.997  (  5.9 /  5.9)      7  andrew-johnson@home.com
0.948  (  3.6 /  3.8)      8  mriedel@neuearbeit.de (Marko R. Riedel)
0.905  (  9.5 / 10.5)     18  fl_aggie@thepentagon.com
0.867  ( 17.4 / 20.0)     11  Greg Bacon <gbacon@cs.uah.edu>
0.834  (  4.5 /  5.3)      5  sb@engelschall.com (Steffen Beyer)
0.812  ( 17.4 / 21.4)     25  tchrist@mox.perl.com (Tom Christiansen)
0.792  (  3.2 /  4.1)      7  "Gabriel Richards" <grichard@uci.edu>
0.791  (  8.2 / 10.3)      6  r-watkins@worldnet.att.net (Robert Watkins)
0.784  (  6.8 /  8.6)      7  same-as-above

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

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

0.503  (  1.6 /  3.1)      8  Jonathan Feinberg <jdf@pobox.com>
0.491  (  3.6 /  7.2)      5  "Asbjorn Gjemmestad" <agjemmes@extremeonline.com>
0.485  ( 11.0 / 22.6)     29  sowmaster@juicepigs.com (Bob Trieger)
0.479  (  3.4 /  7.0)      8  ilya@math.ohio-state.edu (Ilya Zakharevich)
0.468  (  2.2 /  4.6)      8  mjtg@cus.cam.ac.uk (M.J.T. Guy)
0.426  (  3.1 /  7.3)      7  Bob Walton <walton@frontiernet.net>
0.413  (  2.2 /  5.4)      6  "Allan M. Due" <Allan@due.net>
0.380  (  1.2 /  3.1)      5  "Wyzelli" <wyzelli@yahoo.com>
0.344  (  3.0 /  8.8)      6  writer@wi.net
0.323  (  1.6 /  5.1)      5  "Tim" <tim@timbury.com>

57 posters (10%) had at least five posts.

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

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

   29  how to round off numbers?
   29  OReilly bullshit.... Camel logo trademark
   27  having problems getting this script to work...
   22  Finding x^y?
   21  Limit to number of if statements???
   20  Making executables from .pl files?
   19  using $, (was Re: having problems)
   19  "learning perl" does not seem to be written well
   18  Why my?
   17  Find all files regardless of extension

These threads accounted for 12.4% of all articles.

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

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

  53.0 ( 23.8/ 26.4/ 14.9)     29  OReilly bullshit.... Camel logo trademark
  50.3 ( 25.4/ 23.2/ 13.9)     27  having problems getting this script to work...
  46.8 ( 16.7/ 28.0/ 17.4)     20  Making executables from .pl files?
  46.5 ( 12.8/ 32.2/ 20.2)     17  syswrite() lies
  45.3 ( 22.3/ 21.3/ 13.9)     19  using $, (was Re: having problems)
  44.7 ( 17.4/ 25.3/ 17.2)     21  Limit to number of if statements???
  41.1 ( 23.0/ 16.5/  9.0)     29  how to round off numbers?
  41.0 ( 19.6/ 20.0/ 12.2)     19  "learning perl" does not seem to be written well
  37.4 (  0.8/ 36.6/ 14.9)      1  Free Perl Web Database w/ full source code - comments encouraged - db_Perl_Database_100.zip (1/1)
  36.9 ( 10.7/ 25.4/ 16.0)     14  Sorting is too slow for finding top N keys... - UPDATE

These threads accounted for 14.4% of the total volume.

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

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

0.938  (  6.9/   7.4)      5  Help using message boards
0.924  (  8.2/   8.9)      5  The Perl Index Project
0.906  (  7.1/   7.9)      7  UNIX GUI Perl Debugger
0.809  (  1.7/   2.1)      5  Detecting screen resolution...
0.783  ( 12.1/  15.4)      7  Frequent Posters: new group for WWW applications of Perl?
0.779  (  7.2/   9.2)      5  Generate matching strings from regex ?
0.775  (  8.7/  11.3)      7  CGI timeout in web-based listserv
0.772  (  5.1/   6.6)      8  grep to scalar instead of variable?, subroutine exists?
0.769  (  3.1/   4.0)      6  I can not use cgi in my Hypermart account.
0.764  (  7.0/   9.2)     10  local vs. my

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

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

0.475  (  2.0 /  4.3)      5  ODBC and Access memo fields
0.457  (  1.6 /  3.6)      6  I'm new - Please help - Sorting Question
0.431  (  2.5 /  5.8)      6  Can a DNS lookup be performed from within perl ?
0.429  (  4.8 / 11.2)      7  PERLFUNC: binmode - prepare binary files on old systems
0.427  (  1.7 /  4.0)      5  Square brackets in variable for regex
0.416  (  1.6 /  3.9)      5  finding the right doc WAS Re: using perl to manage passwords?
0.392  (  1.6 /  4.0)      7  Who is Just another Perl hacker?
0.345  (  3.9 / 11.2)      9  Rejecting unwanted hits
0.316  (  2.2 /  6.9)     10  Stumped on Regex routine
0.252  (  1.2 /  4.8)      5  FAQ 1.1: What is Perl?

115 threads (23%) had at least five posts.

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

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

      25  comp.lang.perl.modules
      11  comp.lang.python
      11  comp.lang.tcl
      11  comp.lang.perl.moderated
       9  comp.lang.basic.visual.misc
       9  alt.perl
       9  comp.lang.javascript
       9  comp.lang.c
       9  comp.lang.clarion
       9  comp.lang.cobol

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

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

      21  lr@hpl.hp.com (Larry Rosler)
      15  Intelz@nospam.net (Intel No Privacy)
      11  Jonathan Stowe <gellyfish@gellyfish.com>
       9  Steve van Dongen <svandong@uniserve.com>
       9  "Rick Price" <rick@hpdi.demon.co.uk>
       9  andrew@micron.net
       9  smurphy*NOSPAM*@schange.com (Sean Murphy)
       9  MPCM <Matt@mpcm.com>
       6  Rob Hughes <rdhughes@home.com>
       6  sb@engelschall.com (Steffen Beyer)


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

Date: Mon, 10 May 1999 11:44:40 GMT
From: tertullian@my-dejanews.com
Subject: Warnings about uninintialised variables despite use strict
Message-Id: <7h6gr8$tlb$1@nnrp1.deja.com>

Hi all, I have a program (sub004.cgi) beginning ...

#!/usr/bin/perl  -dw
use strict;
#
# Sub-contractors Posting Teams
#
require('../common/readini');
require('lib.pl');
use DBI;


I'm trying to tie down my variable declarations with "use strict" but I
still get warnings such as

Use of uninitialized value at lib.pl line 36, <IN> chunk 1.
        main::ReadParse called at sub004.cgi line 34

line 36 of lib.pl (just a general sub-routine file at the moment - not a
package or module as I haven't got those sussed yet!) is ...

      if ( $ENV{'REQUEST_METHOD'} eq "GET" ) {

So either perl is confused and line 36 isn't the one it's complaining
about
or I'm confused because surely $ENV doesn't need declaring.

Actually I'm confused anyway because by saying "use strict;" aren't I
being
forced to declare all variables using "my"?

Thanks in anticipation

Dan



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


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

Date: Mon, 10 May 1999 11:58:43 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Web form "debugger" for MacPerl
Message-Id: <pudge-1005990758440001@192.168.0.77>

In article <7h4qnu$q9a$1@nnrp1.deja.com>, witte_j@denison.edu wrote:

#   Is there a program (or rather simple way) to give data to a MacPerl script
# in the form it would come from a web form, for purposes of testing and
# debugging form-processing scripts?

Same as you can using CGI.pm wih any version of perl.  For a script:

  #!perl -w
  use CGI qw(:all);
  print map { "$_ => " . param($_) . "\n" } param;

Perl replies with:

  (offline mode: enter name=value pairs on standard input)

Then you can type:

  foo=bar
  baz=buz
  jack=jill

or whatever you want your input to be.  Type a return aftr each line, and
end with ctrl-D.  Perl replies with:

  foo => bar
  baz => buz
  jack => jill

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

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

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