[16070] in Perl-Users-Digest
Perl-Users Digest, Issue: 3482 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 26 14:05:41 2000
Date: Mon, 26 Jun 2000 11:05:18 -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: <962042717-v9-i3482@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 26 Jun 2000 Volume: 9 Number: 3482
Today's topics:
Re: Can mod_perl pooled db connections be attached to h kwiateks@juno.com
Cgi counter script problem g1574@my-deja.com
Re: CGI::Carp cluck abbreviating msgs? <hmerrill@my-deja.com>
Re: Changing Case Continued! <rootbeer@redcat.com>
Re: Changing case in a file! <flavell@mail.cern.ch>
Re: defined() <uri@sysarch.com>
Re: defined() <abe@ztreet.demon.nl>
Re: defined() (Eric Bohlman)
Re: Forcing unbuffered stdout from command line? <db3l@fitlinxx.com>
Re: help with forms <raphaelp@nr1webresource.com>
Re: help with forms <thomastk@my-deja.com>
Re: HLP: SDBM_File problem concering element length <craiger316@visi.com>
Re: How is a unique sort done? Like unix "sort -u" <aqumsieh@hyperchip.com>
Re: indentifying country origin using perl?? (Abigail)
Install make test proble perl 5.6 zephar@my-deja.com
Is SymLink broken? It won't take scalars raincloudstudios@my-deja.com
Re: Know of any good perl books? (David H. Adler)
Re: matching question (http related) <tina@streetmail.com>
Re: matching question (http related) <tina@streetmail.com>
Re: matching question (http related) <godzilla@stomp.stomp.tokyo>
Re: matching question (http related) <care227@attglobal.net>
Re: matching question (http related) <godzilla@stomp.stomp.tokyo>
Re: matching question (http related) <godzilla@stomp.stomp.tokyo>
Re: matching question (http related) <tina@streetmail.com>
Re: matching question (http related) <godzilla@stomp.stomp.tokyo>
Re: matching question (http related) <ralawrence@my-deja.com>
Need Perl Programmer <Dupont@netcomuk.co.uk>
Number of Unique Values <cghansen@micron.com>
running unix commands in CGI <ifalc@students.cs.mu.OZ.AU>
Re: running unix commands in CGI newsposter@cthulhu.demon.nl
Re: Server push problem <thomastk@my-deja.com>
single quote string question <hillr@ugsolutions.com>
split question <skpurcell@hotmail.com>
Re: split question <samay1NOsaSPAM@hotmail.com.invalid>
Re: Teen Volenteers WANTED (Abigail)
Telnet.pm module <thomastk@hotmail.com>
Re: User's details <raphaelp@nr1webresource.com>
Re: User's details <raphaelp@nr1webresource.com>
Re: User's details <raphaelp@nr1webresource.com>
Zlib.pm and perl2exe <thommy-p@bigfoot.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 Jun 2000 17:11:37 GMT
From: kwiateks@juno.com
Subject: Re: Can mod_perl pooled db connections be attached to http session?
Message-Id: <8j82ro$jtt$1@nnrp1.deja.com>
To prevent dirty reads from my web apps....
If each http requests draws a different db connection, then the
database can not "select rows for update" and hold the lock on the rows
across http requests...
Keith
In article <brian-2606000018280001@212.sanjose-11-12rs16rt.ca.dial-
access.att.net>,
brian@smithrenaud.com (brian d foy) wrote:
> In article <8j2m46$36$1@nnrp1.deja.com>, kwiateks@juno.com wrote:
>
> >Does anyone have resources for perl code that will pool db
> >(oracle) connections and allow me to attach the connection handle to
one
> >(and only one) http user session?
>
> i suppose that you could hack Apache::DBI to do such a thing, but
> why would you want to?
>
> --
> brian d foy
> Perl Mongers <URI:http://www.perl.org>
> CGI MetaFAQ
> <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 16:39:19 GMT
From: g1574@my-deja.com
Subject: Cgi counter script problem
Message-Id: <8j80vk$icn$1@nnrp1.deja.com>
I wrote a cgi script in perl to track access to pages on my a website I
run. It usually works fine, but for no apparent reason, the counter
file regularly gets cleared, about every 200-300 hits on the main page
(once every week or two). The script is running on an linux/apache
server, but I test the script at home with an almost identical
configuration, and have never had any problems. Innitially I didn't
have file locking so I thought that that was the problem, but when I
added it, the problem continued. Any ideas as to the nature of the
problem?
#opens and increments the correct counter field in a file in the format
below
# front::links::index
# 10::2::8
if(open(COUNT, "<./data/count.dat")) {
flock (COUNT, 2);
#assign the first and second lines of the file to the array $line
for ($i =0; $i < 3; $i++){
$line[$i] = <COUNT>;
$line[$i] =~ s/\n$//; #evaluate regular expression ?(to look for
line ending)?
}
#split each line at the delimiter "::" and assign records to arrays
@page = split("::", $line[0]);
@count = split("::", $line[1]);
flock(COUNT, 8);
close(COUNT);
#find the index position of the page and break the loop
for($i=0; $i <= $#page; $i++) {
if($page[$i] eq $basename) {
$count_found = $i;
last;
}
}
#increment the counter if the page exists, otherwise create and set
the count to 0
if($page[$i]) { $count[$count_found]++; }
else {
push(@page, $basename);
push(@count, 0);
}
#open the file for output and dump the arrays to it
if(open(COUNT, ">./data/count.dat")) {
flock(COUNT, 2);
print COUNT join("::", @page), "\n";
print COUNT join("::", @count), "\n";
flock(COUNT, 8);
close(COUNT);
}
else { print "Cannot write to counter file"; }
}
else { print "Cannot read from counter
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 17:50:24 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: CGI::Carp cluck abbreviating msgs?
Message-Id: <8j854p$lqi$1@nnrp1.deja.com>
In article
<Pine.GSO.4.10.10006221319200.4312-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Thu, 22 Jun 2000, Hardy Merrill wrote:
>
> > I'm using "cluck" because I want to get a stacktrace when an error
> > occurs. Some of the messages that I "cluck" are lengthy, and it
seems
> > like cluck is abbreviating them, so that my full helpful text is
being
> > truncated like "here's some useful text..." with the "..." at the
end of
> > the message, where there should be more text.
>
> I can't see how that could be happening. Could you make a small,
> self-contained example program which shows what you mean? Thanks!
You were right - the message wasn't being truncated, but what I figured
out was that if you have parameters passed to subroutines that have long
values, sometimes those long values get truncated by cluck. I created
this test script to test cluck:
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(cluck);
sub c {
my $msg = shift;
cluck $msg;
} ### end sub c
sub b {
my $msg = "Sub b: Here's a really long message from Subroutine "
. "\"b\" that might get abbreviated, but I'm not sure.
" . "That's why I'm writing this long error message.";
c($msg);
} ### end sub b
sub a {
b("wallace", "grommet");
} ### end sub a
### Main ###
a("one", "two", "three");
And here's the output from running that script:
[Mon Jun 26 13:46:24 2000] perl_cluck.pl: Sub b: Here's a really long
message from Subroutine "b" that might get abbreviated, but I'm not
sure. That's why I'm writing this long error message. at
./perl_cluck.pl line 8
[Mon Jun 26 13:46:24 2000] perl_cluck.pl: main::c('Sub b: Here\'s
a really long message from Subroutine "b" that mi...') called at
./perl_cluck.pl line 15
[Mon Jun 26 13:46:24 2000] perl_cluck.pl: main::b('wallace',
'grommet') called at ./perl_cluck.pl line 19
[Mon Jun 26 13:46:24 2000] perl_cluck.pl: main::a('one', 'two',
'three') called at ./perl_cluck.pl line 23
Thanks Tom.
--
Hardy Merrill
Mission Critical Linux
http://www.missioncriticallinux.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 08:27:18 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Changing Case Continued!
Message-Id: <Pine.GSO.4.10.10006260826140.23149-100000@user2.teleport.com>
On Mon, 26 Jun 2000, Horse Nuts wrote:
> Newsgroups: comp.lang.perl.misc
> Subject: Changing Case Continued!
It's better to continue an existing thread rather than to start a new one,
when you're not changing topics.
> <TR><TD><a href="HTTP://XXX.COM/~XX">XXXX</a></td><TD>ALAN
> I would like to change ONLY the URL to lower case in the entire file,
> this file could have 100's of entries...
See HTML::Parser, and my response to your previous question. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jun 2000 18:00:17 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Changing case in a file!
Message-Id: <Pine.GHP.4.21.0006261756170.6153-100000@hpplus03.cern.ch>
On Mon, 26 Jun 2000, Tom Phoenix wrote:
> Of course, URLs are, in general, case sensitive,
This topic is quite widely misunderstood, so excuse me for stepping in
with an attempt at clarification here.
URLs are by definition case sensitive. Aside from the degenerate case
of a URL that doesn't contain any case-sensitive characters, there are
various heroic measures that can be adopted (and often are adopted,
specifically by PoBs) to hide the case-sensitivity, but none of them
is without deleterious consequences.
--
------------------------------
Date: Mon, 26 Jun 2000 15:09:34 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: defined()
Message-Id: <x7r99ktr6a.fsf@home.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
TM> On 26 Jun 2000 11:56:37 +0200, Jakob Schmidt <sumus@aut.dk> wrote:
>> bart.lateur@skynet.be (Bart Lateur) writes:
>>
>>> The "defined" test is built-in. [...]
>>
>> That's what I found out :-)
TM> I spent a few minutes trying to find that in the PODs.
TM> Where is that discussed in the standard docs?
it was tricky finding it. it is a property of while so i found it in
perlsyn (5.005_03):
while (<>) {
chomp;
if (s/\\$//) {
$_ .= <>;
redo unless eof();
}
# now process $_
}
which is Perl short-hand for the more explicitly written
version:
LINE: while (defined($line = <ARGV>)) {
chomp($line);
if ($line =~ s/\\$//) {
$line .= <ARGV>;
redo LINE unless eof(); # not eof(ARGV)!
}
# now process $line
}
no text explaining the defined stuff there.
and in perlop under <> there is:
If and ONLY if the input symbol is the only thing
inside the conditional of a while or for(;;) loop, the value
is automatically assigned to the variable $_. In these loop
constructs, the assigned value (whether assignment is
automatic or explicit) is then tested to see if it is
defined. The defined test avoids problems where line has a
string value that would be treated as false by perl e.g. ""
or "0" with no trailing newline.
note that the comment in parens says the defined happens also with
while( $line = <FOO> ) {
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 26 Jun 2000 17:23:30 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: defined()
Message-Id: <srselso5i2mhsncliuebbifn5igp7malgf@4ax.com>
On Mon, 26 Jun 2000 09:34:32 -0400, tadmc@metronet.com (Tad McClellan)
wrote:
> On 26 Jun 2000 11:56:37 +0200, Jakob Schmidt <sumus@aut.dk> wrote:
> >bart.lateur@skynet.be (Bart Lateur) writes:
> >
> >> The "defined" test is built-in. [...]
> >
> >That's what I found out :-)
>
>
> I spent a few minutes trying to find that in the PODs.
>
>
> Where is that discussed in the standard docs?
In perlop, section 'I/O Operators'. Seems like the text was rearranged
in the 5.6.0 docs to make it stand out more:
In these loop constructs, the assigned value (whether assignment is
automatic or explicit) is then tested to see whether it is defined.
The defined test avoids problems where line has a string value that
would be treated as false by Perl, for example a "" or a "0" with no
trailing newline. If you really mean for such values to terminate
the loop, they should be tested for explicitly: ...
--
Good luck,
Abe
------------------------------
Date: 26 Jun 2000 16:23:58 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: defined()
Message-Id: <8j802u$sv7$2@slb7.atl.mindspring.net>
Bart Lateur (bart.lateur@skynet.be) wrote:
: This whole discussion is (partly?) obsolete. From 5.005 on, the magic
: while(<HANDLE>) thing has been changed to mean
:
: while(defined($_ = <HANDLE>) ) { ... }
:
: The "defined" test is built-in. If you want to see the flaw in action,
: use an older perl.
It's meant that for longer than I can remember. Nothing new in 5.005.
:
: BUT: I'm not sure if this magic works if you explicitely assign to a
: variable. Test it again with:
*That's* what changed in 5.005 (5.004 introduced a warning for such a
construct).
------------------------------
Date: 26 Jun 2000 12:53:56 -0400
From: David Bolen <db3l@fitlinxx.com>
Subject: Re: Forcing unbuffered stdout from command line?
Message-Id: <uhfag2xjv.fsf@ctwd0143.fitlinxx.com>
nobull@mail.com writes:
> David Bolen <db3l@fitlinxx.com> writes:
>
> > Does anyone know of a method to tell perl to treat stdout as an
> > interactive TTY even if it might otherwise think it wasn't?
> >
> > I'm trying to take a system of scripts (which call each other in
> > several levels) and wrap them within a master script that traps all of
> > their normal output. The idea is to leave the existing system
> > untouched, but just wrap it so I can get access to the normal stdout
>
> Without modifying the script? Well I guess you could put a -M switch
> on the command line that loads a module that just does "$|=1".
Hmm, that's an interesting idea, but does that only get loaded in
advance of my first script? If so, then the further child scripts
(the system is sort of a tree of scripts) would still be buffered,
since the flush change doesn't get inherited.
The problem with modifying is that there are a _lot_ of scripts and
I'm just trying to add some debugging to the existing system without
going in there and changing everything (even with just a simple single
flush line).
> Alternatively use a PTY rather than a FIFO.
>
> I believe the Expect module will help with this.
Unfortunately, this is NT, so I don't think I really have a choice
outside of standard pipes. But a PTY behavior is sort of what I'm
looking for - I guess I was hoping for some option (something like
"-i" on shells) that would force that interpretation even if
stdin/stdout didn't really look like a TTY/PTY.
Thanks though.
--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l@fitlinxx.com /
| FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/
------------------------------
Date: Mon, 26 Jun 2000 19:10:44 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: help with forms
Message-Id: <8j835f$2f9$17$1@news.t-online.com>
try www.whiz-mail.com which gives you options on how to customize your
output...
Andy Barlow <andybarlow70NOanSPAM@hotmail.com.invalid> wrote in message
news:34a9e596.e61be555@usw-ex0104-032.remarq.com...
> Can anyone tell me the best way to have the info a customer
> inputs on to my page to be sent to me, without them having to
> read what they've sent.
>
> I currently use FormMail.pl which shows the customer what
> they've input in a very scrappy format. Does anyone know of a
> simple, but more effective method?
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
------------------------------
Date: Mon, 26 Jun 2000 16:28:33 GMT
From: thoma <thomastk@my-deja.com>
Subject: Re: help with forms
Message-Id: <8j80ar$ht5$1@nnrp1.deja.com>
Are you looking for code? You can do this by writing your own cgi, I
guess.
In article <34a9e596.e61be555@usw-ex0104-032.remarq.com>,
Andy Barlow <andybarlow70NOanSPAM@hotmail.com.invalid> wrote:
> Can anyone tell me the best way to have the info a customer
> inputs on to my page to be sent to me, without them having to
> read what they've sent.
>
> I currently use FormMail.pl which shows the customer what
> they've input in a very scrappy format. Does anyone know of a
> simple, but more effective method?
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 11:59:23 -0500
From: "Craig Tataryn" <craiger316@visi.com>
Subject: Re: HLP: SDBM_File problem concering element length
Message-Id: <TSL55.1728$iN5.350812@ptah.visi.com>
Thanks Tom,
I'm using ActiveState perl for Win32. DB_File doesn't seem to ship with it.
Does anyone know how to install DB_File modules for Win32 w/Active state
perl?
Thanks again,
Craig.
--
Craig W. Tataryn
Senior Staff Analyst (BSc.Cs., MCP)
Compuware Professional Services
Bloomington, MN
Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.10006260707040.23149-100000@user2.teleport.com...
> On Mon, 26 Jun 2000, Craig Tataryn wrote:
>
> > On the line where I set %tiedDB = %DBMdb my script dies. It only dies
> > when an element in the DBMdb hash is rather long
>
> > I was wondering if anyone knows if there is a limit to the size of
> > hash elements being saved using this method, and if there is, is there
> > a work around?
>
> Use a different DBM implementation, or rebuild the one you're using with
> a different maximum data size, if that's possible. Hope this helps!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Mon, 26 Jun 2000 16:33:54 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: How is a unique sort done? Like unix "sort -u"
Message-Id: <7awvjce70s.fsf@merlin.hyperchip.com>
Jakob Schmidt <sumus@aut.dk> writes:
> "Robert Chalmers" <robert@chalmers.com.au> writes:
>
> > How do I make a sort do a unique sort ??? this is a real mystery...
>
> The kernel of the problem is how to get an array of uniques. When
> you've got that simply sort it.
>
> This is a FAQ item:
>
> perldoc -q unique
Yep.
> - but actually I think I have a better answer than (my local version of) the
> FAQ for this case:
>
> my %h; # this is just to make sure %h is not already in use
> @h{ @newdom } = (); # this assigns undef to each value in the hash %h
> # now use keys( %h ) as source for your sort
Nope. It's in the FAQ (since at least 5.004):
d) A way to do (b) without any loops or greps:
undef %saw;
@saw{@in} = ();
@out = sort keys %saw; # remove sort if undesired
--Ala
------------------------------
Date: 26 Jun 2000 13:47:55 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: indentifying country origin using perl??
Message-Id: <slrn8lf6s9.ka1.abigail@alexandra.delanet.com>
dagolfmasta (janneNOjaSPAM@funplanet.com.invalid) wrote on MMCDXCI
September MCMXCIII in <URL:news:0146ce5a.6fe64e71@usw-ex0108-062.remarq.com>:
}} Is it possible to determine the origin of somebody browsing
}} my pages?
No. But that's on a Perl issue.
}} How can I access the IP-adress of the html-page that is
}} calling my scripts?
That depends on your server and what kind of protocols it uses.
It's not a Perl issue. Use a group that deals with whatever
protocol you use.
}} Through the IP-adress I could determine
}} country origin because I have different sites for different
}} countries.
No, you cannot.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Mon, 26 Jun 2000 15:47:21 GMT
From: zephar@my-deja.com
Subject: Install make test proble perl 5.6
Message-Id: <8j7tu2$g0u$1@nnrp1.deja.com>
I have been installing modules for perl 5.6
and have been intermittantly getting the following
error message on a few modules when i do the
"make test" step
Test returned status 2 (wstat 512, 0x200)
FAILED--1 test script could be run, alas--no output ever seen
*** Error code 2
make: Fatal error: Command failed for target `test_dynamic'
I go on to do the make install
and it never appears to be a problem but can anyone tell
me what the problem is and how to fix it. I have never
seen it before in module installs in 5.004 or 5.005.
Some modules it does it for are
NIS-a2, grepmail-4.40, Time-HiRes-01.20
Thanks in advance,
Jim
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 17:44:04 GMT
From: raincloudstudios@my-deja.com
Subject: Is SymLink broken? It won't take scalars
Message-Id: <8j84p5$vkc$1@nnrp2.deja.com>
I'm at a loss. I can hard code directories and
files in a symlink and they are created as
expected...
my $results = symlink
('/u/web/raincl/hidden/special/image.gif','/u/web/
raincl/1234-12345678/image.gif');
however if I try to pass it a couple of scalars
such as...
$oldfile
= "/u/web/raincl/hidden/special/image.gif";
$newfile = "/u/web/raincl/1234-
12345678/image.gif";
my $results = symlink($oldfile,$newfile);
Results gives me a 0 and the $! is No such file
or directory.
Baffling! Is there a workaround? My solution
requires passing scalars as the files will not be
known ahead of time.
Thanks!
CT
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 Jun 2000 17:23:09 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Know of any good perl books?
Message-Id: <slrn8lf4bt.r0g.dha@panix2.panix.com>
On Mon, 26 Jun 2000 09:52:29 -0400, Drew Simonis <care227@attglobal.net> wrote:
>"David H. Adler" wrote:
>>
>> >
>> >Thanks to the powers that be that Mr. Schwartz is not as picky as
>> >a certain monospaced font/no mixed case/no punctuation after the d
>> >personage known to pass by this way =)
>>
>> The d is also silent...
>>
>> ><duck>
>>
>> ...aiming low to compensate. :_)
>>
>> dha
>>
>
>How the heck is the d silent??!?!?
RTFM: http://www.brian-d-foy.com/style.html
:-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"There is a thin line between genius and insanity - I have erased that
line." - Oscar Levant
------------------------------
Date: 26 Jun 2000 15:57:10 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: matching question (http related)
Message-Id: <8j7ugm$13s$2@ID-24002.news.cis.dfn.de>
hi,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Tina Mueller wrote:
>> > $_ =~ s/.+\///g;
>
>> why the /g? .+ is greedy, so it will match exactly once.
>> no need for the global match.
> Beats me. It is not my code. This is another's
> code sample. Ask him.
well, but you copied the code. you should not
copy a solution without thinking what it actually does.
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."
------------------------------
Date: 26 Jun 2000 16:01:58 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: matching question (http related)
Message-Id: <8j7upm$13s$3@ID-24002.news.cis.dfn.de>
hi,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Tina Mueller wrote:
>> > $_ =~ s/.+\///g;
>
>> why the /g? .+ is greedy, so it will match exactly once.
>> no need for the global match.
> Beats me. It is not my code. This is another's
> code sample. Ask him.
me again. you could've answered, the global match
can be useful if the string contains not only one
string but more lines, each with a string with "/"'s
in it. then /g is useful.
i think you just can't admit that sometimes
others have better solutions than you.
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."
------------------------------
Date: Mon, 26 Jun 2000 09:33:23 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: matching question (http related)
Message-Id: <395785D3.5FF19E@stomp.stomp.tokyo>
Tina Mueller wrote:
> > Beats me. It is not my code. This is another's
> > code sample. Ask him.
> well, but you copied the code. you should not
> copy a solution without thinking what it actually does.
Yeah.. ok, sure...
* scratches her noggin *
Hmm... well, perhaps Ms. Mueller truly
believes she is making good sense.
Godzilla!
------------------------------
Date: Mon, 26 Jun 2000 12:37:05 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: matching question (http related)
Message-Id: <395786B1.2A1F1A51@attglobal.net>
"Godzilla!" wrote:
>
> Tina Mueller wrote:
>
> > well, but you copied the code. you should not
> > copy a solution without thinking what it actually does.
>
>
> Hmm... well, perhaps Ms. Mueller truly
> believes she is making good sense.
Are you implying that it is better to just copy and use code for which
you have no understanding?
Wait... I've read your posts. It seems thats exactly what you do.
------------------------------
Date: Mon, 26 Jun 2000 09:40:59 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: matching question (http related)
Message-Id: <3957879B.214AA46A@stomp.stomp.tokyo>
Tina Mueller wrote:
> Godzilla! wrote:
> > Tina Mueller wrote:
> >> > $_ =~ s/.+\///g;
> >> why the /g? .+ is greedy, so it will match exactly once.
> >> no need for the global match.
> > Beats me. It is not my code. This is another's
> > code sample. Ask him.
> me again.
Really? I thought for sure you were someone else.
> you could've answered,
What was the question?
> the global match can be useful if the string contains
> not only one string but more lines, each with a string
> with "/"'s in it. then /g is useful.
Ok. Glad you are straight on this. What does this
have to do with my code and myself? Kinda suspect
you are addressing the wrong person, and apparently
you are not quite sure you are you.
> i think you just can't admit that sometimes
> others have better solutions than you.
Sometimes others have better solutions than me.
Stay out of the sun today, ok? Too much sun
can broil your brains.
Godzilla!
------------------------------
Date: Mon, 26 Jun 2000 09:43:20 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: matching question (http related)
Message-Id: <39578828.81E8B9BE@stomp.stomp.tokyo>
Drew Simonis wrote:
> "Godzilla!" wrote:
> > Tina Mueller wrote:
> > > well, but you copied the code. you should not
> > > copy a solution without thinking what it actually does.
> > Hmm... well, perhaps Ms. Mueller truly
> > believes she is making good sense.
> Are you implying that it is better to just copy
> and use code for which you have no understanding?
> Wait... I've read your posts. It seems thats exactly what you do.
Is that you Ms. Mueller?
Godzilla!
------------------------------
Date: 26 Jun 2000 16:49:35 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: matching question (http related)
Message-Id: <8j81iv$13s$4@ID-24002.news.cis.dfn.de>
hi,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Tina Mueller wrote:
>> Godzilla! wrote:
>> > Tina Mueller wrote:
>> you could've answered,
> What was the question?
here it is:
>> >> why the /g? .+ is greedy, so it will match exactly once.
>> >> no need for the global match.
> Ok. Glad you are straight on this. What does this
> have to do with my code and myself? Kinda suspect
> you are addressing the wrong person, and apparently
> you are not quite sure you are you.
see my other posting *sigh*
>> i think you just can't admit that sometimes
>> others have better solutions than you.
> Sometimes others have better solutions than me.
wow! all the people out there, mark this in your
calendar!! very brave of you,
godzilla-perl-girl-or-whatever-i-should-call-you
(hm, you may be the first candidate for my killfile,
be proud of it)
> Stay out of the sun today, ok? Too much sun
> can broil your brains.
look who's talking, eh?
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."
------------------------------
Date: Mon, 26 Jun 2000 09:58:40 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: matching question (http related)
Message-Id: <39578BC0.4B807541@stomp.stomp.tokyo>
Tina Mueller wrote:
>
> hi,
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > Tina Mueller wrote:
> >> Godzilla! wrote:
> >> > Tina Mueller wrote:
> >> you could've answered,
> > What was the question?
> here it is:
> >> >> why the /g? .+ is greedy, so it will match exactly once.
> >> >> no need for the global match.
Why are you asking me? It is not my code.
It is another's code as I have stated before.
Ask him. I am not an internet mind reader.
Fix your headers. You forgot to do this
when you switched personas. This is not
news@tinita.de ya know.
Godzilla!
------------------------------
Date: Mon, 26 Jun 2000 16:18:32 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: matching question (http related)
Message-Id: <8j7vo5$hfd$1@nnrp1.deja.com>
In article <3956D923.8EFEFBBF@stomp.stomp.tokyo>,
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> Don't ya just get annoyed with English
> teachers who have high expectations and
> expect people to afford effort and work?
For a supposed English teacher you don't half waffle. Most of your
replied seem to be about 20% relevant and the rest absolutely useless
(like references to your robots for example).
Rich.
ps. Your spelling isn't up to much either at times.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 18:13:52 +0100
From: "Robert Dupont" <Dupont@netcomuk.co.uk>
Subject: Need Perl Programmer
Message-Id: <8j82to$jev$1@taliesin2.netcom.net.uk>
Dear Anyone
Need a Perl programmer in the UK for a little work with forms on our web
site.
Please leave your name and telephone number
Regards
Robert
------------------------------
Date: Mon, 26 Jun 2000 11:02:39 -0600
From: "Colby Hansen" <cghansen@micron.com>
Subject: Number of Unique Values
Message-Id: <8j82bg$fck$1@admin-srv3.micron.com>
I'm wondering what the easiest way is to find the number of unique values in
a list. Also, is there a way to do it using PDL? Thanks!
------------------------------
Date: Tue, 27 Jun 2000 03:03:14 +1000
From: Ian FALCAO <ifalc@students.cs.mu.OZ.AU>
Subject: running unix commands in CGI
Message-Id: <Pine.GSO.4.05.10006270301570.1669-100000@holly.cs.mu.OZ.AU>
Hi
Can anyone tell me why the following script generates a 500 internal
server error when it is run while some commands just don't display their
output in my browser.
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "<HTML>";
system "/usr/bin/ls";
print "</HTML>";
print "\n";
The perl output is:
Content-type: text/html
list.cgi script.cgi script2.cgi script4.cgi t1.cgi tmp
list1.cgi script1.cgi script3.cgi t.cgi test.cgi
<HTML></HTML>
Is there anyway to get the ls to put its output in between the html tags
although even when I managed to get it to do this with a subroutine. It
still wouldn't display in my browser.
Any help would be greatly appreciated.
Thanks
Ian
------------------------------
Date: 26 Jun 2000 17:48:57 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: running unix commands in CGI
Message-Id: <8j8529$lr5$1@internal-news.uu.net>
Ian FALCAO <ifalc@students.cs.mu.oz.au> wrote:
> Can anyone tell me why the following script generates a 500 internal
> server error when it is run while some commands just don't display their
> output in my browser.
> system "/usr/bin/ls";
perldoc -f system
This is NOT what you want to use to capture
the output from a command, for that you should use merely backticks or
qx//, as described in perlop/"`STRING`".
Erik
------------------------------
Date: Mon, 26 Jun 2000 16:25:41 GMT
From: thoma <thomastk@my-deja.com>
Subject: Re: Server push problem
Message-Id: <8j805g$hrr$1@nnrp1.deja.com>
I had the same problem working with IIS. I had to send in 512 bytes
blank chars to get rid of the buffering. Following the code I used:
print STDOUT "<p>Data transfer process has been started...<br>";
STDOUT->flush;
#Following is the voodoo to flush the IIS buffer, MS sucks.
#The previous command would have been enough in a logical world.
for ($i = 0;$i < 512;$i++) {print " ";}
STDOUT->flush;
I don't if this will help you.
Regards
Thomas.
In article <3PJ55.5447$oL4.109990@news2.nokia.com>,
"Sami Maki" <sami.maki@nokia.com> wrote:
> Hi,
>
> I have this "push" related problem that server will execute entire
Perl
> script before printing anything to web browser. Are there some
> configurations what need to be set on server side before it works?
Here is
> the script what I'm using (it works on Apache at least but not on
> iPlanet-WebServer-Enterprise/4.1). Thanks.
>
> $| = 1;
> print "$ENV{'SERVER_PROTOCOL'} 200 OK\n";
> print "Server: $ENV{'SERVER_SOFTWARE'}\n";
> print "Content-type: multipart/x-mixed-
replace;boundary=ARandomString\n\n";
>
> # Begin sending characters
> print "--ARandomString\n";
> for ($loop = 1; $loop <= 5; $loop++)
> {
> print "Content-type: text/plain\n\n";
> print "$loop\n";
> sleep (1);
> print "\n--ARandomString\n";
> }
> exit (0);
>
> BR, Sami
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 10:30:19 -0700
From: Ron Hill <hillr@ugsolutions.com>
Subject: single quote string question
Message-Id: <3957932B.6F31FC59@ugsolutions.com>
Hello All,
I have a question about single quoted string. Using the following
example
print '"Three \\\'s: \\\\\"';
this returns "Three \'s: \\\"
my question is how can therre be \\\ at the end?
the way I see it is \\ will produce \ this accounts for four of the \
now the fifth \ is paired with the " so it will print "
So where is the extra \ comming from?
Thanks
------------------------------
Date: Mon, 26 Jun 2000 12:40:29 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: split question
Message-Id: <395795d9$0$1991@wodc7nh1.news.uu.net>
Hello,
I have a split question. The split function according to the Camel returns a
"list". I have a string that looks like this:
my $testString = "hello SSPPLLIITT goodbye";
when I try and do this
my ($ans1, $ans2) = split /SSPPLLIITT/, $testString;
After running that and I print $ans1 or $ans2, they are empty, but of course
if I assign to an array, I am OK.
Isn't assigning to two variables the same as assigning to a list?
thanks
Scott
------------------------------
Date: Mon, 26 Jun 2000 11:00:57 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: split question
Message-Id: <2af230f8.1c2ae21d@usw-ex0104-033.remarq.com>
It works fine on my machine..as it has to..without any problem..
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 26 Jun 2000 14:04:54 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Teen Volenteers WANTED
Message-Id: <slrn8lf7s4.ka1.abigail@alexandra.delanet.com>
Daniel Jones (danjones@crosswinds.net) wrote on MMCDXCI September
MCMXCIII in <URL:news:39573795.45CAA5A8@crosswinds.net>:
'' Do you know c-c++, HTML, JAVA, JAVASCRIPT, xml or any other computer
'' languages?
'' Are you a teenager?
'' Are you a web guru?
'' Wanna get recognition?
Translated: want to work hard for no pay?
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: Mon, 26 Jun 2000 16:36:47 GMT
From: thoma <thomastk@hotmail.com>
Subject: Telnet.pm module
Message-Id: <8j80qt$ib4$1@nnrp1.deja.com>
Hi All,
I use Telnet.pm module to communicate with terminal servers. Whenever,
I do a Telnet session from my Perl CGI program, I get the following
warning:
Argument "" isn't numeric in gt at bin/Telnet.pm line 2569.
Even though, it is harmless, it's kind of disturbing to see on the web
browser. Is there any way this could be fixed or supressed? The related
code is attached.
Thanks in advance
Thomas.
================================
#setport(host,mode,type)
#Sets the port for a data transfer session.
sub setport {
my($host,$mode,$type) = @_;
my(@cmds) = "log port 1";
@cmds = (@cmds,getSerialPortCmds($host,$mode,$type));
if (telnetmss($host,@cmds)) {return 1}
else {return 0}
}
#telnetmss($host,@telnet_cmds)
#Telnets the given host and submits the list of commands.
sub telnetmss {
my($host,@cmds) = (@_);
my($t) = new Net::Telnet ( Timeout=>10, Errmode=>'return');
if (!($t->open($host))) {return 0}
$t->waitfor('/Username> $/i');
$t->print('system');
$t->cmd('set priv');
$t->cmd('system');
foreach $cmdx (@cmds) {
if (!($t->cmd($cmdx))) {return 0}
}
$t->close();
return 1;
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 18:48:53 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: User's details
Message-Id: <8j8248$25e$17$1@news.t-online.com>
Thnanks, that's what I was looking for. I don't think that I'll parse the
"stuff" in the output, it should be readable (at least the most important
part... :-)
David Efflandt <efflandt@xnet.com> wrote in message
news:slrn8le498.p29.efflandt@efflandt.xnet.com...
> On Sun, 25 Jun 2000, Raphael Pirker <raphaelp@nr1webresource.com> wrote:
> >
> >I've heard that you can find out user's details using perl. In which
array
> >or variable are they stored? I'm aiming at:
> >
> >Browser
> >PC
> >OS
>
> This CGI question is not Perl related, but in Perl you can "try" to parse
> $ENV{HTTP_USER_AGENT), but good luck! Here are some examples:
>
> Mozilla/4.0 (compatible; MSIE 5.0; AOL 5.0; Windows 95; DigExt)
> Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; CDv5_0699)
> Mozilla/4.0 (compatible; MSIE 4.01; MSN 2.6; Windows 95)
> Mozilla/4.7 [en] (Win98; I)
> Mozilla/4.7 [en] (X11; I; Linux 2.2.13 i586)
> Mozilla/4.61 [en] (X11; I; Linux 2.2.12-20 i686)
> Googlebot/2.0 beta (googlebot(at)googlebot.com)
> Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
> Mozilla/4.08 [en] (WinNT; U ;Nav)
> Slurp.so/1.0 (slurp@inktomi.com; http://www.inktomi.com/slurp.html)
> Lycos_Spider_(T-Rex)
>
> And when I grab a site to check the headers I use:
> Perl/5.0 [en] (Unix script)
>
> --
> David Efflandt efflandt@xnet.com http://www.de-srv.com/
> http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
> http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
>
------------------------------
Date: Mon, 26 Jun 2000 18:52:52 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: User's details
Message-Id: <8j8249$25e$17$3@news.t-online.com>
I'll be using this for educational purposes, so I don't want to use CGI.pm -
I know I could, but the teacher doesn't like me doing stuff he doesn't
understand... :-)
Ilja Tabachnik <billy@arnis-bsl.com> wrote in message
news:8j5qag$1d8$1@nnrp1.deja.com...
> In article <8j5n7s$oap$12$1@news.t-online.com>,
> "Raphael Pirker" <raphaelp@nr1webresource.com> wrote:
> > Hi,
> >
> > I've heard that you can find out user's details using perl. In which
> array
> > or variable are they stored? I'm aiming at:
> >
> > Browser
> > PC
> > OS
> >
> > Can I find those anywhere?
> >
>
> What 'user' (or user of what) do you mean ?
> There are plenty of entities which may be
> described with that word.
>
> Ok, as long as you included a keyword 'browser'
> and making some assumptions I guess you mean the following:
>
> "How can I get some details about HTTP client
> in CGI environment using perl ?"
>
> If so, you need a CGI.pm module (AFAIK part of
> stardard perl distribution).
> Consult your local 'perldoc CGI' or visit
> http://www.cpan.org/doc/manual/html/lib/CGI.html
> to learn more.
>
> And do not trust any person who will say you
> may parse environment variables by hand
> instead of using CGI.pm.
>
> Hope this helps.
> Ilja.
>
>
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Mon, 26 Jun 2000 18:51:43 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: User's details
Message-Id: <8j8248$25e$17$2@news.t-online.com>
> You can find such a group down the hall, to your left. Just follow the
smell.
*moving down the hall, turning left and opening a door* "Damn, that's the
toilet"
*turning around, asking a (very nice-looking) assistant who immedately
points at a group of people* "There they are. You're right, they sure
smell"... :-)
------------------------------
Date: Mon, 26 Jun 2000 18:38:30 +0200
From: "Thomas Plehn" <thommy-p@bigfoot.com>
Subject: Zlib.pm and perl2exe
Message-Id: <8j8120$ba1$12$1@news.t-online.com>
Hello,
I have written a script which uses Zlib for Data compression. This script
works fine if I use the interpreter but if I try to compile it with
perl2exe, I get the following error:
(only the relevant part)
Can't locate auto/Compress/Zlib/autosplit.ix in @INC (@INC contains: [...])
at PERL2EXE_STORAGE/AutoLoader.pm line 83.
at PERL2EXE_STORAGE/Compress/Zlib.pm line 8
Is there anything I can do against this problem?
What is "autosplit.ix" ?
Thanks in advance
Thomas
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3482
**************************************