[19106] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1301 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 13 18:05:37 2001

Date: Fri, 13 Jul 2001 15:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <995061913-v10-i1301@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 13 Jul 2001     Volume: 10 Number: 1301

Today's topics:
        ANNOUNCE - Tie::RangeHash v0.60 released <wlkngowl@unix.asb.com>
        ANNOUNCE: XML::SAXDriver::Excel 0.01 (isterin)
    Re: arrays & textfile lines (Craig Berry)
    Re: arrays & textfile lines (Eric Bohlman)
        Can it be done without DBI/DBD??? (Mark Deibert)
    Re: Can it be done without DBI/DBD??? <mbudash@sonic.net>
    Re: Can it be done without DBI/DBD??? <newspost@coppit.org>
    Re: easy multi-file find & replace? <nospam-abuse@ilyaz.org>
        FAQ: Where can I buy a commercial version of Perl? <faq@denver.pm.org>
        file definition (J)
    Re: file definition <tony_curtis32@yahoo.com>
    Re: file definition <mjcarman@home.com>
    Re: Finding size of HTML page via HTTP <pne-news-20010713@newton.digitalspace.net>
    Re: Finding size of HTML page via HTTP <jeremyalansmith@netscapeonline.co.uk>
    Re: Finding size of HTML page via HTTP <jeremyalansmith@netscapeonline.co.uk>
    Re: Finding size of HTML page via HTTP (Randal L. Schwartz)
    Re: Finding size of HTML page via HTTP <jeremyalansmith@netscapeonline.co.uk>
    Re: Finding size of HTML page via HTTP (Randal L. Schwartz)
        How to do this in perl? <bcoon@sequenom.com>
    Re: How to do this in perl? <bcoon@sequenom.com>
    Re: how to read multipart/form-data <spamhater@keepyourfilthyspamtoyourself.co.uk>
    Re: how to read multipart/form-data <stumo@bigfoot.com>
    Re: How to resolve multi process issue??? (Gururaj Upadhye)
    Re: Passing sed Expression on Command Line (Jay Tilton)
        POE::Component::IRC <tore@extend.no>
        problem perl 5.6.1 MCPAN <citykid@nospam.com>
    Re: Q about fork and kill (gene)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 10 Jul 2001 23:38:01 -0400
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: ANNOUNCE - Tie::RangeHash v0.60 released
Message-Id: <tkumkr4oribpa1@corp.supernews.com>


NAME
    Tie::RangeHash - Implements "range hashes" in Perl

REQUIREMENTS
    `Tie::RangeHash' is written for and tested on Perl 5.6.0.

    It uses only standard modules.

HISTORY
    Changes since Tie::RangeHash v0.52

    0.60 10 Jul 2001
	- added 'fetch_key' method
	- fixed bug with multiple separators warning using array refs as keys
	- corrected tests to require current version, not 0.51
	- minor code tweaks for consistency
	- uses Test::Harness for tests
	- tests no longer use Time::HiRes
	- added tests for object-oriented interface
	- removed randomized test for now

SYNOPSIS
      use Tie::RangeHash;

      tie %hash, 'Tie::RangeHash';

      $hash{'A,C'} = 1;
      $hash{'D,F'} = 2;
      $hash{'G,K'} = 3;

      $hash{'E'};           # returns '2'
      $hash{'BB'};          # returns '1'

      $hash{'KL'};          # returns nothing ('undef')

    There is also an object-oriented interface:

      $hash = new Tie::RangeHash;

      $hash->add('A,C', 1);
      $hash->add('G,I', 2);

      $hash->fetch('H');    # returns '2'

DESCRIPTION
    This module allows hashes to associate a value with a *range* of
keys
    rather than a single key.

    More detailed descriptions are available in the documentation and
    README.

AVAILABILITY

  It should show up soon at a CPAN mirror near you in as:

    $CPAN/authors/id/R/RR/RRWO/Tie-RangeHash-0.60.tar.gz




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

Date: 13 Jul 2001 11:36:07 -0700
From: isterin@hotmail.com (isterin)
Subject: ANNOUNCE: XML::SAXDriver::Excel 0.01
Message-Id: <tkumkepgum7c97@corp.supernews.com>

XML::SAXDriver::Excel has just been uploaded to PAUSE and will be on
CPAN shortly.  This is a SAX interface and a complement to XML::Excel.
 It does not create an internal data representation as XML::Excel
does, but is based on even processing.  You must set the handlers
before parsing.
It took longer than expected due to Excel's BIFF representation of
empty cell.  BIFF does not store empty cell and therefore there is no
way to call events upon them, unless you are doing your own state
menagement.  You must have the latest Spreadsheet::ParseExcel to use
this module, since there was a patch applied that dealt with some
issues necessary for SAX type XML conversion.

Ilya




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

Date: Fri, 13 Jul 2001 18:27:21 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: arrays & textfile lines
Message-Id: <tkufc99tn3986b@corp.supernews.com>

Casey Chambliss (cchambli@lycos.com) wrote:
: Ok, I'm a perl newbie,  I want to put every 10th line of CONTENT.TXT
: into the @CONTENT array.

  open CONTENT, '< CONTENT.TXT' or die $!;

  while (<CONTENT>) {
    push @CONTENT, $_ unless $. % 10;
  }

  close CONTENT;

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Brute force done fast enough looks slick."
   |             - William Purves


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

Date: 13 Jul 2001 20:07:55 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: arrays & textfile lines
Message-Id: <9inker$6dp$1@bob.news.rcn.net>

In comp.lang.perl.misc Robert Sherman <rsherman@ce.gatech.edu> wrote:
> not sure if this is proper or recommended, but it does the job:


> -----------------------------------
> open FILE, "content.txt";

When posting code in this group (where a lot of newbies are likely to read 
it), it's Generally Regarded As Essential to enable warnings and 
strictures, and to check the results of all filesystem operations.  We 
want to help new Perl programmers avoid bad habits of the sort that can 
cause problems that take hours to track down, or that result in the author 
posting here for help with something that his own computer could have 
helped him with.

#!/usr/bin/perl -w
use strict;
open FILE, 'content.txt' or die "Couldn't open content.txt: $!";

> while (<FILE>) {

> 	if (($.%10) == 0){
> 		push @content, $_;
> 		}
> }

Otherwise that's a perfectly reasonable way to do it, although another 
followup shows a way that's slightly more idiomatic.



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

Date: 13 Jul 2001 11:42:51 -0700
From: area31@mail.com (Mark Deibert)
Subject: Can it be done without DBI/DBD???
Message-Id: <20f405bf.0107131042.7ea8616f@posting.google.com>

I used to do all my web scripting with Perl a couple years back. Got
away from it and now (3 years later) I'm back and feel like a complete
newbie! :-/

I've been having all kinds of problems installing DBI using
ActiveState's PPM. I just can't get to work. My ISP says I have to pay
$25.00 for them to install the -free- DBI module. Isn't that nice of (
iNNERHOST.com ) to charge -one- user (me) so -all- users can have
access to a module!

Can you access databases (Access, Oracle, SQL server, etc.) without
using the DBI module? How hard will this be?

Thanks in advance helping me return to Perl :-)

Mark Deibert


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

Date: Fri, 13 Jul 2001 19:39:50 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Can it be done without DBI/DBD???
Message-Id: <mbudash-C7D2FF.12395313072001@news.sonic.net>

In article <20f405bf.0107131042.7ea8616f@posting.google.com>, 
area31@mail.com (Mark Deibert) wrote:

> I used to do all my web scripting with Perl a couple years back. Got
> away from it and now (3 years later) I'm back and feel like a complete
> newbie! :-/
> 
> I've been having all kinds of problems installing DBI using
> ActiveState's PPM. I just can't get to work. My ISP says I have to pay
> $25.00 for them to install the -free- DBI module. Isn't that nice of (
> iNNERHOST.com ) to charge -one- user (me) so -all- users can have
> access to a module!
> 
> Can you access databases (Access, Oracle, SQL server, etc.) without
> using the DBI module? How hard will this be?

use DBI/DBD any way you can, even if you have to pay. it just ain't 
worth it to do it any other way...

my .02
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Fri, 13 Jul 2001 16:32:08 -0500
From: David Coppit <newspost@coppit.org>
Subject: Re: Can it be done without DBI/DBD???
Message-Id: <3B4F68D8.9070801@coppit.org>

Mark Deibert wrote:

> I've been having all kinds of problems installing DBI using
> ActiveState's PPM. I just can't get to work. My ISP says I have to pay
> $25.00 for them to install the -free- DBI module. Isn't that nice of (
> iNNERHOST.com ) to charge -one- user (me) so -all- users can have
> access to a module!
> 
> Can you access databases (Access, Oracle, SQL server, etc.) without
> using the DBI module? How hard will this be?


Either pay the $$ or install the module yourself in a private 
subdirectory and modify your PERL5LIB environment variable. My rule of 
thumb is that my time is worth $15, and pay anyone who can do the work 
for less. In this case, I suspect that it will take you about an hour to 
install the module yourself if you've never done a private module 
installation.

Search groups.google.com for "comp.lang.perl.* private lib module 
install" for info on how to do a private module install.

David



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

Date: Fri, 13 Jul 2001 21:22:20 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: easy multi-file find & replace?
Message-Id: <9inoqc$2pt5$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Craig Berry
<cberry@cinenet.net>], who wrote in article <tku8pg62fmur36@corp.supernews.com>:
> : >   find public_html -name '*.html' -exec perl -pi -e 's/foobar/fubar/' {} \;
> : 
> :   pfind ./public_html '/\.html$/' '=~ s/foobar/fubar/g'
> 
> Where does one obtain pfind?  Don't see it on CPAN.

In ILYAZ/scripts, IIRC.

[The principal idea of pfind is that the command line arguments are
 arbitrary Perl expressions.  There is one rule to memorize (which
 expressions are considered "filters"); 4 convenience functions
 defined (du, skip, prt, prtline); 7 "-"-switches; and one shortcut
 ('=~ match-or-substitution').  The result is that *a lot* of "Unixish
 stuff" can be done via one program only.
]

Ilya


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

Date: Fri, 13 Jul 2001 18:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Where can I buy a commercial version of Perl?
Message-Id: <xWG37.103$T3.191781888@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  Where can I buy a commercial version of Perl?

    In a real sense, Perl already *is* commercial software: it has a license
    that you can grab and carefully read to your manager. It is distributed
    in releases and comes in well-defined packages. There is a very large
    user community and an extensive literature. The comp.lang.perl.*
    newsgroups and several of the mailing lists provide free answers to your
    questions in near real-time. Perl has traditionally been supported by
    Larry, scores of software designers and developers, and myriads of
    programmers, all working for free to create a useful thing to make life
    better for everyone.

    However, these answers may not suffice for managers who require a
    purchase order from a company whom they can sue should anything go awry.
    Or maybe they need very serious hand-holding and contractual
    obligations. Shrink-wrapped CDs with Perl on them are available from
    several sources if that will help. For example, many Perl books include
    a distribution of Perl, as do the O'Reilly Perl Resource Kits (in both
    the Unix flavor and in the proprietary Microsoft flavor); the free Unix
    distributions also all come with Perl.

    Alternatively, you can purchase commercial incidence based support
    through the Perl Clinic. The following is a commercial from them:

    "The Perl Clinic is a commercial Perl support service operated by
    ActiveState Tool Corp. and The Ingram Group. The operators have many
    years of in-depth experience with Perl applications and Perl internals
    on a wide range of platforms.

    "Through our group of highly experienced and well-trained support
    engineers, we will put our best effort into understanding your problem,
    providing an explanation of the situation, and a recommendation on how
    to proceed."

    Contact The Perl Clinic at

        www.PerlClinic.com

        North America Pacific Standard Time (GMT-8)
        Tel:    1 604 606-4611 hours 8am-6pm
        Fax:    1 604 606-4640

        Europe (GMT)
        Tel:    00 44 1483 862814
        Fax:    00 44 1483 862801

    See also www.perl.com for updates on tutorials, training, and support.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           02.16
-- 
    This space intentionally left blank


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

Date: 13 Jul 2001 12:37:07 -0700
From: vodkaru@netscape.net (J)
Subject: file definition
Message-Id: <1d3899d4.0107131137.12eab50a@posting.google.com>

looking for help on deriving a file definition from data file but dont
have access to the documentation. I have Perl reaaranging this file
right now to make it more readable, but really wont a format
definition.


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

Date: 13 Jul 2001 16:03:30 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: file definition
Message-Id: <87zoa85yot.fsf@limey.hpcc.uh.edu>

>> On 13 Jul 2001 12:37:07 -0700,
>> vodkaru@netscape.net (J) said:

> looking for help on deriving a file definition from data
> file but dont have access to the documentation. I have
> Perl reaaranging this file right now to make it more
> readable, but really wont a format definition.

Errr, down the street, 3rd on the left?

How is anyone supposed to make any sense of this?  Give us
a clue!  What is in the data file?  What do you want to do
with the data?  To what documentation do you not have
access?  If you mean perl, it's all included a local
installation, and it's all on the web...

-- 
Beep beep!  Out of my way, I'm a motorist!


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

Date: Fri, 13 Jul 2001 16:07:57 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: file definition
Message-Id: <3B4F632D.AF9153D8@home.com>

J wrote:
> 
> looking for help on deriving a file definition from data file
> but dont have access to the documentation.

What documentation are you looking for? Perl's? You should have it on
your computer already. The file's format? How the hell are we supposed
to know what the format of your file is?

> I have Perl reaaranging this file right now to make it more
> readable, but really wont a format definition.

Huh? Do you want a description of Perl's format utility? Or the format
of your file again?

Seriously, you've asked no question, made a vague request for help, and
told us absolutely nothing that would make it possible to help you.

Do you have a (Perl-related) question?

-mjc


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

Date: Fri, 13 Jul 2001 22:20:15 +0200
From: Philip Newton <pne-news-20010713@newton.digitalspace.net>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <hhluktk3shc63lmdtnj4t5kjvu8nqacl2m@4ax.com>

On Fri, 13 Jul 2001 22:51:39 +1000, "Gregory Toomey" <gtoomey@usa.net>
wrote:

> BTW, if you are saving it to a file, doesn't that mean you are loading it
> into memory already?

Not necessarily all at once. He might be reading, say, 32K at a time
from the socket and writing that chunk to a file, then read the next
chunk, etc.

Just like not everyone uses "foreach(<FILE>)" to iterate through a
file's lines :)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Fri, 13 Jul 2001 20:36:28 GMT
From: "Jeremy Smith" <jeremyalansmith@netscapeonline.co.uk>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <01c10bdb$e8905140$1a6afc3e@jeremysm>

> > BTW, if you are saving it to a file, doesn't that mean you are loading
it
> > into memory already?
> 
> Not necessarily all at once. He might be reading, say, 32K at a time
> from the socket and writing that chunk to a file, then read the next
> chunk, etc.

That's correct!

It's hard to find the length of a HTML file, because if you send a HEAD
request:

HEAD / HTTP1/1

Apache servers (surprisingly), return an Apache header, and don't tell you
the length of the file (I'm surprised Apache break the HTTP spec like
this).

And the only alternative is loading the file off the web, to find out the
length, and then loading it again (!) effectively halfing the bandwidth.

So what I have done (in C, not PERL) is setup 2000 buffers, using up about
4k of memory, and read each new packet into a different buffer, and then
re-combine it all into one array once it's finished downloading. This way I
can handle a 2mb file or so. Any more, and I just allocate some more
buffers.

Anyway, thanks everyone for your suggestions, I think now I'll take a look
at the LWP library source code someone mentioned.

I'll try not to post off-topic in future, it's hard finding a relevant
newsgroup.

Jeremy.



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

Date: Fri, 13 Jul 2001 20:37:46 GMT
From: "Jeremy Smith" <jeremyalansmith@netscapeonline.co.uk>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <01c10bdc$16ec9a80$1a6afc3e@jeremysm>

> > > I'm writing a small browser, and wondered how to find out the size of
the
> > > HTML page, so I can make enough memory available to load it into
memory
> 
> By the way: making enough memory? In perl? You don't have enough?
> You want to *allocate* memory? How? Why?
> You are working on some kind of embedded system?

Okay, sorry, it's C. I posted here 'cos Perl people are more web-savvy than
C programmers (Perl is in many ways the language of the internet). I won't
do it in future, it's a bit naughty I guess, it's "off-topic".

Having said that, it was a HTML question rather than a memory allocating
one.

> You should post more info, because I don't understand your problem, I'm
> afraid.
> I think that your case is not a trivial one, if you need to care about
> memory.
> So please, give us more details.

I mentioned in another post (below) about how I tried sending a HEAD
request, which works fine with most servers, but not with Apache. This is
the root of the problem, Apache is supposed to send the length of the file
(CONTENT-LENGTH). I'm not entirely sure what to do now, the HTTP spec
mentioned some way round this, but it was very vague.

Cheers,

Jeremy.



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

Date: 13 Jul 2001 14:06:11 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <m1g0c04jzw.fsf@halfdome.holdit.com>

>>>>> "Jeremy" == Jeremy Smith <jeremyalansmith@netscapeonline.co.uk> writes:

Jeremy> Okay, sorry, it's C. I posted here 'cos Perl people are more
Jeremy> web-savvy than C programmers (Perl is in many ways the
Jeremy> language of the internet). I won't do it in future, it's a bit
Jeremy> naughty I guess, it's "off-topic".

So you lied to us, and you expect help from us in the future?

Dumb move.

*PLONK*.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 13 Jul 2001 21:12:13 GMT
From: "Jeremy Smith" <jeremyalansmith@netscapeonline.co.uk>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <01c10be0$e3e99340$1a6afc3e@jeremysm>

> Jeremy> Okay, sorry, it's C. I posted here 'cos Perl people are more
> Jeremy> web-savvy than C programmers (Perl is in many ways the
> Jeremy> language of the internet). I won't do it in future, it's a bit
> Jeremy> naughty I guess, it's "off-topic".
> 
> So you lied to us, and you expect help from us in the future?
> 
> Dumb move.

Sorry, but I never lied. I never said I use Perl.

Jeremy.



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

Date: 13 Jul 2001 14:29:49 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <m166cw34c2.fsf@halfdome.holdit.com>

>>>>> "Jeremy" == Jeremy Smith <jeremyalansmith@netscapeonline.co.uk> writes:

Jeremy> Okay, sorry, it's C. I posted here 'cos Perl people are more
Jeremy> web-savvy than C programmers (Perl is in many ways the
Jeremy> language of the internet). I won't do it in future, it's a bit
Jeremy> naughty I guess, it's "off-topic".
>> 
>> So you lied to us, and you expect help from us in the future?
>> 
>> Dumb move.

Jeremy> Sorry, but I never lied. I never said I use Perl.

So why did you post to a *Perl* group?  In private email, it's because
you said "it's HTTP, therefore Perl".  Double dumb move.

First, misposting.
Second, not "getting it" about being criticized.
Third, sending a different message to the group from the message you sent me.

Three strikes.  Methinks you'll be plonked for a good long time as an
untrainable, therefore unhelpable lunkhead.  Enjoy.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 13 Jul 2001 12:21:01 -0700
From: BCC <bcoon@sequenom.com>
Subject: How to do this in perl?
Message-Id: <3B4F4A1D.970A3445@sequenom.com>

Hi,

I have a system() call output that I need to parse...

For example, in my script I have: 
$qstatout = system("/usr/pbs/bin/qstat -na");

In this case, $qstatout is something like this:

<starts here>
web1.default.domain: 
                                                            Req'd 
Req'd   Elap
Job ID          Username Queue    Jobname    SessID NDS TSK Memory Time 
S Time
--------------- -------- -------- ---------- ------ --- --- ------ -----
- -----
5335.web1.defau nobody   default  6796068652    --    1  --    --    -- 
Q   -- 
    -- 
5336.web1.defau nobody   default  1360682545    --    1  --    --    -- 
Q   -- 
    -- 
5337.web1.defau nobody   default  5053232920    --    1  --    --    -- 
Q   -- 
    -- 
5339.web1.defau nobody   default  5053232920    --    1  --    --    -- 
Q   -- 
    -- 
5340.web1.defau nobody   default  9052964547    --    1  --    --    -- 
Q   -- 
    -- 
5341.web1.defau nobody   default  9052964547    --    1  --    --    -- 
Q   -- 
<ends here>

What I would like to do is write a sub that takes Jobname as an
argument, get the 'S' column value corresponding to 'Jobname'.  So if I
want to find the 'S' (status) of Jobname 5053232920, I can call the sub,
and return the status.

I was trying to match the position of 'S' in line 3, but then did not
know how to begin the next match at that position.  I read about using
pos() and \g, but Im not sure thats what I need.  Is this the best way
to approach this?

Im sure this is pretty simple, but Im not so great at regular
expressions yet...

Any help is appreciated!

Thanks,
Bryan


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

Date: Fri, 13 Jul 2001 12:30:47 -0700
From: BCC <bcoon@sequenom.com>
Subject: Re: How to do this in perl?
Message-Id: <3B4F4C67.F44D1E22@sequenom.com>

Lame!  Sorry about the wrap :P 

In my post, the lines are like this:
1 web1.default.domain
2
3 Job ID etc
4 ------------------
5 jobid username etc
6 ---
7 jobid username etc

Hope that makes some kind of sense.


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

Date: Fri, 13 Jul 2001 18:47:10 GMT
From: "Alan Wrigley" <spamhater@keepyourfilthyspamtoyourself.co.uk>
Subject: Re: how to read multipart/form-data
Message-Id: <OmH37.1133$23.140503@newsread2.prod.itd.earthlink.net>

"Dave Hoover" <redsquirreldesign@yahoo.com> wrote in message
news:UcQ17.117219$mG4.57495078@news1.mntp1.il.home.com...
> Enrico wrote:
>
> > also, it "read($file, my $buffer, 1024)", what is in $file.
>
> $file holds the the value of the HTML form field:
> <input type="file" name="file">
>
> Typically, the input would look something like this:
> C:\WINDOWS\Desktop\foo.html

I don't know if this is a Perl query or not.

File upload doesn't work for me if the source file has spaces in the
filename (which is becoming increasingly common with the proliferation of
'My Documents' and 'My Pictures' folders). Is there a way for the Perl
script that processes the upload to overcome this?

Alan





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

Date: Fri, 13 Jul 2001 20:30:01 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: how to read multipart/form-data
Message-Id: <9_H37.26970$WS4.4095613@news6-win.server.ntlworld.com>

Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> wrote in message
news:OmH37.1133$23.140503@newsread2.prod.itd.earthlink.net...
> "Dave Hoover" <redsquirreldesign@yahoo.com> wrote in message
> news:UcQ17.117219$mG4.57495078@news1.mntp1.il.home.com...
> > Enrico wrote:
> >
> > > also, it "read($file, my $buffer, 1024)", what is in $file.
> >
> > $file holds the the value of the HTML form field:
> > <input type="file" name="file">
> >
> > Typically, the input would look something like this:
> > C:\WINDOWS\Desktop\foo.html
>
> I don't know if this is a Perl query or not.
>
> File upload doesn't work for me if the source file has spaces in the
> filename (which is becoming increasingly common with the proliferation of
> 'My Documents' and 'My Pictures' folders). Is there a way for the Perl
> script that processes the upload to overcome this?
>

I've used the CGI module with source files with spaces, with no problems. Are
you coding this yourself? If so, could it be a regex needs to be changed to
allow spaces?

Stuart




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

Date: 13 Jul 2001 13:52:43 -0700
From: gururaj@powertec.com (Gururaj Upadhye)
Subject: Re: How to resolve multi process issue???
Message-Id: <23c54ab6.0107131252.7bb4671d@posting.google.com>

gnari <gnarinn@hotmail.com> wrote in message news:<995021225.499611284118146.gnarinn@hotmail.com>...
> In article <23c54ab6.0107121536.536df790@posting.google.com>,
> Gururaj Upadhye <gururaj@powertec.com> wrote:
> >nobull@mail.com wrote in message news:<u9g0c284ei.fsf@wcl-l.bham.ac.uk>...
> >> gururaj@powertec.com (Gururaj Upadhye) writes:
> >> 
> 
> (snipped problem with mod_perl)
> 
> >
> >The script that is producing this result is user_manage.cgi. I
> >downloaded it from capn site. I am a novice of perl and not an expert
> >in Apache.
> >
> can you provide a link to this script? i did not find it
> 
> gnari

Here it is
http://stein.cshl.org/~lstein/user_manage/ documentation and to download use
http://stein.cshl.org/WWW/software/user_manage/user_manage.tar.gz
Regards,
-Gururaj


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

Date: Fri, 13 Jul 2001 20:06:07 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Passing sed Expression on Command Line
Message-Id: <3b4f5242.25059055@news.erols.com>

On 13 Jul 2001 10:25:21 -0700, JC_VA@HOTMAIL.COM (Buck Turgidson) wrote:

>This should be an easy one.  I have written a simple Perl to use as a
>sed for Windows.  However, it does not recognize the expression that I
>pass on the command line.
> 
>Can someone spot my error?

The hangup is that 's/XX/YY/' is just a string of characters, but you're
trying to use it as if it was a fully-formed operator.  Not gonna work.

You could conceivably abuse eval() to make it work, but that whole wheel's
been invented already, thanks to the -p switch.

  perl -pe "s/XX/YY/" xx.txt

Nice and easy.


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

Date: Fri, 13 Jul 2001 22:29:07 +0200
From: Tore Aursand <tore@extend.no>
Subject: POE::Component::IRC
Message-Id: <MPG.15b9787e21cab292989693@news.online.no>

Hi!

I'm about to create an IRC bot, and instead of using the old 
Net::IRC module(s), I began thinking of the POE architecture.

It looks nice, but I have a small (...) problem with it's IRC 
component, POE::Component::IRC.  Most of the bot works, but I 
(ie. the script) doesn't seem to receive an even when the bot 
is talked to "the ctcp way".

I create the bot session like this;

POE::Session->create(
        _start           => \&handle_start,
        irc_connected    => \&irc_connected,
        irc_ctcp_version => \&irc_ctcp_version,
        _stop            => \&handle_stop,
    );

The 'irc_connected' handler works just fine, but the ctcp 
handler doesn't work at all.  Trying to debug my script, I see 
that only the '_parseline' even is called when sending an ctcp 
to the bot.  According to the manual, the POE::Session should 
act upon all ctcp event, calling the 'irc_ctcp_whatever', where 
'whatever' is the ctcp message.

What's my problem?  Do I have to declare the '_parseline' event 
and take care of the ctcp event myself, or am I missing 
something?

Thanks in advance!


-- 
Tore Aursand - tore@extend.no - www.aursand.no


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

Date: Fri, 13 Jul 2001 14:39:34 -0700
From: Les Ander <citykid@nospam.com>
Subject: problem perl 5.6.1 MCPAN
Message-Id: <Pine.LNX.4.33.0107131429580.23158-100000@schewanella.stanford.edu>

Hi, I tried to install the Net-SSH-Perl-1.20 bundle. Unfortunately, it
downloaded perl 5.6.1 and now i get conflict errors when i try to install
another module

( i get the following error:


Text-Flowchart-1.00/>> make
Perl lib version (v5.6.0) doesn't match executable version (v5.6.1) at
/usr/lib/perl5/5.6.0/i386-linux/Config.pm line 21.
Compilation failed in require at /usr/lib/perl5/5.6.0/ExtUtils/Install.pm
line 10
 .
BEGIN failed--compilation aborted at
/usr/lib/perl5/5.6.0/ExtUtils/Install.pm lin
e 10.
Compilation failed in require.
BEGIN failed--compilation aborted.
make: *** [pm_to_blib] Error 255
}


i am using redhat 7.1.
can someone help me fix this problem (i would like to get things
back to the way they were. Is there a way i can uninstall perl 5.6.1?)




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

Date: 13 Jul 2001 12:21:37 -0700
From: usenet@smalltime.com (gene)
Subject: Re: Q about fork and kill
Message-Id: <9a95c0dd.0107131121.3f216d77@posting.google.com>

Thanks for the prompt replies.  I replaced this code:

> >   8: 		while (kill 0 => $pid) {
> >   9: 			print "still going\n";
> >  10: 			sleep(1);
> >  11: 		}

with this code:

do {
   $kid = waitpid(-1, &WNOHANG);
   print "still going\n";
   sleep(1);
} until $kid == -1;


which did the same thing, but is certainly more portable.


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

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


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