[23643] in Perl-Users-Digest
Perl-Users Digest, Issue: 5850 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 24 06:10:11 2003
Date: Mon, 24 Nov 2003 03:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 24 Nov 2003 Volume: 10 Number: 5850
Today's topics:
ANN: File::ReadBackwards 1.02 <uri@stemsystems.com>
ANN: File::Slurp 0.01 <uri@stemsystems.com>
Re: clarification on comment Default@IO_Error_1011101.xyz
Re: clarification on comment Default@IO_Error_1011101.xyz
Re: clarification on comment <uri@stemsystems.com>
Re: clarification on comment Default@IO_Error_1011101.xyz
Re: clarification on comment <uri@stemsystems.com>
Re: clarification on comment <me@privacy.net>
Re: code structure <eddhig22@yahoo.com>
Re: from data file into hash slice <eddhig22@yahoo.com>
Re: from data file into hash slice <eddhig22@yahoo.com>
Re: if action do same action plus... (Anno Siegel)
IP packet count at regular intervals of time. <cenxnfu@rpr.nevmban.rqh>
Mod_perl woes <oh-god-please-dont-spam-me@spamhole.com>
Re: Mod_perl woes Default@IO_Error_1011101.xyz
Re: Mod_perl woes <tassilo.parseval@rwth-aachen.de>
Re: Mod_perl woes <oh-god-please-dont-spam-me@spamhole.com>
Re: Mod_perl woes Default@IO_Error_1011101.xyz
Re: Newbie Question: Best way to Extract Post Hashes? (Andrew)
Re: newbie regular expression questions <noreply@gunnar.cc>
Performance problem on SunOS 5.8 (kielhd)
Re: Performance problem on SunOS 5.8 <uri@stemsystems.com>
Re: Performance problem on SunOS 5.8 <me@privacy.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 24 Nov 2003 06:36:49 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: ANN: File::ReadBackwards 1.02
Message-Id: <HouG8A.vrE@zorch.sf-bay.org>
File::ReadBackwards version 1.02 is on cpan. this now passes all tests
on unix and windows.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 24 Nov 2003 08:03:12 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: ANN: File::Slurp 0.01
Message-Id: <HouJrK.1K55@zorch.sf-bay.org>
File::Slurp version 9999.01 is on cpan. this passes all tests
on unix and windows.
this replaces the existing file::slurp owned by david muir. he
graciously gave me the namespace.
the version number is odd and large so it will supercede the old module
which had a date for its version number.
also see the article i wrote on slurping at
http://www.perl.com/pub/a/2003/11/21/slurp.html
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 24 Nov 2003 05:07:42 GMT
From: Default@IO_Error_1011101.xyz
Subject: Re: clarification on comment
Message-Id: <ymgwb.7005$rS5.2045@nwrdny02.gnilink.net>
> i would apologize based on your request because i appreciate your thoughtful
> and helpful replies
> and that engenders my respect for your opinions as well
> perhaps i should have stated my dilema that 'it seems to work from the
> testing i have done', instead of 'i know it works'
> because i did test the code as best i thought and am confused by the
> results, i always try to find answers first from my manuals and
> then google
> as far as coding and testing i think we all come to understand how it works
> from both its stated functionality
> in documentation and actual testing, i'm new to perl but there are other
> languages that i programmed in
> for years and still am learing subtle things about even the most common
> syntax, functions etc., the point being
> we are not perfect, sometimes there is more than we think we know, and
> sometimes we seek the help of
> others when at a dead end
> but thats why i post questions in a forum such as this, obviously if i
> understood the code i wouldn't be
> asking the question!
> i can't know the exact motivation of tintin's comments and if i
> misintrepeted, i regret that.
> the extent and tone of his reply, solely as written, seems to be questioning
> my right to even ask the question
> it has a sarcastic tone and it seems to be scolding or demeaning, if thats
> all somebody has to say without
> any hint of 'maybe you should try this or read this, etc' then i can only
> assume they have not other motivation
> other than negativity.
>
> From: "Gunnar Hjalmarsson" <noreply@gunnar.cc>
> Subject: Re: newbie regular expression questions
> Date: Sunday, November 23, 2003 5:31 PM
>
> bbxrider wrote:
> > thanks for all the help, except from tintin, if thats your idea of
> > help please just keep it to yourself, it certainly doesn't do
> > anybody any good
>
> Tintin's comment was not unhelpful, it was justified, and you really
> ought to find it worth considering. IMHO you owe him an apology.
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
>
>
>
nod.. alot of people here seem 'uptight' and way to quick to scold someone.
mabey cause im just using perl for a hobby.. but this group makes perl seem like
'work' at times. if you dont have something nice to say dont say anything at all.
------------------------------
Date: Mon, 24 Nov 2003 05:09:30 GMT
From: Default@IO_Error_1011101.xyz
Subject: Re: clarification on comment
Message-Id: <eogwb.12102$yy5.170@nwrdny01.gnilink.net>
> > i would apologize based on your request because i appreciate your thoughtful
> > and helpful replies
> > and that engenders my respect for your opinions as well
> > perhaps i should have stated my dilema that 'it seems to work from the
> > testing i have done', instead of 'i know it works'
> > because i did test the code as best i thought and am confused by the
> > results, i always try to find answers first from my manuals and
> > then google
> > as far as coding and testing i think we all come to understand how it works
> > from both its stated functionality
> > in documentation and actual testing, i'm new to perl but there are other
> > languages that i programmed in
> > for years and still am learing subtle things about even the most common
> > syntax, functions etc., the point being
> > we are not perfect, sometimes there is more than we think we know, and
> > sometimes we seek the help of
> > others when at a dead end
> > but thats why i post questions in a forum such as this, obviously if i
> > understood the code i wouldn't be
> > asking the question!
> > i can't know the exact motivation of tintin's comments and if i
> > misintrepeted, i regret that.
> > the extent and tone of his reply, solely as written, seems to be questioning
> > my right to even ask the question
> > it has a sarcastic tone and it seems to be scolding or demeaning, if thats
> > all somebody has to say without
> > any hint of 'maybe you should try this or read this, etc' then i can only
> > assume they have not other motivation
> > other than negativity.
> >
> > From: "Gunnar Hjalmarsson" <noreply@gunnar.cc>
> > Subject: Re: newbie regular expression questions
> > Date: Sunday, November 23, 2003 5:31 PM
> >
> > bbxrider wrote:
> > > thanks for all the help, except from tintin, if thats your idea of
> > > help please just keep it to yourself, it certainly doesn't do
> > > anybody any good
> >
> > Tintin's comment was not unhelpful, it was justified, and you really
> > ought to find it worth considering. IMHO you owe him an apology.
> >
> > --
> > Gunnar Hjalmarsson
> > Email: http://www.gunnar.cc/cgi-bin/contact.pl
> >
> >
> >
> >
> nod.. alot of people here seem 'uptight' and way to quick to scold someone.
> mabey cause im just using perl for a hobby.. but this group makes perl seem like
> 'work' at times. if you dont have something nice to say dont say anything at all.
>
>
for example:
===========================================
Default@IO_Error_1011101.xyz wrote:
> any way i can accomplish this?
Accomplish what?
> the initial print never seems to work,
Work?
> untill there is another command after the initial print.
> (\n <stdin> etc..)
Sorry, don't understand.
Please (re-)read the posting guidelines
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
and rewrite your question, following the advice in the guidelines.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
============================================
why even bother writing that??
------------------------------
Date: Mon, 24 Nov 2003 05:30:40 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: clarification on comment
Message-Id: <x7llq61gfz.fsf@mail.sysarch.com>
>>>>> "D" == Default <Default@IO_Error_1011101.xyz> writes:
D> nod.. alot of people here seem 'uptight' and way to quick to scold
D> someone. mabey cause im just using perl for a hobby.. but this
D> group makes perl seem like 'work' at times. if you dont have
D> something nice to say dont say anything at all.
it IS work for most of us. does that make any sense to you? programming
is a profession that happens to be able to be learned as a hobby. too
bad lawyers and doctors don't have to answer stuff from people who don't
even respect them. do you ask your doctor how to do minor surgery and
expect an answer?
so if you want help, you should respect the group rules (as posted in
the guidelines) and the regulars will be glad to help. if you flout the
rules and expect to be spoon fed you will get what you deserve. most of
the regulars here are professional coders who donate time here because
they love perl. your attitude is disrepectful of what they do. and you
expect all of this and pay nothing as well. go see what redmond will do
for you for that kind of payment.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 24 Nov 2003 06:54:39 GMT
From: Default@IO_Error_1011101.xyz
Subject: Re: clarification on comment
Message-Id: <PWhwb.8903$7%4.8203@nwrdny03.gnilink.net>
> >>>>> "D" == Default <Default@IO_Error_1011101.xyz> writes:
>
> D> nod.. alot of people here seem 'uptight' and way to quick to scold
> D> someone. mabey cause im just using perl for a hobby.. but this
> D> group makes perl seem like 'work' at times. if you dont have
> D> something nice to say dont say anything at all.
>
> it IS work for most of us. does that make any sense to you? programming
> is a profession that happens to be able to be learned as a hobby. too
> bad lawyers and doctors don't have to answer stuff from people who don't
> even respect them. do you ask your doctor how to do minor surgery and
> expect an answer?
>
> so if you want help, you should respect the group rules (as posted in
> the guidelines) and the regulars will be glad to help. if you flout the
> rules and expect to be spoon fed you will get what you deserve. most of
> the regulars here are professional coders who donate time here because
> they love perl. your attitude is disrepectful of what they do. and you
> expect all of this and pay nothing as well. go see what redmond will do
> for you for that kind of payment.
>
> uri
>
> --
> Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
> --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
> Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
>
well im just saying that the attitude of many of the "professional" posters here
is generally not very friendly. its seems they tend to scan posts just looking to
scold, not everyone of course but some certainly do. the very same post that was
used in the example was answered be two other people in the same time it took one
person to complain about the post. why dont some people just leave moderating to
the moderators and not answer a post if they cant be helpfull.
------------------------------
Date: Mon, 24 Nov 2003 07:01:50 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: clarification on comment
Message-Id: <x73cce1c81.fsf@mail.sysarch.com>
>>>>> "D" == Default <Default@IO_Error_1011101.xyz> writes:
D> well im just saying that the attitude of many of the "professional"
D> posters here is generally not very friendly. its seems they tend
D> to scan posts just looking to scold, not everyone of course but
D> some certainly do. the very same post that was used in the example
D> was answered be two other people in the same time it took one
D> person to complain about the post. why dont some people just leave
D> moderating to the moderators and not answer a post if they cant be
D> helpfull.
you have not been here long enough to make such a comment. and the
classic answer to you is do it yourself if you want a kinder and gentler
channel. the regulars are not nasty in general but some poster are too
selfish and lazy to appreciate the help. and just giving out answers is
not the function of this group. it is about DISCUSSING perl, not solving
problems for anyone who posts. if you ask questions and show code you
will almost always get reasonable responses. it is those who don't
follow the guidelines who complain about it. wonder why that happens.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 24 Nov 2003 22:25:51 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: clarification on comment
Message-Id: <bpsisi$1s4chk$1@ID-172104.news.uni-berlin.de>
"bbxrider" <bxtrap01@comcast.net> wrote in message
news:lDfwb.215071$mZ5.1626135@attbi_s54...
> i can't know the exact motivation of tintin's comments and if i
> misintrepeted, i regret that.
> the extent and tone of his reply, solely as written, seems to be
questioning
> my right to even ask the question
> it has a sarcastic tone and it seems to be scolding or demeaning, if thats
> all somebody has to say without
> any hint of 'maybe you should try this or read this, etc' then i can only
> assume they have not other motivation
> other than negativity.
The purpose of my comment is that I wouldn't like to claim a piece of code I
found (that isn't peer reviewed) works without fully understanding how it
works.
The reason for this is that unless you provide a wide range of test data to
see if there are any flaws in the code, it's a little difficult to tell how
well it works.
I can't for the life of me comprehend how you managed to take offense at
that and interpret it as scolding, demeaning and sarcastic.
------------------------------
Date: Mon, 24 Nov 2003 17:42:10 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: code structure
Message-Id: <3FC1A842.6080704@yahoo.com>
could this
%info = prepare (%data, $field);
using the same method as you suggested be done
prepare (%data, $field => %info); ?
thanks
------------------------------
Date: Mon, 24 Nov 2003 21:00:36 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: from data file into hash slice
Message-Id: <3FC1D6C4.30009@yahoo.com>
your suggested code works, after running in the rest of the program I
get a little problem which is discriped with the debugger output.
sub selection ($$$);
tie my (%segment), 'Tie::IxHash';
%segment = selection ('/.../file.txt', 3, 2);
sub selection ($$$) {
my ($file, $start, $number) = @_;
tie my (%records), 'Tie::IxHash';
%records = ();
open FH, $file or die $!;
while (<FH>) {
next if $. < $start;
my @fields = split /,/;
$records{ $fields[1] } = [ splice @fields, 2 ];
last if $. == $start + $number -1;
}
close FH or die $!;
}
DB<2> p %segment
key1ARRAY(0x83b7170)key2ARRAY(0x81be8d8)
DB<3> p Dumper %segment
$VAR1 = 'key1';
$VAR2 = [
'v1a',
'v1b',
'v1c',
'v1d',
'v1e
'
];
$VAR3 = 'key2';
$VAR4 = [
'v2a',
'v2b',
'v2c',
'v2d',
'v2e
'
];
DB<4>
prepare (%segment,...);
sub prepare (\%...) {
my ($data, ...) = @_;
foreach my $key ( keys %{$data} ) {
my $line = $data->{$key}[0];
I need the above line to hold v1a,v1b,v1c,v1d,v1e and not just v1a when
I DB<4>p $line
so I need to have
$records{ $fields[1] } = [ splice @fields, 2 ];
from the above code to push @somting.. man this is hard to explain.
------------------------------
Date: Mon, 24 Nov 2003 21:03:52 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: from data file into hash slice
Message-Id: <3FC1D788.1040705@yahoo.com>
I need it to print
DB<3> p Dumper %segment
$VAR1 = 'key1';
$VAR2 = [
'v1a,v1b,v1c,v1d,v1e
'
];
$VAR3 = 'key2';
$VAR4 = [
'v2a,v2b,v2c,v2d,v2e
'
];
DB<4>
------------------------------
Date: 24 Nov 2003 10:27:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: if action do same action plus...
Message-Id: <bpsmdv$g9q$1@mamenchi.zrz.TU-Berlin.DE>
Edo <eddhig22@yahoo.com> wrote in comp.lang.perl.misc:
> A. Sinan Unur wrote:
> > Edo <eddhig22@yahoo.com> wrote in news:3FC0FEED.6020808@yahoo.com:
> >
> >
> >>Hello
> >>not sure if the title is correct but after some reading, I could not
> >>find the answer
> >
> >
> > what is the question?
> >
> >
> >> if ( check( \@arr1, \@arr2 ) > ( sort {$a <=> $b} @top3 )[0]){
> >> push @top3, check (\@arr1, \@arr2);
> >> }
> >>
> >>sub check {
> >> ...
> >> returns a number
> >>}
> >>
> >>thanks
> >
> >
> > you are welcome.
> >
> > Sinan.
>
> sorry, it is check( \@arr1, \@arr2 ) is calculated twice, how to make
> the code more effecient.
Well, that has been answered.
There is a another inefficiency in your code. "( sort {$a <=> $b}
@top3 )[0]" is a horrible way to find a minimum. Use an efficient min
extractor, either from List::Utils, or write one.
If the snippet you posted is part of a loop (it looks a bit as if it
is), note that the minimum doesn't change when you add an element,
since you are making sure new elements aren't smaller. So the minimum
won't change and you can calculate it once before the loop.
Anno
------------------------------
Date: Sun, 23 Nov 2003 23:19:42 -0700
From: Cognition Peon <cenxnfu@rpr.nevmban.rqh>
Subject: IP packet count at regular intervals of time.
Message-Id: <Pine.GSO.4.50.0311232318020.17874-100000@shelltoe.ece.arizona.edu>
Greetings,
I have been trying to write a program to graph live traffic on a network
interface. Tk::Graph has been very helpful to create live graphs.
The important problem, which I am not able to get through or find any good
help is counting all incoming packets at a specified regular interval.
I have used Net::Pcap and Time::HiRes to write the following program to
count interface traffic in 0.5 sec intervals of time.
#!/usr/bin/perl -w
use strict;
use English;
use Net::Pcap;
use Time::HiRes qw (setitimer time ITIMER_REAL);
my($dev, $pcap_t, $err);
$dev = Net::Pcap::lookupdev(\$err);
$pcap_t = Net::Pcap::open_live($dev, 1500, 1, 0, \$err);
my $count = 0;
sub process_pkt {
my ( $user_data, $hdr, $pkt ) = @_;
$count++;
$SIG{ALRM} = sub { print time, " $count\n"; $count = 0 };
setitimer(ITIMER_REAL, 0.5, 0.5);
}
Net::Pcap::loop( $pcap_t, 0, \&process_pkt, "argument");
Net::Pcap::close($pcap_t);
Perl 5.8 installed on my linux is not configured with threads enabled. The
output, as shown below, is generated at irregular intervals of time.
1069646988.25076 3
1069647025.00529 2
1069647031.59172 121
1069647033.06818 7
1069647037.78875 66
Any help or pointers towards a good solution will be greatly appreciated.
Thanks,
Prakash.
--
echo cenxnfu@rpr.nevmban.rqh | perl -pe 'y/A-Za-z/N-ZA-Mn-za-m/'
Sometimes I think the surest sign that intelligent life
exists elsewhere in the universe is that none of it has
tried to contact us. -- Bill Watterson "Calvin and Hobbes"
-------------------------------------
Printed using 100% recycled electrons
------------------------------
Date: Mon, 24 Nov 2003 08:43:41 +0100
From: Carl Cunningham <oh-god-please-dont-spam-me@spamhole.com>
Subject: Mod_perl woes
Message-Id: <BBE7753D.15AD%oh-god-please-dont-spam-me@spamhole.com>
Hi folks,
I'm having a devil of a time with something that should be very easy. I'm
using mod_perl and CGI::Application for some pokey stuff, and my scripts run
just dandy in a CGI environment, but outputs absolutely nothing in my
mod_perl setup.
I'm using:
MacOSX 10.3
Perl 5.8.1 (the standard delivered version)
Mod_perl 1.26 (the standard delivered version)
Apache 1.3.28 (the standard delivered version)
perl -MApache -e 'print $Apache::VERSION' = 1.27
perl -Mmod_perl -e 'print $mod_perl::VERSION' = 1.26
perl -MCGI -e 'print $CGI::VERSION' = 3.00
Here's my Apache::Registry Configuration out of the httd.conf
> PerlModule Apache::Registry
> <Location /registry>
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options +ExecCGI
> </Location>
Now this is where it gets weird. Following script works dandy:
> my $r = Apache->request;
> $r->content_type("text/html");
> $r->send_http_header;
> $r->print("Hi There!");
But this script only generates output in a CGI environment:
> use strict ;
> use CGI ;
> my($q) = new CGI ;
> print $q->header,
> $q->start_html('hello world'),
> $q->h1('hello world'),
> $q->end_html;
????
--
Carl K. Cunningham
Robertsī interactive GmbH
E-Mail: initials of first and last name, at 'roberts' dot 'de'
----------------------------------------------------------------------------
------------------------------
Date: Mon, 24 Nov 2003 08:03:05 GMT
From: Default@IO_Error_1011101.xyz
Subject: Re: Mod_perl woes
Message-Id: <ZWiwb.8186$rS5.5858@nwrdny02.gnilink.net>
> But this script only generates output in a CGI environment:
>
> > use strict ;
> > use CGI ;
> > my($q) = new CGI ;
> > print $q->header,
> > $q->start_html('hello world'),
> > $q->h1('hello world'),
> > $q->end_html;
>
>
> ????
well im not sure as ive never made a cgi.
use CGI qw(:standard);
that could be the thing you need for that. its something called 'import tags'.
------------------------------
Date: 24 Nov 2003 08:39:52 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Mod_perl woes
Message-Id: <bpsg4o$a3n$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Default@IO_Error_1011101.xyz:
>> But this script only generates output in a CGI environment:
>>
>> > use strict ;
>> > use CGI ;
>> > my($q) = new CGI ;
>> > print $q->header,
>> > $q->start_html('hello world'),
>> > $q->h1('hello world'),
>> > $q->end_html;
>>
>>
>> ????
> well im not sure as ive never made a cgi.
>
> use CGI qw(:standard);
>
> that could be the thing you need for that. its something called 'import tags'.
That's a bit of a wild guess. Import tags bundle up a number of
functions (or more generally: symbols) so that they can be imported in
one go. The OP however doesn't use the function-oriented interface of
CGI.pm. He chose the object-oriented approach which makes importing
obsolete.
Therefore, this is very probably not the cause for his problems.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 24 Nov 2003 10:01:52 +0100
From: Carl Cunningham <oh-god-please-dont-spam-me@spamhole.com>
Subject: Re: Mod_perl woes
Message-Id: <BBE78790.15B5%oh-god-please-dont-spam-me@spamhole.com>
in Beitrag bpsg4o$a3n$1@nets3.rz.RWTH-Aachen.DE schrieb Tassilo v. Parseval
unter tassilo.parseval@rwth-aachen.de am 24.11.2003 9:39 Uhr:
> The OP however doesn't use the function-oriented interface of
> CGI.pm. He chose the object-oriented approach which makes importing
> obsolete.
>
> Therefore, this is very probably not the cause for his problems.
I've had plain vanilla scripts with CGI.pm running under mod_perl (Registry)
before, and I don't seem to remember any kind of problems with that
combination. I'm thinking that I may have some funky installation conflicts,
but I'd like to rule out stupid mistakes on my side ("operator headspace and
timing") before I start to disembowel my installation.
--
Carl K. Cunningham
Robertsī interactive GmbH
E-Mail: initials of first and last name, at 'roberts' dot 'de'
----------------------------------------------------------------------------
------------------------------
Date: Mon, 24 Nov 2003 09:26:31 GMT
From: Default@IO_Error_1011101.xyz
Subject: Re: Mod_perl woes
Message-Id: <b9kwb.12910$yy5.10072@nwrdny01.gnilink.net>
> Also sprach Default@IO_Error_1011101.xyz:
>
> >> But this script only generates output in a CGI environment:
> >>
> >> > use strict ;
> >> > use CGI ;
> >> > my($q) = new CGI ;
> >> > print $q->header,
> >> > $q->start_html('hello world'),
> >> > $q->h1('hello world'),
> >> > $q->end_html;
> >>
> >>
> >> ????
> > well im not sure as ive never made a cgi.
> >
> > use CGI qw(:standard);
> >
> > that could be the thing you need for that. its something called 'import tags'.
>
> That's a bit of a wild guess. Import tags bundle up a number of
> functions (or more generally: symbols) so that they can be imported in
> one go. The OP however doesn't use the function-oriented interface of
> CGI.pm. He chose the object-oriented approach which makes importing
> obsolete.
>
> Therefore, this is very probably not the cause for his problems.
>
> Tassilo
> --
> $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
> pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
> $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
>
nod you are most likely right, i did a bit of testing on the code itself.
C:\Perl>type testcgi.plx
use strict ;
use CGI ;
my($q) = new CGI ;
print $q->header,
$q->start_html('hello world'),
$q->h1('hello world'),
$q->end_html;
C:\Perl>testcgi.plx >testcgi.html
C:\Perl>
then i opened testcgi.html in a browser and it worked fine.
------------------------------
Date: 24 Nov 2003 01:48:17 -0800
From: awilhite@cableone.net (Andrew)
Subject: Re: Newbie Question: Best way to Extract Post Hashes?
Message-Id: <9b7dcecd.0311240148.1ce72a0b@posting.google.com>
Juha Laiho <Juha.Laiho@iki.fi> wrote in message news:<bpr0ri$k4v$1@ichaos.ichaos-int>...
> "Eric J. Roode" <REMOVEsdnCAPS@comcast.net> said:
> >awilhite@cableone.net (Andrew) wrote in news:9b7dcecd.0311211429.3c7a7735@posting.google.com:
> >> I am a Perl newbie and I was wondering if anyone could tell me the
> >> best way to extract expected post keys and values from websites?
> [...]
> >I have been a web programmer for eight years, and I have no clue what you
> >mean by "expected post keys and values". Can you give some more details
> >about what you are trying to do?
>
> For some reason his wording made slight problems for me as well, but
> what he apparently wants to write is software that:
> - downloads a HTML form
> - parses the form to determine which fill-in elements it contains
> - somehow generate data for those elements
> - submits the filled-in form appropriately
>
> Now, the hard parts here are
> - to determine what data is requested by the form
> - what are the allowable values for free-text fields
> - what all can be filled in to the form, if it happens to be something
> that is partially generated by client-side technologies while the user
> is filling it
Hello All,
Sorry about the confusion in my wording. What I was looking for tips
on how to automatically detect all necessary post values the form is
expecting. For example, When I look at the source code for
my.yahoo.com, there are several hidden attributes that it is
requesting aside form the obvious username and password fields. I was
wondering if anyone knew of a module that could help identify these
hidden values.
Thanks for the idea of checking out the CGI module. I havent used
that module yet and I am unaware of what it contains. I will check
out the perldocs on that.
------------------------------
Date: Mon, 24 Nov 2003 11:45:56 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: newbie regular expression questions
Message-Id: <bpsnts$1psfvg$1@ID-184292.news.uni-berlin.de>
Sam Holden wrote:
> Malcolm Dew-Jones wrote:
>> Tintin wrote:
>>> bbxrider wrote:
>>>>
>>>> $name=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
>>>> $value=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
>>>>
>>>> i know it works but the data is ascii characters to begin
>>>> with and don't understand what is the need for the
>>>> substitution
>>>> ...
>>>> don't understand significance of the % sign,
>>>> not really sure what the {2} grouping is doing
>>>
>>> Do you really [know that it works]? How do you know it works
>>> if you don't fully understand the code?
>>
>> I know my car works, but I don't fully understand it.
>
> Only because your car was designed and built by people you trust
> did it correctly, complying with relevant safety and operating
> standards. And it hasn't failed any of the tests you have tried
> with it.
>
> Would you trust a car I built out of cardboard and rubberbands?
> What if it drove around the block once without any problems?
>
>> I know my java compiler works but I understand that much less.
>
> Only because you trust the author of the compiler understood how it
> works and that it hasn't failed to produce correct output yet.
>
>> I haven't looked at the internal details of CGI.PM in ages, I
>> don't remember most of its documentation, I forget the _exact_
>> significance of the qw(:standard) that I prefer over the object
>> interface, I have never bothered to figured out certain features
>> that I haven't found the need to use based on a high level
>> description - but never the less I am pretty sure it works, and
>> would certainly recommend it over the above code which I think I
>> do understand pretty well.
>
> Only because it has been widely tested and found to work.
>
> Whereas code which has been "found" shouldn't be so trusted, and
> hence without understanding the code you can't declare that "i know
> it works". If other people who do understand how it works have
> declared that "it works" then you could make such a declaration, if
> you trust their judgement and knowledge.
>
> If the code was written by someone you trust it's a different
> story, but if it is code randomly found on the internet that
> usually isn't the case.
You chose to focus on that "i know it works" statement.
At the same time it's worth noticing that OP did not address the
question whether to use CGI.pm or not. He asked for help to understand
a particular aspect of CGI. He showed an interest in learning. Your
choosen way to respond discourages people who attempts to understand
CGI. That's bad.
Shouldn't you better encourage people who deal with CGI to learn about
its implications? You _can_ do that and _still_ advice them to use CGI.pm.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 23 Nov 2003 23:06:23 -0800
From: kielhd@freenet.de (kielhd)
Subject: Performance problem on SunOS 5.8
Message-Id: <10a4173d.0311232306.2648e882@posting.google.com>
Hi NG,
I am running a script doing some calculations on a SunOS box. It takes
about 11hrs to finish.
When running the same script on WinNT, it takes only 7min!
I was very surprised about WinNT being app. 100 times faster then
SunOS and compared the results. The results are the same, so the
script is working well on both machines.
I am using perl v5.8.0 and the module Net::Netmask on both machines.
Could somebody please explain this to me or - even better - give me a
hint of how to improve the performance on SunOS.
Best rgds from rainy germany
Henning
------------------------------
Date: Mon, 24 Nov 2003 07:10:22 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Performance problem on SunOS 5.8
Message-Id: <x7wu9qz1gh.fsf@mail.sysarch.com>
>>>>> "k" == kielhd <kielhd@freenet.de> writes:
k> I am running a script doing some calculations on a SunOS box. It takes
k> about 11hrs to finish.
k> When running the same script on WinNT, it takes only 7min!
that makes little sense.
k> Could somebody please explain this to me or - even better - give me a
k> hint of how to improve the performance on SunOS.
delete line 42. it is the slow one.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 24 Nov 2003 22:28:16 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: Performance problem on SunOS 5.8
Message-Id: <bpsj13$1rq6ee$1@ID-172104.news.uni-berlin.de>
"kielhd" <kielhd@freenet.de> wrote in message
news:10a4173d.0311232306.2648e882@posting.google.com...
> Hi NG,
> I am running a script doing some calculations on a SunOS box. It takes
> about 11hrs to finish.
> When running the same script on WinNT, it takes only 7min!
> I was very surprised about WinNT being app. 100 times faster then
> SunOS and compared the results. The results are the same, so the
> script is working well on both machines.
> I am using perl v5.8.0 and the module Net::Netmask on both machines.
>
> Could somebody please explain this to me or - even better - give me a
> hint of how to improve the performance on SunOS.
Invoking the devine ESP function of Perl......
Are you doing any DNS lookups at all?
If not, how do you seriously expect anyone to have an idea without showing
any code or snippet.
------------------------------
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 5850
***************************************