[10158] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3751 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 18 13:07:43 1998

Date: Fri, 18 Sep 98 10:00:34 -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           Fri, 18 Sep 1998     Volume: 8 Number: 3751

Today's topics:
    Re: ** Can I use 'split' here ? ** (Patrick Timmins)
    Re: and? or? (logical operator question) <dejah@DejahsPrivateIce.com>
        Bizarre .pl<>IIS interaction (John MacIntyre)
    Re: Can I foreach multiple arrays? <jdporter@min.net>
    Re: Can I run Perl program regularly? <eashton@bbnplanet.com>
    Re: Can I run Perl program regularly? (Larry Rosler)
        Different way or not to use grep here? kwoody@abalone.citytel.net
    Re: How large is a scalar? and related declaration ques <dejah@DejahsPrivateIce.com>
    Re: How large is a scalar? and related declaration ques (Sean McAfee)
    Re: how safe is xor encryption ? <dejah@DejahsPrivateIce.com>
        Interesting method technique: Default $self <mjd@plover.com>
    Re: Interesting method technique: Default $self (Craig Berry)
    Re: leading  space (Larry Rosler)
    Re: making number a decimal <uri@camel.fastserv.com>
    Re: mod function in PERL? <jdporter@min.net>
    Re: more regex/pattern substitution (Larry Rosler)
    Re: more regex/pattern substitution (Craig Berry)
    Re: Newbie needs CGI help <barnett@houston.Geco-Prakla.slb.com>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: PERL and Updating files <jdporter@min.net>
    Re: Perl implementation question (Larry Rosler)
    Re: Perl implementation question <hessler@cns.mpg.de>
    Re: Perl one-liners dave@mag-sol.com
    Re: Questions about Perl (Neil Kandalgaonkar)
    Re: Regular Expressions for Reading Data (Sean McAfee)
    Re: Runtime evaluation of required modules (Martin Vorlaender)
        two dimensional hashes <cousin@ensam.inra.fr>
    Re: two dimensional hashes <strat@pacifier.com>
    Re: User inputted regexp. (Kjetil Skotheim)
        Which modules needed for httpd POST FORM ? (Jari Aalto+mail.emacs)
    Re: Which modules needed for httpd POST FORM ? <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 18 Sep 1998 15:09:57 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: ** Can I use 'split' here ? **
Message-Id: <6ttt43$s2u$1@nnrp1.dejanews.com>

In article <36023331.B4696981@email.sps.mot.com>,
  r19610@email.mot.com wrote:
 ...
> Here's the scenario:
>
> I have defined :
> $MY_DIR = "/usr/home"
>
> And I have a variable $TheFile = "/usr/home/new_file".
>
> How can I extract the filename, new_file from $TheFile? I tried to with :
> split(/$MY_DIR/,$TheFile) but failed.
> Any help is greatly appreciated.

[snip]

I probably wouldn't use split:

$TheFile =~ s!.*/(.+)!$1!;

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 18 Sep 1998 10:22:57 -0500
From: Mary E Tyler <dejah@DejahsPrivateIce.com>
Subject: Re: and? or? (logical operator question)
Message-Id: <36027ACE.630A@DejahsPrivateIce.com>

John Klassa wrote:
> 
> On Wed, 16 Sep 1998 15:01:56 -0500, Mary E Tyler wrote:
>   > maybe what i really want to know is: will this work?
> 
> Not to be overly critical, really, but let me ask you this:
> 
>         Have you tried this to see if it works?
> 
> Seems like that'd be the easiest way to find out, no?
> 
> --
> John Klassa / Alcatel Telecom / Raleigh, NC, USA <><

ah... not to be pedantic... but "correctness."

dejah
-- 
i trust i make myself obscure, i have need of obscurity now- robert bolt

a heated exchange of unread mail would be welcomed by all- christensen

Skating Fiction. Featuring the  highly acclaimed serial On The Edge!
http://www.DejahsPrivateIce.com


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

Date: Fri, 18 Sep 1998 16:43:43 GMT
From: johnm@oz.net (John MacIntyre)
Subject: Bizarre .pl<>IIS interaction
Message-Id: <36028d47.55121230@news.oz.net>

I have a script that runs just fine on a IIS 4.0 server on NT, ONLY
when run from Internet Explorer.  If I attempt to run the script from
Netscape it *downloads* the .pl file, instead of executing it on the
server.

Any ideas on what I need to do either in the calling HTML, or in
server settings to make this work?

Cheers
John


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

Date: Thu, 17 Sep 1998 11:46:01 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Can I foreach multiple arrays?
Message-Id: <36012EB9.4B288B9@min.net>

Tom Christiansen wrote:
> 
> Check emptiness elesewhere:
> 
>     for ( ;
>          @foos || @bars;
>          ($foo, $bar) = (shift @foos, shift @bars)
>         )
>     {
> 
>     }

Is that really what you want to do?
On the first iteration, $foo and $bar are undef.
Or am I missing something?

-- 
John Porter


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

Date: Fri, 18 Sep 1998 15:27:23 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Can I run Perl program regularly?
Message-Id: <36027975.2388EA06@bbnplanet.com>

Mary E Tyler wrote:

> Okay, my web host (ie i don't run the server) won't let me run cron...
> is there any *other* way.

Talk to your SA. Unless you are in the cron.deny for some prior
infraction I'm sure you could run this from a crontab. If not, you can
always write a little script that runs in the backgroud sleeping for x
amount of time then wakes up and executes the script you want run.

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Fri, 18 Sep 1998 08:41:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can I run Perl program regularly?
Message-Id: <MPG.106c1ef86ef4495998986c@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <36025F67.551E@DejahsPrivateIce.com> on Fri, 18 Sep 1998 
08:26:01 -0500, Mary E Tyler <dejah@DejahsPrivateIce.com> says...
 ...
> > > >How can I make a program that can run my Perl program regularly
> > > >(daily)?
 ...
> Okay, my web host (ie i don't run the server) won't let me run cron...
> is there any *other* way.

Sure.  Put your Perl program in an infinite loop containing the 
'sleep' statement:

while () {
    your_Perl_program();
    sleep(24 * 60 * 60);
}

This will shift one hour at the end of October, but I doubt that you 
care.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 18 Sep 1998 09:20:44 -0700
From: kwoody@abalone.citytel.net
Subject: Different way or not to use grep here?
Message-Id: <Pine.BSI.3.95.980918085324.9293A-100000@abalone.citytel.net>


Wrote a little perl program and was wondering if someone can point out
how to not use grep here? I have a feeling that there must be another way
or two that this could be done. Or possibly how use only one foreach
here?

I'm not looking for speed ups or anything as timings show that this parses
over a 2.5 meg ftp.log file in about 2.2 seconds.

I use it as a cgi to get the display as a nice table via a browser, but as
this is c.l.p.m here is perl source only...

#!/usr/local/bin/perl5 -w
use diagnostics; 
use vars qw($host $daemon);
my $key = "USER";
my $anon = "ANON";

open (FILE,"ftp.log") or die "ftp.log: $!\n";
@_ = <FILE>;
close(FILE);

foreach (@_) {
   $count++ if /$anon/;
}
print "Anonymous Accesses: $count\n";

@_ = grep(/$key/,@_);
foreach (reverse @_) {
    ($month, $day, $time, $host, $daemon, $key, $user) = split(/\s+/);
    printf "%3s  %2d  %10s     %-10s   \n",$month, $day, $time, $user;
} #end foreach loop

thanks,
Keith
kwoody@citytel.net







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

Date: Fri, 18 Sep 1998 10:22:11 -0500
From: Mary E Tyler <dejah@DejahsPrivateIce.com>
Subject: Re: How large is a scalar? and related declaration question. (clarification)
Message-Id: <36027AA1.3A48@DejahsPrivateIce.com>

Please allow me to clarify some issues since i have received email
responses which do not answer my questions... but instead quote what i
have already read (or already missed)

Mary E Tyler wrote:
> 
> how large is a scalar? (ie how big a number will it store?)

but just a few posts ago someone said that split would not return a
whole sequence of numbers because it was "not large enough?" is this a
mistake on the part of the poster, or is it really an issue in PERL.

> 
> okay, *yes* i have been reading the FAQs and I am currently reading the
> HTML man stuff (i think) and I am wading through the camel book, but i
> have not come upon this yet.
> 
> second, i have seen much *stuff* (the technical terms stuff) about
> declarations. i can understand in C how you can declare
> 
> myvariable int;

yes there is an error here. i taught pascal too long and i always get
the order mixed up this last line should read:

int myvariable;

> 
> and that is a declaration... but there are just scalars and lists in
> PERL and so i am confused as to how to declare anything...

i *know* you don't *have* to declare anything. I *know* that is the
*point* of having such loose typing. But i *have* seen references in the
documentation to "declaring variables" and an indication that this is a
*desirable* thing. Now either this means something different from what i
think it means, or there is actually a way to declare variables. SOME
ONE TELL ME WHAT IT IS!!! (pant pant pant)

> 
> speaking of which, when i *do* declare a sub routine, the interpreter
> balks and complains at me. then i realized, the camel says that i can
> prototype a subroutine, but it doesn't show *how*. here is a C function
> prototype
> 
> int FooInt (IntIn int, Format char);

okay, the answer i received via email looked like this:

sub FooInt($$) {...}

for the corresponding prototype in PERL. which is not a prototype at
all, as i understand the definition. This is a function/subroutine
definition. So is the definition all there is... or is there a separate
prototype like in C? Okay, so another question about the above code, how
do i refer to those scalars (in the ($$)) in the body of the code
belonging to that sub? is this more correct?

sub FooInt ($OneThing, $AnotherThing) {...}

then i can refer to $OneThing and $AnotherThing in the body of the code?
okay, if so, that is exactly what i did. The interpreter burped at me
calling all sorts of bogus errors.

> 
> what would be the corresponding prototype in PERL?
> 
> what's more... how do you *call* it?

as for calling:
i called it like this

$Foo=&FooInt ($This, $That);

is this correct?
> 
> thanks in advance,
> dejah

dejah,

-- 
i trust i make myself obscure, i have need of obscurity now- robert bolt

a heated exchange of unread mail would be welcomed by all- christensen

Skating Fiction. Featuring the  highly acclaimed serial On The Edge!
http://www.DejahsPrivateIce.com


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

Date: Fri, 18 Sep 1998 16:30:58 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: How large is a scalar? and related declaration question. (clarification)
Message-Id: <6VvM1.3588$F7.13558361@news.itd.umich.edu>

In article <36027AA1.3A48@DejahsPrivateIce.com>,
Mary E Tyler  <dejah@DejahsPrivateIce.com> wrote:
>Mary E Tyler wrote:
>> how large is a scalar? (ie how big a number will it store?)

>but just a few posts ago someone said that split would not return a
>whole sequence of numbers because it was "not large enough?" is this a
>mistake on the part of the poster, or is it really an issue in PERL.

Didn't see that article.

>> second, i have seen much *stuff* (the technical terms stuff) about
>> declarations. i can understand in C how you can declare

>> myvariable int;
[oops]
>int myvariable;

>> and that is a declaration... but there are just scalars and lists in
>> PERL and so i am confused as to how to declare anything...
>i *know* you don't *have* to declare anything. I *know* that is the
>*point* of having such loose typing. But i *have* seen references in the
>documentation to "declaring variables" and an indication that this is a
>*desirable* thing. Now either this means something different from what i
>think it means, or there is actually a way to declare variables. SOME
>ONE TELL ME WHAT IT IS!!! (pant pant pant)

You can declare variables like so:

use vars qw($foo @bar %baz);

This is primarily useful when you're using the "use strict" compiler
directive.  See "perldoc vars" and "perldoc strict".  I personally have
never found these features particularly useful.

>> speaking of which, when i *do* declare a sub routine, the interpreter
>> balks and complains at me. then i realized, the camel says that i can
>> prototype a subroutine, but it doesn't show *how*. here is a C function
>> prototype
>> int FooInt (IntIn int, Format char);

>okay, the answer i received via email looked like this:
>sub FooInt($$) {...}
>for the corresponding prototype in PERL. which is not a prototype at
>all, as i understand the definition. This is a function/subroutine
>definition. So is the definition all there is... or is there a separate
>prototype like in C?

Yes:

sub FooInt ($$);

You can also declare a sub without defining how its parameters look:

sub FooInt;

Either form allows you to call the sub in the "new style"; that is, without
a "&" prefix.

>Okay, so another question about the above code, how
>do i refer to those scalars (in the ($$)) in the body of the code
>belonging to that sub? is this more correct?

>sub FooInt ($OneThing, $AnotherThing) {...}

This is incorrect.  The only characters that may appear in the prototype
list are $, @, %, &, *, \, ;, and whitespace.  See the perlsub manpage,
under the heading "Prototypes".

>then i can refer to $OneThing and $AnotherThing in the body of the code?
>okay, if so, that is exactly what i did. The interpreter burped at me
>calling all sorts of bogus errors.

Not bogus errors, I'm afraid.  Again I refer you to the perlsub manpage.
Subroutine arguments are passed in the @_ array; it's your job to get them
out.  This is probably the most common way of doing that:

sub FooInt ($$) {
    my ($OneThing, $AnotherThing) = @_;
    # ... body of sub
}

>> what's more... how do you *call* it?
>as for calling:
>i called it like this
>$Foo=&FooInt ($This, $That);
>is this correct?

Yes, although by using the "old style" subroutine call syntax (ie, using a
"&" before the subroutine name), you strip yourself of the benefit of
using prototypes in the first place.  Once more, see the perlsub manpage.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Fri, 18 Sep 1998 10:10:41 -0500
From: Mary E Tyler <dejah@DejahsPrivateIce.com>
Subject: Re: how safe is xor encryption ?
Message-Id: <360277F0.3C1@DejahsPrivateIce.com>

thank you... that was the direction i was heading, but i was having
problems getting there. thank you for your susinct explaination. it was
very educational.

dejah


Mark-Jason Dominus wrote:
> 
> In article <3601F346.3D77@DejahsPrivateIce.com>,
> Mary E Tyler  <dejah@DejahsPrivateIce.com> wrote:
> >> > and how do you have  15% of a bit...
> >>
> >> In exactly the same way that the average family has 2.6 children.
> >
> >i'll ask Matthew's pardon, for feeling so dumb...
> >
> >HUH!!!???
> 
> Well, let's try it a little differently.  A bit it the amount of
> information on one binary digit.  Let's try to figure out how much
> information is in one decimal digit.  If I have a decimal digit, and I
> want to tell you what it is, how many binary digits do I need to do
> that?
> 
> I can make a table like this:
> 
>         Digit           Binary code
>         0               0000
>         1               0001
>         2               0010
>         3               0011
>         4               0100
>         5               0101
>         6               0110
>         7               0111
>         8               1000
>         9               1001
> 
> If I need to send a decimal digit, I can find the corresponding set of
> binary digits from the table and send you that instead.  You have a
> copy of the table, and when you receive the for binary digits, you
> look in the table, and then you know what decimal digit I am talking
> about.
> 
> If we agree on the codes in advance, I can send you four binary
> digits, and that is enough to tell you what decimal digit I am
> thinking of.  In fact, it's more than enough, because there are six
> codes I didn't use at all.  On the other hand, three binary digits is
> not enough, because there are only 8 ways to put together three binary
> digits, and I need at least 10 ways, one for each decimal digit.
> 
> So a decimal digit contains more than 3 bits of information, but less
> than 4.
> 
> Now suppose we want to send three-digit decimal numbers.  Obviously we
> could use the table above and use 12 binary digits for each one.  But
> if we change the code table we can do better, only 10 binary digits
> instead of 12:
> 
>         Digit group     Binary code
>         000             0000000000
>         001             0000000001
>         002             0000000010
>         ...             ...
>         729             1011011001
>         ...             ...
>         999             1111100111
> 
> Ten binary digits is enough.  There are 1,024 ways to string together
> ten binary digits.  But nine binary digits is not enough, because
> there are only 512 ways to string together nine binary digits, and we
> need at least 1,000.
> 
> So
> 
>         3 decimal digits contain more information than  9 binary digits
>         3 decimal digits contain less information than 10 binary digits
> 
> A decimal digit contains between 3 and 3.33 bits.  3.33 is much closer
> to the truth, because 3 decimal digits (1000 combinations) are
> *almost* enough to encode any combination of 10 binary digits (1024
> combinations), whereas 9 binary digits (512 combinations) are only
> enough to encode half the possible combinations of 3 decimal digits
> (1000 combinations).
> 
> The actual answer turns out to be that one decimal digit contains
> about 3.3219 bits of information.  Over the long haul, in long
> messages, you can replace a decimal digit with about 3.3219 binary
> digits.  In short messages of only a few digits, you won't be able to
> do so well.  If you're only sending one decimal digit, you can't send
> 3.3219 bits, because, as you pointed out, there is no such thing as a
> fractional bit.  You have to round up and send 4 binary digits instead
> of 3.3219.  If you're only sending three decimal digits, you have to
> round up and send 10 binary digits instead of 9.9657.  But if you're
> sending 10,000 decimal digits, it is a very simple matter to encode
> them with 33,220 binary digits.
> 
> That is how you can have a fractional number of bits.

-- 
i trust i make myself obscure, i have need of obscurity now- robert bolt

a heated exchange of unread mail would be welcomed by all- christensen

Skating Fiction. Featuring the  highly acclaimed serial On The Edge!
http://www.DejahsPrivateIce.com


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

Date: Fri, 18 Sep 1998 09:30:02 -0400
From: Mark-Jason Dominus <mjd@plover.com>
Subject: Interesting method technique: Default $self
Message-Id: <19980918133002.7916.qmail@plover.com>


First, I'll just show the code, which is simple:

	package DB;
	
	sub new {
	  ...
	}
	
	{ my $the_db;
	  sub the_db {
	    return $the_db if $the_db;
	    my $pack = shift;
	    $the_db = $pack->new();
	  }
	}
	
	sub query {
	  my $self = shift;
	  $self = $self->the_db unless ref $self; # This is the magic
	  ...
	}


What's this for?  

You can create a database object $db with `new', and then make calls
on it with the object method $db->query(...).  That is very ordinary.

For lightweight queries, maybe you don't want to go to the trouble of
explicitly allocating and destructing a database object.  In that
case, you can just do DB->query(...), and it will automatically
allocate a default database object for you and use that database.  It
caches the default object and reuses it if you make any more queries.

I haven't really tried this out much, so don't know how useful it will
be in practice.  But I am looking forward to it.

One possible disadvntage:  It will give some people the heebie-jeebies
because the `query' method is both a class method and an instance method.
They might say that `query' should be an instance method only, and
there should be a separate class method:

	sub defquery {
	  my $pack = shift;
	  $pack->the_db->query(@_);
	}

They may be correct.	  

Mark-Jason Dominus 	  			               mjd@plover.com


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

Date: 18 Sep 1998 16:15:52 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Interesting method technique: Default $self
Message-Id: <6tu0vo$q1f$1@marina.cinenet.net>

Mark-Jason Dominus (mjd@plover.com) wrote:
[code example snipped]
: What's this for?  
: 
: You can create a database object $db with `new', and then make calls
: on it with the object method $db->query(...).  That is very ordinary.
: 
: For lightweight queries, maybe you don't want to go to the trouble of
: explicitly allocating and destructing a database object.  In that
: case, you can just do DB->query(...), and it will automatically
: allocate a default database object for you and use that database.  It
: caches the default object and reuses it if you make any more queries.

CGI.pm does this sort of thing, though with the idiom it uses, you don't
even need the DB-> (CGI->) part.  Each method is coded to detect whether
it's being called 'raw' or on an object, and in the former case, a hidden
default object is used.

: I haven't really tried this out much, so don't know how useful it will
: be in practice.  But I am looking forward to it.

I find it very useful in CGI.pm.  It's rare that I need more than one CGI
object, so using the hidden default one is notationally very convenient.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Fri, 18 Sep 1998 08:04:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: leading  space
Message-Id: <MPG.106c1650c6ec0db6989869@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <x3ylnniby18.fsf@tigre.matrox.com> on 17 Sep 1998 10:42:59 -
0400, Ala Qumsieh <aqumsieh@tigre.matrox.com> says...
> 
> Eric Wong <egwong@netcom.com> writes:
> 
> > A quick fix is to run the array through a foreach loop and
> > just remove the leading space before you print it out again:
> >   foreach (@array) { s/\s+//; }
> 
> This removes ALL spaces!!! the regexp should be s/^\s+//;

This is very amusing.  The poster has already acknowledged to me that the 
problem was as I said -- print "@array"; -- yet here we are discussing 
the best bandage to apply instead of fixing it.

> But, if you really have to do that then use map .. it's faster:
> 
> map s/^\s+//, @array;

Why on earth do you say that?  It is vile and slow.  Where are your 
Benchmarks for a blanket statement about speed?  Here are mine:

#!/usr/local/bin/perl -w
use Benchmark;

my @x = (' ' . 'x' x 80) x 100;

timethese (1 << (shift || 0), {
    Control => sub { my @a = @x; },
    Foreach => sub { my @a = @x; foreach (@a) { s/^\s+// } },
    Map     => sub { my @a = @x; map s/^\s+// => @a },
} );
__END__

Benchmark: timing 4096 iterations of Control, Foreach, Map...
   Control:  7 secs ( 3.01 usr  0.02 sys =  3.03 cpu)
   Foreach: 41 secs ( 9.89 usr  0.05 sys =  9.94 cpu)
       Map: 54 secs (12.77 usr  0.08 sys = 12.85 cpu)

Someone recently posted here that they had never seen a case where 'map 
in void context' was better than 'foreach'.  I think that's right.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 18 Sep 1998 12:54:29 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: making number a decimal
Message-Id: <sar3e9pgy4a.fsf@camel.fastserv.com>

>>>>> "MS" == Mike Stok <mike@stok.co.uk> writes:

  MS> <splonka@my-dejanews.com> wrote:
  >> I'm stuck trying to get my number to print out in decimal format,
  >> like dollar amounts.
  >> 
  >> see the output of http://www.plonka.com/phentex/products.html
  >> 
  >> I'm using
  >> 
  >> $sub =~ s/(\d+)\.*(\d*)/$1\.$2/;
  >> 
  >> but its not quite right. Can anybody help??

i would keep all money amounts as integer values in cents. if you keep
the cents as float fractions you may have rounding errors.

so if you have an integer of cents you can print it with a decimal point
in several ways:

	sprintf "$%d.%02d", $cents / 100, $cents % 100 ;

	sprintf "$%d.%02d", substr($cents, 0, -2), substr( $cents, -2 ) ;

or modify $cents directly

	if ( $cents < 10 ) {
		$cents = "$.0$cents" ;
	}
	else {
		substr( $cents = "\$$cents", -2, 0 ) = '.' ;
	}

many more possibilities.

hth,

uri

-- 
Uri Guttman                             Speed up your web server with Fast CGI!
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Thu, 17 Sep 1998 12:03:42 -0400
From: John Porter <jdporter@min.net>
Subject: Re: mod function in PERL?
Message-Id: <360132DE.F5BE9C87@min.net>

Andre L. wrote:
> 
> > HIW?
> 
> Hope I'm wrong! (Which I was, fortunately.) :-]

L; I got "How I Wish" from it!

-- 
John "Many Jars" Porter


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

Date: Fri, 18 Sep 1998 08:15:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: more regex/pattern substitution
Message-Id: <MPG.106c18f4a76dbb4798986a@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6ttem7$dit$1@nnrp1.dejanews.com> on Fri, 18 Sep 1998 11:03:35 
GMT, jzobel@my-dejanews.com <jzobel@my-dejanews.com> says...
> In article <36013091.76032E4C@qmw.ac.uk>,
> [Problem: Replacing abbreviations with ones using standardized case]
> > Why not something like:
> >
> > @abbrevs = ("PhD", "BBC", "EdD", BSc");
> > foreach $abbrev @abbrevs { s/$abbrev/$abbrev/ig; }
> >
> > Unfortunately, this requires the regexp to be interpreted each time.
> >
> 
> This can be avoided by
> 
> $all_abbrevs = join('|',@abbrevs);
> 
> $document =~ s/($all_abbrevs)/$1/ig;

You have to add an 'o' modifier to specify that the regex needs to be 
evaluated once only.

#!/usr/local/bin/perl -w
use Benchmark;

my $regex = 'foo|bar';
$_ = 'x' x 1000;

timethese (1 << (shift || 0), {
    No_O => sub { s/($regex)/$1/ig },
    O    => sub { s/($regex)/$1/igo },
} );
__END__

Benchmark: timing 65536 iterations of No_O, O...
      No_O: 12 secs ( 3.51 usr  0.02 sys =  3.53 cpu)
         O:  6 secs ( 1.59 usr  0.01 sys =  1.60 cpu) 

But the hash lookup is likely to be *much* faster when there are several 
alternatives.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 18 Sep 1998 16:30:36 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: more regex/pattern substitution
Message-Id: <6tu1rc$q1f$2@marina.cinenet.net>

Larry Rosler (lr@hpl.hp.com) wrote:
: In article <6tt138$5mu$1@marina.cinenet.net> on 18 Sep 1998 07:11:36 GMT, 
: Craig Berry <cberry@cinenet.net> says...
: > Larry Rosler (lr@hpl.hp.com) wrote:
: > : In article <6trdlk$e32$2@marina.cinenet.net> on 17 Sep 1998 16:33:56 GMT, 
: > : Craig Berry <cberry@cinenet.net> says...
: > : >
: > : >   s/(\w+)/exists $casemap{lc $1} ? $casemap{lc $1} : $1/eg;
: > : 
: > : As we can be fairly confident that any value found in %casemap is TRUE 
: > : (after all, we put them there ;-), we could write simpler and faster:
: > : 
: > :     s/(\w+)/$casemap{lc $1} || $1/eg;
: > 
: > I wanted to avoid having casemap entries with keys for every word in the
: > file and undef values springing into existence, hence my longer form.  The
: > output is the same, but for a large doc, the hash (and hence memory size
: > and lookup times) might get rather bloated.
: 
: One of us has a blind spot.  I hope it isn't me.

Your hope has been realized.  I could have *sworn* that looking up a hash
value created the element.  On reflection, I realized that I was
remembering a slightly different case -- that doing

  exists $foo{bar}{quux}

creates $foo{bar} if it didn't exist already.  I guess I overgeneralized
from this.  Sorry to all for the misdirection.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Fri, 18 Sep 1998 10:33:15 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: c960901@student.dtu.dk
Subject: Re: Newbie needs CGI help
Message-Id: <36027D3B.832A0B03@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author, as requested]

c960901@student.dtu.dk wrote:
> 
> Hi
> 
> I'm trying to make a CGI that when executes just writes a file and
> returns a string to the applet that called it. The source looks like
> this:
> #!/usr/local/bin/perl -w
> 
> $write_file = "c:\\httpd\\HtDocs\\test.mpr";
> open(OUT,">>$write_file") || die "Error: $write_file $1";
> print OUT "Test 1 2 3...\n";
> close(OUT);
> 
> Content-type: text/html
> 
> print("Abcdefghijkl");
> exit 0;
> 
> But I get the following compile errors (because of the Content-type):
Of course you do.  Content-type is not a valid Perl command (unlike
print, or exit, or close or ...).

> 
> Argument "type" isn't numeric in subtract at C:\httpd\Cgi-Bin\test.pl line 8.
It's true, type is not numeric.

> Argument "Content" isn't numeric in subtract at C:\httpd\Cgi-Bin\test.pl line
True again, neither is 'Content'.

> 8. syntax error at C:\httpd\Cgi-Bin\test.pl line 8, near "type:" Unquoted
> string "text" may clash with future reserved word at C:\httpd\Cgi-Bin\test.pl
This should have given you a hint.

Are you making use of 'use diagnostics' while trying to debug your
scripts?

> line 8. Unquoted string "html" may clash with future reserved word at
Again, see above.

> C:\httpd\Cgi-Bin\test.pl line 10. Execution of C:\httpd\Cgi-Bin\test.pl
> aborted due to compilation errors.
> 
> I'll be grateful of any help. Please send the reply to my E-mail adress,
> thanks in advance.
What does perl know of 'Content-type: text/html'?  That is not a valid
perl command.

Don't you want this information *print*ed to stdout?
print "Content-type: text/html\n\n";

Note the two (2) '\n' characters....  Very important!  Without them you
will get a malformed header error from your web server.

> 
> Morten
HTH.

Cheers,
Dave

-- 
Dave Barnett	Software Support Engineer	(281) 596-1434

"Security through obscurity is no security at all."
	- comp.lang.perl.misc newsgroup posting


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

Date: 18 Sep 98 14:56:19 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906130825.257895@thrush.omix.com>

Mike Meyer <bouncenews@contessa.phone.net> wrote:
	>snip<
: About as valid as flaming about Perl using special characters to
: determina a variables type. The only other language I know of that
: uses that silly trick is BASIC.

	Least we forget the shells, where Perl got the $var and ${ block }
	ideas in the first place.

	Perl syntax builds on syntax most programmers already know, thereby
	*reducing* the learning and curve which makes the language *easier*
	to read and maintain.

	If you've never touched a computer language before, Python would
	probably be easier.  But then, C programmers are normally raised
	on Pascal for the same reasons, then quickly leave those
	cumbersome training wheels far behind once they've matured in
	programming a bit.

	Hmm, does that make Python the Pascal of scripting languages? :-)

	As with GUI vs CLI, "ease of use" does not equal "efficiency of
	usage", and often impairs it.  Sure, the learning curve is a bit
	steeper, but the rewards are greater.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 18 Sep 98 15:03:26 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906131250.199156@thrush.omix.com>

Garrett G. Hodgson <garry@sage.att.com> wrote:
	>snip<
: i do this daily.  i never found any value in auto-indent, so i
: never put it into my editor.  i've used editors that do this,
: and found it got in my way more than it helped.

	Odd, but that's your right.

: <lightbulb> aaahhh, i think it get it now.  is this angst over
: whitespace due to some editors auto-indenting inconsistently?
: i guess that's why i've never seen this as a problem.

	Yes and no.  Auto-indenting typically just uses the exact indent
	whitespace string of the line before, regardless of other tab vs
	space settings or mixed tab/space.  As such, this is a non-issue.

	>snip<
: >         Since $ and @ are part of VARNAME, you aren't really informing
: >         perl of the type just of the reference.
: kind of a stretch, isn't this?

	Nope.  You can write $var and @array in Java just as quickly,
	although like L_ prefix C conventions this would be user
	enforced only.

: besides, this still involves
: perl enforcing naming conventions on variables (like the old BASICs
: mentioned in another post).  hardly Truth, Justice, and the American
: Way.

	First you complain Perl didn't enforce enough, now you complain
	it enforces too much...

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 17 Sep 1998 11:32:32 -0400
From: John Porter <jdporter@min.net>
Subject: Re: PERL and Updating files
Message-Id: <36012B90.82FB1FA0@min.net>

Elaine -HappyFunBall- Ashton wrote:
> 
> Tom Christiansen wrote:
> >     mmesmer@yahoo.com writes:
> > :How could I get perl -pi -e 's/string1/string2/g to replace files down through
> > :my hierarchy.
> >
> > That's what the find tool was created for.
> 
> Well, find won't replace. 

There's two pieces to the puzzle.  
He already had the one that does the replace.
find is the piece he was missing.

-- 
John Porter


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

Date: Fri, 18 Sep 1998 08:35:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl implementation question
Message-Id: <MPG.106c1d887846187898986b@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <360260F7.3834@DejahsPrivateIce.com> on Fri, 18 Sep 1998 
08:32:42 -0500, Mary E Tyler <dejah@DejahsPrivateIce.com> says...
 ...
> @Header = ($H1, $H2);
> @Data = ($D1, $D2, $D3);
> (@Header, @Data) = split(/:/);
> 
> first, in assigning a list to a scalar, you have just assigned the count
> of the items in the list, so no, what you wrote does not do what you
> want. however, if you assign to a list (ie an array, not a scalar) and
> recall that comma operator does in a list context then it will work.

What makes you think this will work?  Did you test it before posting it?

The result of the 'split' will all end up in @Header, no matter what you 
set @Header and @Data to before doing the 'split'.

PLEASE test code before posting it, no matter how 'trivial' it seems to 
be.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 18 Sep 1998 17:43:26 +0200
From: Sven Hessler <hessler@cns.mpg.de>
Subject: Re: Perl implementation question
Message-Id: <36027F9E.35D0A143@NOSPAMcns.mpg.de>

Mary E Tyler wrote:


> empower.eng wrote:
> > What I have now is
> > ($H1, $H2, $D1, $D2, $D3) = split(/:/);
> > and it works fine.
> > 
> > What I like to be able to do is (not correct Perl syntax).
> > $Header = ($H1, $H2);
> > $Data = ($D1, $D2, $D3);
> > ($Header, $Data) = split(/:/);
 
> you had a minor syntax error.
> 
> @Header = ($H1, $H2);
> @Data = ($D1, $D2, $D3);
> (@Header, @Data) = split(/:/);

> first, in assigning a list to a scalar, you have just assigned the count
> of the items in the list, so no, what you wrote does not do what you
> want. however, if you assign to a list (ie an array, not a scalar) and
> recall that comma operator does in a list context then it will work.

Sorry, but this does not work! 

The list @Data will be empty and all elements splitted will be in the
list @Header. The function split returns exactly one list which will
be assigned to the list @Header. There is no list left for the list
@Data.


Sven

-- 

Please remove NOSPAM from E-Mail address, when reply.


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

Date: Fri, 18 Sep 1998 15:57:13 GMT
From: dave@mag-sol.com
Subject: Re: Perl one-liners
Message-Id: <6ttvsp$vfh$1@nnrp1.dejanews.com>

In article <3602597A.E2FBA6D2@houston.Geco-Prakla.slb.com>,
  Dave Barnett <barnett@houston.Geco-Prakla.slb.com> wrote:
> Aamir Sehbai wrote:
> >
> > Is there a collection of Perl one-liners somewhere on the Web?
> Search deja-news for posts by Abigail.  She has a one-liner at the
> bottom of her posts.  They're often different from one post to the next,
> so ....
>
> That should give you a good start.

I'm guessing that Aamir was looking for one-liners that were understandable by
beginners. I'm not sure that Abigail's sigs fall into this category!

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 18 Sep 1998 12:34:01 -0400
From: yuiop@abnormal.openface.ca (Neil Kandalgaonkar)
Subject: Re: Questions about Perl
Message-Id: <6tu21p$r70@abnormal.openface.ca>

In article <36016dbe.8927658@news.nl.net>,
Twan Kogels <888twan@888nlweb.com> wrote:

>I'm planning to learn pearl, 

perl. (didn't you notice the title of this newsgroup? :)


>1) i want to test my perl script locally, do i need a server? and
>which server is the best. I'm using win95

Server -- I assume you mean web server? Perl is not just a cgi language,
if that's what you're thinking. It doesn't need an X Server either.

Perl needs a perl interpreter, that's all. On win32 all you need is the
command line but there are visual environments available too.


>2) which version of perl should i use?

the latest one that's out of beta, as of today, 5.005. For win32, make
sure to download the "standard" port.


>3) are there any good online tutorials?

perl comes with an extensive manual.
http://www.perl.com is your portal for all pages pertaining to perl,
inlcuding the FAQ, which answers most of your questions.


>4) are there any free IDE's or just handy editors for perl?

free -- no. www.activestate.com ,  www.solutionsoft.com
editors -- well, it's your preference. Good editors can help you write
perl (Emacs, vi, BBEdit, etc.)

-- 
Neil Kandalgaonkar            yuiop communications
neil@yuiop.com


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

Date: Fri, 18 Sep 1998 16:00:31 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Regular Expressions for Reading Data
Message-Id: <zsvM1.3585$F7.13545588@news.itd.umich.edu>

In article <6ttmni$l45$1@nnrp1.dejanews.com>,  <jzobel@my-dejanews.com> wrote:
>In article <874su57q0p.fsf@smart.ruhr.de>,
>  Thomas Neumann <tom@smart.ruhr.de> wrote:
>> jzobel@my-dejanews.com writes:
>> > I would like to use something like for example
>> > /(?:(?:(\d*);)*\n)/go
>> > to read data like
>> > 33;44;55;23524538;
>> > 2;
>> > 33;64576;2353425234;
>> > Unfortunately $1 is a bit 'small'. It only reads 2353425234. It should
>better
>> > be a reference to an array of references to arrays:
>> > $1 = [[33,44,55,23524538],[2], [33,64576,2353425234]]

>> my $rows = [ map { chomp; [ split /;/ ] } <> ];

>This does of course work. But what I would like to have is a general tool that
>can read about everything given a description of the data format as a regular
>expression.

$data_format = '(?g)(\d+);';

while (<>) {
    push(@rows, [ /$data_format/o ]);
}

The exact same while loop will work with other data_format strings; for
example:

$data_format = '(?i)first name:\s*(\w+)\s+last name:\s*(\w+)'
    # gets full name

$data_format = '(\d{3})-(\d{2})-(\d{4})'
    # social security number components

$data_format = '(?g)(\w+)'
    # all words

Can't get much more general than that.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Fri, 18 Sep 1998 17:26:13 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Runtime evaluation of required modules
Message-Id: <36027b95.524144494f47414741@radiogaga.harz.de>

Andy Marden (amarden@ibm.net) wrote:
: What I didn't count on was that the contents of any module used are
: evaluated at compile time, even if the use if in a conditional
: statement. Hence, Platform_NT.pm is evaluated initially even under HPUX,
: and of course it can't find the Win32:: modules which are used in
: Platform_NT.pm
:
: Is there a way of deferring the checking of these modules until the use
: statementis actually encountered at run time rather than compile time?
: I've tried requiring them all first and then conditionally importing
: them, but it fails with the same error at the require step.

Lets see what "perldoc -f use" has to say, shall we?

   use Module LIST             
   use Module                  
   [...]
   It is exactly equivalent to    
                                                           
       BEGIN { require Module; import Module LIST; }       
                                                           
   except that Module *must* be a bareword.                


The "BEGIN" is where your troubles come from.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 OpenVMS: Where do you    | work: mv@pdv-systeme.de
 want to BE today?        |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Fri, 18 Sep 1998 17:16:11 +0200
From: Xavier Cousin <cousin@ensam.inra.fr>
Subject: two dimensional hashes
Message-Id: <3602793B.7CA8@ensam.inra.fr>

Hello, I would like create (and search) a two dimensional hash

	enzyme1 enzyme2 enzyme3
mutant1	data	data	data
mutant2	data	data	...
mutant3	data 	data 	...

I feel it's possible with the arrow operator, but it's not very clear to
me...
I would appreciate some (simple) help.

Thanks a lot

Xavier

please answer to cousin@ensam.inra.fr

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Xavier Cousin                     cousin@ensam.inra.fr

    INRA - DCC                        tel. (33) 04 99 61 28 14
    2, place Pierre Viala             fax  (33) 04 67 54 56 94
    34060 Montpellier Cedex 1

    ESTHER URL http://meleze.ensam.inra.fr/cholinesterase/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 18 Sep 1998 08:34:29 -0700
From: "Christian Brink" <strat@pacifier.com>
Subject: Re: two dimensional hashes
Message-Id: <36027da8.0@news.pacifier.com>


People will be better able (and more likely) to help
if you have some code to post.



C. Christian Brink,CNE
IS-Manager
All-Sports Supply, LLC
Clackamas,OR

strat@pacifier.com
chrisb@assi.com





>Xavier Cousin wrote in message <3602793B.7CA8@ensam.inra.fr>...
>Hello, I would like create (and search) a two dimensional hash
>
> enzyme1 enzyme2 enzyme3
>mutant1 data data data
>mutant2 data data ...
>mutant3 data data ...
>
>I feel it's possible with the arrow operator, but it's not very clear to
>me...
>I would appreciate some (simple) help.
>
>Thanks a lot
>
>Xavier
>
>please answer to cousin@ensam.inra.fr
>
>--
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>    Xavier Cousin                     cousin@ensam.inra.fr
>
>    INRA - DCC                        tel. (33) 04 99 61 28 14
>    2, place Pierre Viala             fax  (33) 04 67 54 56 94
>    34060 Montpellier Cedex 1
>
>    ESTHER URL http://meleze.ensam.inra.fr/cholinesterase/
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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

Date: 18 Sep 1998 15:20:05 GMT
From: kjetil.skotheim@usit.uio.no (Kjetil Skotheim)
Subject: Re: User inputted regexp.
Message-Id: <6tttn5$k4$1@readme.uio.no>

In article <36026D73.4F19B19E@nortel.com>, mkbowler@nortel.com says...
>
>How can I verify a regular expression given by the user for validity?
>
>Code snippet.
>$exp = <STDIN>;
>chop $exp;
>if ($data =~ /$exp/) {
>   #Do something.
>}
>
>This works great until the user types something beginning with a single 
asterisk
>or something else invalid.  Is there a way for me to validate $exp (or at 
least
>gracefully catch the error)?


Maybe like this:

$exp = <STDIN>;
chop $exp;
if (eval {$data =~ /$exp/}) {
   #Do something.
}
elsif($@){
  die $@;
}





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

Date: 18 Sep 1998 19:21:41 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.emacs)
Subject: Which modules needed for httpd POST FORM ?
Message-Id: <ptr4su5v1be.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>


	[CC is okay]


	Hi,

	I'd like to connect to HTTPD daemon and fill out a form and submit
	it the WWW server. like I would if I used Netscape browser 
	and filled it by hand.

	What Perl modules from CPAN I need for this task? I noticed
	HTTPD-Tools-0.55.tar.gz and libwww-perl-5.36.tar.gz, but
	what modules are needed?

	jari


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

Date: 18 Sep 1998 18:49:38 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: jari.aalto@poboxes.com
Subject: Re: Which modules needed for httpd POST FORM ?
Message-Id: <83ogsdjrh9.fsf@vcpc.univie.ac.at>

Re: Which modules needed for httpd POST FORM ?, Jari
<jari.aalto@poboxes.com> said: Jari>

[ Hmm, a perl adventure for Mr. Emacs Toolkit? ]

Jari> 	What Perl modules from CPAN I need for this task? I
Jari> noticed HTTPD-Tools-0.55.tar.gz and
Jari> libwww-perl-5.36.tar.gz, but what modules are needed?

I'd probably use a combination of

    LWP::UserAgent
    HTTP::Request
    URI::URL

Those should be enough: libwww has them all.

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: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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