[13491] in Perl-Users-Digest
Perl-Users Digest, Issue: 901 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 24 17:07:19 1999
Date: Fri, 24 Sep 1999 14:05:14 -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: <938207114-v9-i901@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 24 Sep 1999 Volume: 9 Number: 901
Today's topics:
Re: automated submission to a perl script <aqumsieh@matrox.com>
Re: automated submission to a perl script <gellyfish@gellyfish.com>
Re: beauty of a Y2K bug (Jack Applin)
Re: CGI sending email with attachment <cassell@mail.cor.epa.gov>
Re: CGI sending email with attachment (Michael Stevens)
Re: challenge results <mwest@ovid.com>
Re: compiled regex problem <ltl@rgsun5.viasystems.com>
Re: Grouping in REs, no doc found <cassell@mail.cor.epa.gov>
Re: Help on regex required!! <aqumsieh@matrox.com>
help with "Perl Cookbook" recipe <elf@ee.ryerson.ca>
Help <aakhanna@aludra.usc.edu>
Re: Help <makkulka@cisco.com>
How to print file in two columns ? tvn007@my-deja.com
Re: How to print file in two columns ? <makkulka@cisco.com>
Re: How to validate a URL? <gellyfish@gellyfish.com>
Re: I got thousands of CRACKS 'n SERIALS onlu for U !! <gellyfish@gellyfish.com>
interpolation question <cLive@direct2u.co.uk>
Re: interpolation question (Alan Curry)
Is there an XML Sax module ? (John Robson)
Re: keys() and/or values() in %hash{x}{y}{z} (Larry Rosler)
Re: keys() and/or values() in %hash{x}{y}{z} (Bill Moseley)
Re: Method=Post & frames <cassell@mail.cor.epa.gov>
Re: Method=Post & frames <gellyfish@gellyfish.com>
Re: need to write www search engine <dementia@tembel.org>
Re: New trolling strategy ? <cassell@mail.cor.epa.gov>
Re: NEWBIE QUESTION: Easy for most of you I'm sure. <cLive@direct2u.co.uk>
Re: Pass by reference <mortuno@iname.com>
Re: Pass by reference <cassell@mail.cor.epa.gov>
Re: Pass by reference <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Sep 1999 14:15:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: automated submission to a perl script
Message-Id: <x3yemfow4zj.fsf@tigre.matrox.com>
lenny_jolin@my-deja.com writes:
> I was wondering if anyone has the script for an automated form
> submission? I found one in the perl cookbook but forgot the book this
> morning.
You mean you actually memorized the whole book?
--Ala
------------------------------
Date: 24 Sep 1999 20:57:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: automated submission to a perl script
Message-Id: <7sgoju$ac1$1@gellyfish.btinternet.com>
On Fri, 24 Sep 1999 13:26:25 GMT lenny_jolin@my-deja.com wrote:
> I was wondering if anyone has the script for an automated form
> submission? I found one in the perl cookbook but forgot the book this
> morning. If anyone has that book near a keyboard could you please post
> that script?
>
I'm afraid you'll find that Usenet rarely works like that ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 24 Sep 1999 19:06:09 GMT
From: neutron@fc.hp.com (Jack Applin)
Subject: Re: beauty of a Y2K bug
Message-Id: <7sgi31$s5f$2@fcnews.fc.hp.com>
Kragen Sitaker (kragen@dnaco.net) wrote:
> Someone claimed that Larry had a "19$year" bug in an earlier edition of
> the Camel. (Can anyone confirm or deny?)
"Programming perl", 1st edition, copyright 1990,
by Larry Wall and Randal L. Schwartz, p. 317:
.TH $PROG 1 "$month $mday, 19$year"
Larry & Randal are clever people. The fact that one of them could be
tripped up by the localtime() interface makes it clear to me that it's
not enough to say "it's in the documentation, only morons get it wrong."
Tricky interfaces lead to bugs, even with the best of programmers.
-Jack Applin
neutron@fc.hp.com
------------------------------
Date: Fri, 24 Sep 1999 13:28:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: CGI sending email with attachment
Message-Id: <37EBDF08.49A8E286@mail.cor.epa.gov>
I.J. Garlick wrote:
^
> You missed the '--' needed to tell it that's the last boundary. Not sure
> if it's strictly necessary but I always add it. You never know when you
> might want to toss the whole multipart into another multipart and I think
> it is essential then.
That's feasible, and certainly legal according to the RFC. But
I would recommend avoiding shoving a multipart inside another
multipart. Many of the mail readers it has been my misfortune
to encounter will not handle this situation correctly.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Sep 1999 19:28:14 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: CGI sending email with attachment
Message-Id: <slrn7unk6e.kg.mstevens@swirl.internal.fict>
On Fri, 24 Sep 1999 08:03:23 -0400, Burt Hwang <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> wrote:
>Yes, I agree using open() without an error is bad. But it was simply a test
>and I knew it would open.
Famous last words.
------------------------------
Date: Fri, 24 Sep 1999 19:44:51 GMT
From: Michael West <mwest@ovid.com>
Subject: Re: challenge results
Message-Id: <7sgkbf$jid$1@nnrp1.deja.com>
> # Everything on a new line.
> perl -ne'$x{1,sort/./g}.=$_}{/.\n./&&print for%x'
>
> # All anagrams on one line.
> perl -lne'$x{1,sort/./g}.="$_ "}{/ ./&&print for%x'
>
> # All anagrams on one line. Assume words don't include hypens.
> perl -lne'$x{1,sort/./g}.=-$_}{/.-/&&print for%x'
I'm a newbie, and I'm wondering if someone could help me by sharing the
"non-short" version of an anagram script, which I can incorporate into a
larger script. I looked for faq information or modules, but the only
thing I found on anagrams is this challenge. I am having trouble
getting these scripts to work on the command line (they hang), so I was
wondering if someone could walk me though them?
Thanks,
Michael West
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 24 Sep 1999 19:12:05 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: compiled regex problem
Message-Id: <7sgie5$rem$1@rguxd.viasystems.com>
In comp.lang.perl.misc David L Rubin <davidrubin@lucent.com> wrote:
:>My Apache server is running a mod_perl script which does the following:
[snip]
:> my $re = $regex_tab{$site};
:> while ($content =~ /$re/og) {
----------------------------^
Doesn't that tell Perl to only compile your regexp once -- that $re
is not going to change? But $re can be different each time the
subroutine is entered.
If you used qr{} to build your regular expressions that you stored
in %regex_tab, then they will only be compiled once anyway.
To be honest, I was not sure that this was true from reading the
documentation. It looks like "qr" is as much a quoting operator
as anything else. So I resorted to trying it. :-)
Run the following:
#!/usr/lib/lprgs/perl -w
use re 'debugcolor';
use strict;
my %r;
$r{xxx} = qq{xxx};
$r{yyy} = qq{yyy};
for ('xxx', 'yyy', 'xxx', 'yyy') {
print "$_ true\n" if /$r{$_}/;
}
As strings are encountered in the match operator each time through
the loop, they become a freshly recompiled expression.
Then change "qq" to "qr" in the above two assignments to %r and try
it again.
When the objects that the match operator encounters were built with
"qr", they don't get recompiled, even though there isn't any /o
modifier. I guess that's why they are called compiled regular
expressions.
Now put a /o modifier on the match operator. You get the behavior
your program is getting.
HTH.
--
// Lee.Lindley /// Programmer shortage? What programmer shortage?
// @bigfoot.com /// Only *cheap* programmers are in short supply.
//////////////////// 50 cent beers are in short supply too.
------------------------------
Date: Fri, 24 Sep 1999 13:24:50 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Grouping in REs, no doc found
Message-Id: <37EBDE12.1D5D1084@mail.cor.epa.gov>
Alex Rhomberg wrote:
>
> Kragen Sitaker wrote:
> > my $string = 'How old is your CAT?';
> > $string =~ /(CAT)/; # succeeds
> > $string =~ /(flibberti-gibbet)/; # fails
> > print "$1\n"; # prints CAT
>
> You missed the 'if followed by a quantifier'. 'If match is successful'
> should probably be added.
>
> It seems that nobody found this in perlre. IMHO it should be there. Can
> we do something to get it included?
In the words of tchrist himself, "Patches are welcome."
You might want to write a sentence or two of patch, and
send that with a diff to Tom at
perlfaq-suggestions@perl.com
If there's a better place to send a mod to the Perl manpages,
It isn't coming to mind.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 24 Sep 1999 14:25:01 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help on regex required!!
Message-Id: <x3yaeqcw4jm.fsf@tigre.matrox.com>
e_schneider@pixelpark.com writes:
> I'm looking for a regex doing the following: It should match "," but
> not "%,"
Have a closer look at perlre (of a recent enough Perl distribution):
(?<!pattern)
A zero-width negative lookbehind assertion. For example
/(?<!bar)foo/ matches any occurrence of ``foo'' that isn't
following ``bar''. Works only for fixed-width lookbehind.
I think it is trivial for you to change the above example to fit your
needs.
HTH,
--Ala
------------------------------
Date: 24 Sep 1999 15:25:54 -0400
From: Luis Fernandes <elf@ee.ryerson.ca>
Subject: help with "Perl Cookbook" recipe
Message-Id: <x01zbocdrx.fsf@ee.ryerson.ca>
I'm having a bit of trouble constructing regexp's to match a range of
lines spanning multiple-lines.
I found the recipie I needed in the excellent "Perl Cookbook", p.177,
but I can't seem to figure out how to exclude the beginning and end
patterns.
#!/usr/local/bin/perl
$/='';
while(<>){
print if(/Begin:/ .. /End:/);
}
Example input:
------------------------------------------------------------------------
Begin:
Direct
digital synthesis signal generator
Preamble:
End:
------------------------------------------------------------------------
I want the text: "Direct digital synthesis signal generator".
Any ideas?
------------------------------
Date: Fri, 24 Sep 1999 13:06:12 -0700
From: Ajay Khanna <aakhanna@aludra.usc.edu>
Subject: Help
Message-Id: <Pine.GSO.4.10.9909241303220.298-100000@aludra.usc.edu>
Hi..
I have written a perl script which compiles properly..ie. there isnt any
syntax error...but when i try to run it through a browser, it gives
"Internal Server Error". The error log file says :
[Fri Sep 24 11:20:04 1999] [error] [client 128.125.163.106] Premature end
of script headers: /home/cgi-bin/calendar-show.pl
could anyone help me with it???
-Ajay
------------------------------
Date: Fri, 24 Sep 1999 13:48:32 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Help
Message-Id: <37EBE3A0.6D44DE0C@cisco.com>
[ Ajay Khanna wrote:
> "Internal Server Error". The error log file says :
> [Fri Sep 24 11:20:04 1999] [error] [client 128.125.163.106] Premature end
> of script headers: /home/cgi-bin/calendar-show.pl
Run you script offline and make sure that it generates the
proper headers like
content-type:text/html\n\n
etc
--
------------------------------
Date: Fri, 24 Sep 1999 18:45:23 GMT
From: tvn007@my-deja.com
Subject: How to print file in two columns ?
Message-Id: <7sggrv$gq5$1@nnrp1.deja.com>
Hi,
I wrote a PERL script that print to a FILE a huge file and
I do not want to print it out since I will take around
200 pages to print out the entire file on laser printer.
Would someone give me some hints how to "reprocess"
this file so that I can print the output in
two columns ?
Thanks in advance for your help !!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 24 Sep 1999 13:50:25 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: How to print file in two columns ?
Message-Id: <37EBE411.584E23EB@cisco.com>
[ tvn007@my-deja.com wrote:
> Would someone give me some hints how to "reprocess"
> this file so that I can print the output in
> two columns ?
This is best done by using the software coming with
the printer ( changing Printer Properties for the Job ).
--
------------------------------
Date: 24 Sep 1999 20:54:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to validate a URL?
Message-Id: <7sgodv$abu$1@gellyfish.btinternet.com>
On Thu, 23 Sep 1999 18:07:37 GMT Philip 'Yes, that's my address' Newton wrote:
> On Thu, 23 Sep 1999 08:58:55 -0700, Tom Phoenix <rootbeer@redcat.com>
> wrote:
>
>>Have you written to Fred and Barney yet? Try it and see for yourself!
>>
>> <"fred and barney"(.@.&?<b>valid!</b>.@,,)@redcat.com>
>
> I can't. Neither Pegasus nor Free Agent will let me.
>
> fred&barney@stonehenge.com (IIRC) is fine, but Fred and Barney at
> redcat is too much for them.
>
I'd get PC-Pine then ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 24 Sep 1999 20:36:39 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I got thousands of CRACKS 'n SERIALS onlu for U !!
Message-Id: <7sgncn$abi$1@gellyfish.btinternet.com>
On Fri, 24 Sep 1999 00:51:22 +0530 Pawan Bhati wrote:
> Path: mendelevium.btinternet.com!btnet-peer!btnet!news.maxwell.syr.edu!newsfeed.cwix.com!news.vsnl.net.in!not-for-mail
> From: "Pawan Bhati" <pawanbhati@hotmail.com>
> Newsgroups: comp.lang.perl.misc
> Subject: I got thousands of CRACKS 'n SERIALS onlu for U !!
> Date: Fri, 24 Sep 1999 00:51:22 +0530
> Organization: VSNL
> Lines: 17
> Message-ID: <7sf34f$mrk$1@news.vsnl.net.in>
> NNTP-Posting-Host: 202.54.109.135
> X-Trace: news.vsnl.net.in 938151887 23412 202.54.109.135 (24 Sep 1999 05:44:47 GMT)
> X-Complaints-To: postmaster@news.vsnl.net.in
> NNTP-Posting-Date: 24 Sep 1999 05:44:47 GMT
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
> Xref: mendelevium.btinternet.com comp.lang.perl.misc:239327
>
That would be a mistake then wouldnt it ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 24 Sep 1999 13:01:48 -0700
From: cLive hoLLoway <cLive@direct2u.co.uk>
Subject: interpolation question
Message-Id: <37EBD8AC.F7C267A9@direct2u.co.uk>
Well, I'm stumped. Looked around and can't find an answer....
How do I interpolate a variable into a string that is followed
immediately by another alphanumeric???
eg,
$word = 'wonder';
$newword = "$wordful":
so that $newword is 'wonderful';
...and no, $word.'ful' is not the answer!
In RL, I'm looking at the interpolation being halfway down a large print
<<_END_
several
line
quote
_END_
statement and the context makes this impractical...
later
cLive ;-)
------------------------------
Date: Fri, 24 Sep 1999 20:17:32 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: interpolation question
Message-Id: <w%QG3.25$CY.33546@typ11.nn.bcandid.com>
In article <37EBD8AC.F7C267A9@direct2u.co.uk>,
cLive hoLLoway <cLive@direct2u.co.uk> wrote:
>
>$word = 'wonder';
>
>$newword = "$wordful":
>
>so that $newword is 'wonderful';
${word}ful
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: 24 Sep 1999 20:06:12 GMT
From: as646@FreeNet.Carleton.CA (John Robson)
Subject: Is there an XML Sax module ?
Message-Id: <7sgljk$r8o@freenet-news.carleton.ca>
I found the XML::Parser and XML::DOM modules, but I couldn't find an XML
Sax module. Sax is an alternative API to DOM. Is there a Sax module, or
has anyone created one yet ?
------------------------------
Date: Fri, 24 Sep 1999 12:00:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: keys() and/or values() in %hash{x}{y}{z}
Message-Id: <MPG.12556a133c82f433989fd6@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <37eba21f.41590730@nntp.ix.netcom.com> on Fri, 24 Sep 1999
16:41:46 GMT, Deviant Freak <DeviantFreak@yahoo.com> says...
...
> I have a multidimensional %hash kinda like this (+/- 200k records, and
> about):
>
> $hash{'record 1'}{'name'} = 'John Doe'
> $hash{'record 1'}{'city'} = 'San Francisco'
> $hash{'record 1'}{'state'} = 'CA'
> $hash{'record 1'}{'kids'} = [ 'Johnny:5', 'Mary:3', 'Baby:1' ]
>
> $hash{'record 2'}{'name'} = 'Jane Smith'
> $hash{'record 2'}{'city'} = 'Albany'
> $hash{'record 2'}{'state'} = 'NY'
> $hash{'record 2'}{'pets'} = [ 'Rover:dog' ]
> $hash{'record 2'}{'hobbies'} = [ 'skiing', 'diving' ]
>
> Note: Not all records have the same fields, and some fields contain
> lists, and the number of items in the list varies.
#!/usr/local/bin/perl -w
use strict;
my %hash;
@{$hash{'record 1'}}{qw(name city state kids)} =
('John Doe', 'San Francisco', 'CA',
[ 'Johnny:5', 'Mary:3', 'Baby:1' ]);
@{$hash{'record 2'}}{qw(name city state pets hobbies)} =
('Jane Smith', 'Albany', 'NY', [ 'Rover:dog' ],
[ 'skiing', 'diving' ]);
> Problems to solve:
>
> 1. I want to be able to determine which "sub-keys" exist in each
> {record}; i.e., something like
>
> keys(%hash{'record 1'})
>
> returning the list ['name', 'city', 'state', 'kids'].
my $types = [ keys %{$hash{'record 1'}} ];
print join('|' => @$types), "\n";
> 2. I want to be able to list the {record}s that contain the {pets}
> field.
print join "\n" => grep(exists $hash{$_}{pets} => keys %hash), "";
# But this creates a list of all the keys and iterates over them, which
# you say (understandably) you don't want to do. So:
while (my ($key, $value) = each %hash) {
print "$key\n" if exists $value->{pets};
}
> 3. I need to be able to list the {record}s where the {state} field
> equals a particular value, like 'NY'.
print join "\n" =>
grep(exists $hash{$_}{state} && $hash{$_}{state} eq 'NY' =>
keys %hash), "";
# And do the same transformation to an 'each' loop as above. Note that
# the code tests first for the existence of the subhash, to avoid
# autovivifying it. It assumes that if the key exists it is defined.
# Perhaps 'defined' would be the correct test.
> 4. For fields that contain lists, I need to be able to determine how
> many items are in the list, probably using # or scalar, but I can't
> seem to hunt down the correct syntax.
print map(scalar @{$hash{$_}{kids}} => grep exists $hash{$_}{kids} =>
keys %hash), "\n";
> What I'm *really* searching for is an implementation of keys() and
> values() for multidimensional hashes, *not* a foreach through 200,000
> or more records. (Speed is everything for this job.)
# I think you may want either to invert the order of keys in your data
# structure or to create auxiliary structures for each of the subkeys.
# Here are two implementations of the second approach.
# This uses named arrays:
my (@kids, @pets, @hobbies);
while (my ($key, $value) = each %hash) {
push @kids, $key if exists $value->{kids};
push @pets, $key if exists $value->{pets};
push @hobbies, $key if exists $value->{hobbies};
}
{ local $" = "\n";
print "kids:\n@kids\n\npets:\n@pets\n\nhobbies:\n@hobbies\n\n";
}
# This uses a hash. I much prefer it because each of the names appears
# once only.
my %types;
while (my ($key, $value) = each %hash) {
exists $value->{$_} and push @{$types{$_}}, $key
for qw( kids pets hobbies );
}
{ local $" = "\n";
print "$_:\n@{$types{$_}}\n\n" for keys %types;
}
> Any pointers to answers on any of the above would be *deeply*
> appreciated.
HTH. Interesting problem. I hope others can help more.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 24 Sep 1999 12:37:59 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: keys() and/or values() in %hash{x}{y}{z}
Message-Id: <MPG.125572f3e6502f7f989782@nntp1.ba.best.com>
Larry Rosler (lr@hpl.hp.com) seems to say...
> print join "\n" =>
> grep(exists $hash{$_}{state} && $hash{$_}{state} eq 'NY' =>
> keys %hash), "";
>
> # And do the same transformation to an 'each' loop as above. Note that
> # the code tests first for the existence of the subhash, to avoid
> # autovivifying it. It assumes that if the key exists it is defined.
> # Perhaps 'defined' would be the correct test.
autovivifying? I'd do it to prevent:
Use of uninitialized value at larry.pm line 29.
Slow day Larry? If so, I've got a couple of pending posts I could use
help with!
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Fri, 24 Sep 1999 13:41:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Method=Post & frames
Message-Id: <37EBE1F8.3F343F1C@mail.cor.epa.gov>
Maen Suleiman wrote:
[answer has been moved from the top of the post to the bottom,
so this flows in the form of a human conversation]
> > Yes. Your description of the problem indicates that this is
> > a browser-related phenomenon, not a CGI or Perl one. So
> > you'll probably get the most helpful response in one of the
> > Usenet groups which focuses on browsers. This is most likely
> > one of those irritating not-quite-conforming-to-the-spec
> > problems that constantly crop up with Nyetscape and
> > Internet Exploder.
> I think it's maybe related to CGI as well .. because i open the frames
> from a cgi program and not from a html page
Ummm.. just because you used CGI doesn't mean that the problem
you are seeing is related to the CGI spec or your CGI code.
Problems seen when browsing a web page can have many sources,
so this can be difficult to grok or to isolate. Is the problem:
[1] HTTP?
[2] HTML?
[3] CGI?
[4] the webserver?
[5] a webserver config issue?
[6] the language used to write to the CGI spec?
[7] a browser quirk?
[8] the OS hosting the browser?
[9] other:_______________________________________
[A] an interaction of two or more of the above?
Your problem description suggested that the problem might be
#7, a browser quirk. They're all quirky, anyway. Just
having frames doesn't make it a _de_facto_ CGI problem.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Sep 1999 20:52:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Method=Post & frames
Message-Id: <7sgoaj$abr$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Maen Suleiman <maen@packet-technologies.com> wrote:
> David Cassell <cassell@mail.cor.epa.gov> wrote in message
> news:37DEB634.8ECF73B@mail.cor.epa.gov...
>> Maen Suleiman wrote:
>> >
>> > Hi to all ,
>> >
>> > I have this weird phenomena : i have html page with a form inside ,
>> > this form call another cgi program that create a html page WITH FRAMES .
> the
>> > frames sources are both cgi and html pages !
>> >
>> > the weird thing is , that when the form action method=post , it works
> well
>> > in the Netscape , but in Explorer it give me "Page not found " Error
>> > messages in all of the frames and when i do refresh it it show the
> frames
>> > well !
>> >
>> > when the method is not post , it works well ! ,
>> >
>> > any suggestions ?!
>>
>> Yes. Your description of the problem indicates that this is
>> a browser-related phenomenon, not a CGI or Perl one. So
>> you'll probably get the most helpful response in one of the
>> Usenet groups which focuses on browsers. This is most likely
>> one of those irritating not-quite-conforming-to-the-spec
>> problems that constantly crop up with Nyetscape and
>> Internet Exploder.
>>
> I think it's maybe related to CGI as well .. because i open the frames
> from a cgi program and not from a html page ,
> anyhow thanks :)
>
This is still not a *Perl* question. It is a question related to the
behaviour of a certain browser when given certain input. If you had posted
in the correct group in the first place then you might have got an answer.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 24 Sep 1999 21:00:27 +0000
From: "Gen. Purpose" <dementia@tembel.org>
Subject: Re: need to write www search engine
Message-Id: <37EBE66B.3F4626D@tembel.org>
gregory.zhuravlev@gs.com wrote:
> Mike,
>
> do you know where I can find a source code for any web spider? Doesn't
> have to be fancy, but sth that I can start to work with?
>
> Thanks,
> Greg
>
> In article <37E07AC3.BDE22F61@ix.netcom.com>,
> gremlin <gremlin_NO_SPAM_@ix.netcom.com> wrote:
> > This is a total guess, so I guess it is as much a question as an
> > answer. But why not have your crawlers start off by working from a
> > result list for "URL:gov" or whatever the exact syntax is from
> > AlstaVista, etc.? This way you let the big search engines do some of
> > the up front work for you. You might even be able to be more specific
> > for your "chunks", e.g., "URL: *NOAA*.gov". The crawlers could build
> > their own list/database of links by extracting them from the sites as
> > you search them. Is this totally stupid? Wouldn't be the first time
> :)
> >
> > Mike
> >
> > Roger Jacques wrote:
> > >
> > > I want to write a robot program that will search all www sites by
> > > domain type and return the <title>.
> >
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Check out LWP::RobotUA.
--
Aaron Ghent
CrossLink.
------------------------------
Date: Fri, 24 Sep 1999 13:14:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: New trolling strategy ?
Message-Id: <37EBDBC2.1AAB1E66@mail.cor.epa.gov>
c_j_marshall@my-deja.com wrote:
> "Nothings so foolproof that there isn't a fool foolish enough to fool
> it". Or something.
"You can't make anything foolproof, because they make fools
better and better every year."
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Hey, I like this Deja slogan a lot better than that "Share what
is wrong. Unlearn what is right." slogan.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 24 Sep 1999 13:39:38 -0700
From: cLive hoLLoway <cLive@direct2u.co.uk>
Subject: Re: NEWBIE QUESTION: Easy for most of you I'm sure.
Message-Id: <37EBE18A.EE1D7E2C@direct2u.co.uk>
pctechnician@iname.com wrote:
> I am very, very new to cgi...
> #! /usr/bin/perl
>
> # userpass.cgi
> # version 1.0
> #
> # Copyright paragon2000@hotmail.com
> # set to userpass.txt
>
> $userpass = "userpass.txt";
>
> # Below is where I'm trying to let this script know to pull from the
> html
> file
> # The field names from the html are saved as Username and Password
> $user = "$Username";
> $pass = "$Password";
>
> print "Content-type: text/plain\n\n ";
> open (USERPASS, ">>$userpass");
> print USERPASS "User: $user\n";
> print USERPASS "Pass: $pass\n";
> close (USERPASS);
> exit;
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Yes, you are...
1) read the CGI FAQ
2) find out about $ENV{'QUERY_STRING'}
3) find out about file permissions - chmod 777
4) find out why you should not save data files in your cgi-directory,
*especially those with rw permissions for everyone.
5) read the CGI security FAQ
6) don't play with usernames and passwords until you've got the above
sussed.
cLive ;-)
------------------------------
Date: Fri, 24 Sep 1999 22:14:06 +0200
From: Miguel Ortu~o <mortuno@iname.com>
Subject: Re: Pass by reference
Message-Id: <37EBDB8E.D65BF094@iname.com>
Tramm Hudson escribió:
>
> The statement
>
> my @my_list = @{$_[0]}
>
> makes a copy of the array that was so carefully passed by
> reference in the few lines of code that were elided. Perhaps
> Miguel should use the dereference operator to extract the
> items of interest:
>
> my $arr_ref = shift;
> my $element = $arr_ref->[2];
>
> Or maybe the local operator is more appropriate (and faster) for
> his needs:
>
> local *array = shift;
> my $element = $array[2];
>
> Neither of which make a copy of the array that was passed by reference.
What I´d like is something as easy as C++´s pass by reference
void my_function( type_of_my_list &my_list)
{
other_function(my_list); // my_list is a list, not a pointer
}
or Pascal
FUNCTION my_function(VAR my_list: type_of_my_list);
But, if it was possible, NOT something as C´s pass by address
void my_function (type_of_my_list *my_list)
{
other_function(*my_list); // "other_function needs" lists, not
// a pointer to a list
my_list-> ...... // we must deal with pointers
}
Can Perl do it? Can it be simulated?
(Don´t mind if code is slower)
Thank you very much to all!
Miguel
------------------------------
Date: Fri, 24 Sep 1999 13:13:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Pass by reference
Message-Id: <37EBDB55.9F17DC28@mail.cor.epa.gov>
Tramm Hudson wrote:
[big snip]
> Now can we take the
> issue to Sriram Srinivasan who uses the same construct on pages 43 and 44
> of the Panther book? In addition to failing with the strict pragma he
> also uses the special $a and $b.
I think the glob/reference horse is dead now. But what's wrong
with a judicious use of $a and $b? Sure, they're special when
sorting. But outside of a sort routine they're legit. I
don't recommend beginners use these variable names, because I've
seen potential consequences in user-written sort subroutines.
So I didn't like Srinivasan's use of them in a textbook. But
they're not inherently evil, like, say, symbolic references...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Sep 1999 15:02:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Pass by reference
Message-Id: <37ebe6f6@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, uov00135@correo.uniovi.es writes:
:What I\xb4d like is something as easy as C++\xb4s pass by reference
:
:void my_function( type_of_my_list &my_list) {
: other_function(my_list); // my_list is a list, not a pointer
:}
:
:or Pascal
:
:FUNCTION my_function(VAR my_list: type_of_my_list);
:
:But, if it was possible, NOT something as C\xb4s pass by address
:void my_function (type_of_my_list *my_list) {
: other_function(*my_list); // "other_function needs" lists, not
: // a pointer to a list
: my_list-> ...... // we must deal with pointers
:}
:
:Can Perl do it? Can it be simulated?
:(Don\xb4t mind if code is slower)
Yes, it can be simulated.
sub my_function(\@) {
local *my_array = shift;
}
func(@some_array);
At the very least, 5.6 will support:
sub my_function(\@) {
our *my_array = shift;
}
But Larry is thinking that he wants:
sub my_function(\@) {
my \@my_array = shift;
}
as well.
--tom
PS: Why are you using acute accent marks for apostrophes? :-(
--
"Try moving off NT easily. You can move from Solaris to HP/UX to AIX or DEC
easily relative to moving off of NT, which is like a Roach Motel. Once you
check in, you never check out."
-- Scott McNealy, Sun Microsystems
------------------------------
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 901
*************************************