[22954] in Perl-Users-Digest
Perl-Users Digest, Issue: 5174 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 3 18:06:10 2003
Date: Thu, 3 Jul 2003 15:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 3 Jul 2003 Volume: 10 Number: 5174
Today's topics:
A little regex help? <annoyed@you.now>
Re: A little regex help? (Greg Bacon)
Re: A little regex help? <emschwar@pobox.com>
Re: A little regex help? <annoyed@you.now>
Re: A little regex help? <mbudash@sonic.net>
Re: A little regex help? <emschwar@pobox.com>
Re: A little regex help? <mbudash@sonic.net>
Re: A little regex help? <mbudash@sonic.net>
Re: A little regex help? <noreply@gunnar.cc>
Re: A little regex help? <annoyed@you.now>
Re: A little regex help? <emschwar@pobox.com>
Apache/Perl segfaulting on system calls (Jeff)
Re: Apache/Perl segfaulting on system calls <glex_nospam@qwest.net>
AS repositories - so many, others missing, why?! (Fourth Monkey)
Re: AS repositories - so many, others missing, why?! (Randy Kobes)
Re: Automatic page forwarding in cgi perl script (Max)
Re: Automatic page forwarding in cgi perl script (Max)
Re: Automatic page forwarding in cgi perl script <asu1@c-o-r-n-e-l-l.edu>
Re: Automatic page forwarding in cgi perl script (Max)
Re: BTree examples ?? <paul.marquess@btinternet.com>
Re: Call parent method indirectly <REMOVEsdnCAPS@comcast.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 03 Jul 2003 12:08:02 -0500
From: "Ivan Marsh" <annoyed@you.now>
Subject: A little regex help?
Message-Id: <pan.2003.07.03.17.08.01.784844@you.now>
Hey Folks,
This isn't actually a perl question but since you folks ar the regex
experts I thought you might be able to help.
I want to do a search and replace in my text editor (that supports regex)
for any line that begins with print( and ends with "); and replace the
ending "); with \n"); where the line doesn't alredy end in \n");
ex:
print("foo");
becomes:
print("foo\n");
Thanks.
--
i.m.
All views, opinions and alleged facts expressed by this tactless moron are
protected by the constitution of the United States of America and should be
taken as good natured and friendly unless specifically stated otherwise.
------------------------------
Date: Thu, 03 Jul 2003 17:31:23 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: A little regex help?
Message-Id: <vg8q3b6jsc06bf@corp.supernews.com>
[Please note that comp.lang.perl is long dead.]
In article <pan.2003.07.03.17.08.01.784844@you.now>,
Ivan Marsh <annoyed@you.now> wrote:
: I want to do a search and replace in my text editor (that supports regex)
: for any line that begins with print( and ends with "); and replace the
: ending "); with \n"); where the line doesn't alredy end in \n");
:
: ex:
:
: print("foo");
:
: becomes:
:
: print("foo\n");
Without knowing the specifics of your environment, I can't tell you
how to do the replacement.
With perl, it's pretty easy:
% cat input
print("foo");
% perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input
% cat input
print("foo\n");
Hope this helps,
Greg
--
Under democracy one party always devotes its chief energies to trying to
prove that the other party is unfit to rule -- and both commonly succeed,
and are right.
-- H.L. Mencken
------------------------------
Date: 03 Jul 2003 11:45:27 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: A little regex help?
Message-Id: <etou1a3qzbc.fsf@wormtongue.emschwar>
gbacon@hiwaay.net (Greg Bacon) writes:
> In article <pan.2003.07.03.17.08.01.784844@you.now>,
> Ivan Marsh <annoyed@you.now> wrote:
> : I want to do a search and replace in my text editor (that supports
> : regex) for any line that begins with print( and ends with "); and
> : replace the ending "); with \n"); where the line doesn't alredy
> : end in \n"); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^
Note my added emphasis. :)
> With perl, it's pretty easy:
>
> % cat input
> print("foo");
> % perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input
> % cat input
> print("foo\n");
$ cat input
print("foo\n");
$ perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input
$ cat input
print("foo\n\n");
Making the first capture non-greedy, and checking for optional \n
saves the day:
$ cat input
print("foo\n");
$ perl -i -pe 's/print\((.+?)(\\n)?"\);/print($1\\n");/g' input
$ cat input
print("foo\n");
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 03 Jul 2003 13:04:34 -0500
From: "Ivan Marsh" <annoyed@you.now>
Subject: Re: A little regex help?
Message-Id: <pan.2003.07.03.18.04.33.962037@you.now>
On Thu, 03 Jul 2003 17:31:23 +0000, Greg Bacon wrote:
> [Please note that comp.lang.perl is long dead.]
>
> In article <pan.2003.07.03.17.08.01.784844@you.now>,
> Ivan Marsh <annoyed@you.now> wrote:
>
> : I want to do a search and replace in my text editor (that supports
> : regex) for any line that begins with print( and ends with "); and
> : replace the ending "); with \n"); where the line doesn't alredy end in
> : \n");
> :
> : ex:
> :
> : print("foo");
> :
> : becomes:
> :
> : print("foo\n");
>
> Without knowing the specifics of your environment, I can't tell you how to
> do the replacement.
>
> With perl, it's pretty easy:
>
> % cat input
> print("foo");
> % perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input % cat input
> print("foo\n");
>
> Hope this helps,
> Greg
Hey Thanks!
That got me goin' in the right direction. I got it to work except that it can't
tell if there is already a \n in the line.
I think this app has a few of it's own ideas about regex.
find: print\("(.+)"\);
replace with: print("\1\\n");
Did the trick.
--
i.m.
All views, opinions and alleged facts expressed by this tactless moron are
protected by the constitution of the United States of America and should be
taken as good natured and friendly unless specifically stated otherwise.
------------------------------
Date: Thu, 03 Jul 2003 18:13:46 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: A little regex help?
Message-Id: <mbudash-AB543E.11134803072003@typhoon.sonic.net>
In article <vg8q3b6jsc06bf@corp.supernews.com>,
gbacon@hiwaay.net (Greg Bacon) wrote:
> [Please note that comp.lang.perl is long dead.]
>
> In article <pan.2003.07.03.17.08.01.784844@you.now>,
> Ivan Marsh <annoyed@you.now> wrote:
>
> : I want to do a search and replace in my text editor (that supports regex)
> : for any line that begins with print( and ends with "); and replace the
> : ending "); with \n"); where the line doesn't alredy end in \n");
> :
> : ex:
> :
> : print("foo");
> :
> : becomes:
> :
> : print("foo\n");
>
> Without knowing the specifics of your environment, I can't tell you
> how to do the replacement.
>
> With perl, it's pretty easy:
>
> % cat input
> print("foo");
> % perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input
> % cat input
> print("foo\n");
>
> Hope this helps,
> Greg
or perhaps less error-prone, as well as explicitely following the o.p.'s
requirements:
s/^(print\(.+)("\);)$/$1\\n$2/g
--
Michael Budash
------------------------------
Date: 03 Jul 2003 12:23:55 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: A little regex help?
Message-Id: <etoptkrqxj8.fsf@wormtongue.emschwar>
Michael Budash <mbudash@sonic.net> writes:
> or perhaps less error-prone, as well as explicitely following the o.p.'s
> requirements:
>
> s/^(print\(.+)("\);)$/$1\\n$2/g
That still turns
print("foo\n");
into
print("foo\n\n");
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 03 Jul 2003 18:31:56 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: A little regex help?
Message-Id: <mbudash-A4EF58.11315603072003@typhoon.sonic.net>
In article <mbudash-AB543E.11134803072003@typhoon.sonic.net>,
Michael Budash <mbudash@sonic.net> wrote:
> In article <vg8q3b6jsc06bf@corp.supernews.com>,
> gbacon@hiwaay.net (Greg Bacon) wrote:
>
> > [Please note that comp.lang.perl is long dead.]
> >
> > In article <pan.2003.07.03.17.08.01.784844@you.now>,
> > Ivan Marsh <annoyed@you.now> wrote:
> >
> > : I want to do a search and replace in my text editor (that supports regex)
> > : for any line that begins with print( and ends with "); and replace the
> > : ending "); with \n"); where the line doesn't alredy end in \n");
> > :
> > : ex:
> > :
> > : print("foo");
> > :
> > : becomes:
> > :
> > : print("foo\n");
> >
> > Without knowing the specifics of your environment, I can't tell you
> > how to do the replacement.
> >
> > With perl, it's pretty easy:
> >
> > % cat input
> > print("foo");
> > % perl -i -pe 's/print\((.+)"\);/print($1\\n");/g' input
> > % cat input
> > print("foo\n");
> >
> > Hope this helps,
> > Greg
>
> or perhaps less error-prone, as well as explicitely following the o.p.'s
> requirements:
>
> s/^(print\(.+)("\);)$/$1\\n$2/g
oops not _quite_ explicitely, eh? o.p. also said "where the line doesn't
already end in \n");"
s/^(print\(.+?)(\\n)?("\);)$/$1\\n$3/g;
--
Michael Budash
------------------------------
Date: Thu, 03 Jul 2003 18:32:38 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: A little regex help?
Message-Id: <mbudash-205D8E.11323703072003@typhoon.sonic.net>
In article <etoptkrqxj8.fsf@wormtongue.emschwar>,
Eric Schwartz <emschwar@pobox.com> wrote:
> Michael Budash <mbudash@sonic.net> writes:
> > or perhaps less error-prone, as well as explicitely following the o.p.'s
> > requirements:
> >
> > s/^(print\(.+)("\);)$/$1\\n$2/g
>
> That still turns
>
> print("foo\n");
>
> into
>
> print("foo\n\n");
>
> -=Eric
damn i wasn't quick enuff in finding my mistake... see my next post...
--
Michael Budash
------------------------------
Date: Thu, 03 Jul 2003 20:47:34 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: A little regex help?
Message-Id: <be1tnd$bv7r$2@ID-184292.news.dfncis.de>
Ivan Marsh wrote:
> I want to do a search and replace in my text editor (that supports regex)
> for any line that begins with print( and ends with "); and replace the
> ending "); with \n"); where the line doesn't alredy end in \n");
>
> ex:
>
> print("foo");
>
> becomes:
>
> print("foo\n");
How about:
s/^(print\(.+)((?<!\\n)"\);)$/$1\\n$2/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 03 Jul 2003 14:01:35 -0500
From: "Ivan Marsh" <annoyed@you.now>
Subject: Re: A little regex help?
Message-Id: <pan.2003.07.03.19.01.35.243400@you.now>
On Thu, 03 Jul 2003 11:45:27 +0000, Eric Schwartz wrote:
> $ perl -i -pe 's/print\((.+?)(\\n)?"\);/print($1\\n");/g' input $ cat
Ouch, now I know why I'm having a hard time learning regex.
How does the if statement work?
Assuming that the ? is an if statement.
It's looking for print( plus any number of characters with (.+ then
whether there is a \n with (\\n) (which would be the false condition)
or "); (which would be the true condition) where the first question mark is.
It loads up $1 only with lines that match the condition after the last ?
(true condition).
Is that correct or am I still in the dark?
What's the /g do?
--
i.m.
All views, opinions and alleged facts expressed by this tactless moron are
protected by the constitution of the United States of America and should be
taken as good natured and friendly unless specifically stated otherwise.
------------------------------
Date: 03 Jul 2003 14:29:12 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: A little regex help?
Message-Id: <etollvfqrqf.fsf@wormtongue.emschwar>
"Ivan Marsh" <annoyed@you.now> writes:
> On Thu, 03 Jul 2003 11:45:27 +0000, Eric Schwartz wrote:
>
> > $ perl -i -pe 's/print\((.+?)(\\n)?"\);/print($1\\n");/g' input $ cat
>
> Ouch, now I know why I'm having a hard time learning regex.
>
> How does the if statement work?
> Assuming that the ? is an if statement.
It's not. Sounds like you should probably curl up some afternoon with
a copy of 'perldoc perlre'. If you had read it, you would have found
out that
The following standard quantifiers are recognized:
...
? Match 1 or 0 times
...
> Is that correct or am I still in the dark?
You're still in the dark. I snipped your explanation because, as
Neils Bohr is rumored to have said, "It's not right. It's not even
wrong."
It matches the literal string 'print('. Then it matches everything
(using the .+ part), only with the non-greedy modifier (which is ? in
this case), and saves it off in $1. I'll explain why this is
necessary in a minute. Then it searches for the optional literal
string '\n', and saves it off in $2. Then it matches the string
'");'.
All that is replaced by print($1\n"); The $1 has the opening quotes,
but you could change the regex to exclude that, and you could replace
it with print("$1\n"); if you wanted. Doing so is left as an
excercise for the reader.
Now, why did I make the .+ non-greedy? Simple. If I'd said
s/print\((.+)(\\n)?\);/..../g
then the .+ would have matched everything up to the next ')'. This
would have included any '\n' sequences. By making it non-greedy, it
will ensure the \\n matches a '\n' if it appears in the string.
> What's the /g do?
Applies the regex to multiple cases on the same line. For instance,
it would correct this line:
print("foo"); print("bar");
Without the /g, you'd only fix the first one.
Really, you need to spend quite some time with perlre. It explains
all this in great detail.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: 3 Jul 2003 13:54:16 -0700
From: me@jeffsu.com (Jeff)
Subject: Apache/Perl segfaulting on system calls
Message-Id: <b7ad4a98.0307031254.148da3c2@posting.google.com>
I seem to be getting sporadic segfaults when I make system calls in
mod_perl. They are happening when I use backticks, the system
command, and/or the open command with a pipe. Would anyone please
help me out?
Here's what I'm using...
OS: Red Hat Linux 8.0 (Psyche)
Perl: v5.8.0 i386-linux-thread-multi
Apache: 1.3.27
Thanks,
-Jeff
------------------------------
Date: Thu, 03 Jul 2003 16:07:13 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: Apache/Perl segfaulting on system calls
Message-Id: <xV0Na.43$hO4.88593@news.uswest.net>
Jeff wrote:
> I seem to be getting sporadic segfaults when I make system calls in
> mod_perl. They are happening when I use backticks, the system
> command, and/or the open command with a pipe. Would anyone please
> help me out?
>
> Here's what I'm using...
>
> OS: Red Hat Linux 8.0 (Psyche)
> Perl: v5.8.0 i386-linux-thread-multi
> Apache: 1.3.27
>
> Thanks,
> -Jeff
Some code would be helpful. Also, check your error log to see if
anything useful is in there.
------------------------------
Date: 3 Jul 2003 13:53:53 -0700
From: stuart@mohawk.net (Fourth Monkey)
Subject: AS repositories - so many, others missing, why?!
Message-Id: <616fce8f.0307031253.3fef9042@posting.google.com>
I've recently had to reinstall ActiveState Perl on a Win NT 4 PC and
am not able to duplicate the set of packages I had before (ver. 561),
using PPM, for either version 561 or 580! What I specifically noticed
is that for both vers., PPM insists on installing an older ("require
5.001;" -vs- "use 5.004;"), broken version of the XBase.pm package! I
scouted around and found 8 different ActiveState package repositories,
some for 5.6, some for 5.8, some for 5.005(?) along with some non-AS
ones:
http://www.activestate.com/PPMpackages/5.6/
http://ppm.activestate.com/PPMPackages/5.6plus/
http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/
http://www.activestate.com/ppmpackages/5.8-windows/
http://ppm.activestate.com/PPMPackages/zips/8xx-builds-only/Windows/
http://ppm.ActiveState.com/cgibin/PPM/ppmserver.pl?urn:/PPMServer
http://www.activestate.com/PPMpackages/5.005
http://www.activestate.com/PPMpackages/5.005/x86
http://theoryx5.uwinnipeg.ca/ppms/
http://theoryx5.uwinnipeg.ca/ppms/x86/
http://theoryx5.uwinnipeg.ca/ppmpackages
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
http://www.xmlproj.com/PPM/ (dead)
I think there were more as of late 2002 but I don't seem to have saved
them so I can't be sure.
I realize that A.S. "updated" their PPM system and thus had to change
the "location" of the most recent repository while also allowing
access to older ones so older installations would still work. But that
doesn't answer why I can no longer install all the packages I had
before (even though I'm not using the latest Perl) or why some
packages have degraded in version to ones that don't work as well.
If anyone can add to the above list I would appreciate that, perhaps
that's all I need to make my install work like it did before.
-Monkey
------------------------------
Date: 3 Jul 2003 21:45:47 GMT
From: randy@theoryx5.uwinnipeg.ca (Randy Kobes)
Subject: Re: AS repositories - so many, others missing, why?!
Message-Id: <slrnbg981v.3jt.randy@theoryx5.uwinnipeg.ca>
On 3 Jul 2003 13:53:53 -0700, Fourth Monkey <stuart@mohawk.net> wrote:
>I've recently had to reinstall ActiveState Perl on a Win NT 4 PC and
>am not able to duplicate the set of packages I had before (ver. 561),
>using PPM, for either version 561 or 580! What I specifically noticed
>is that for both vers., PPM insists on installing an older ("require
>5.001;" -vs- "use 5.004;"), broken version of the XBase.pm package! I
>scouted around and found 8 different ActiveState package repositories,
>some for 5.6, some for 5.8, some for 5.005(?) along with some non-AS
>ones:
[ .. ]
>I think there were more as of late 2002 but I don't seem to have saved
>them so I can't be sure.
>
>I realize that A.S. "updated" their PPM system and thus had to change
>the "location" of the most recent repository while also allowing
>access to older ones so older installations would still work. But that
>doesn't answer why I can no longer install all the packages I had
>before (even though I'm not using the latest Perl) or why some
>packages have degraded in version to ones that don't work as well.
In general, ActiveState's automated build system will add
a CPAN ppm package to their repository if the package (and any
dependencies outside of the core ActiveState distribution)
builds OK and all the tests pass. I'm not sure specifically
about the problem with XBase - there is a ppm package for
DBD-XBase (ActivePerl 8xx) that reports version 0.232, which
seems to correspond to the latest CPAN version.
>If anyone can add to the above list I would appreciate that, perhaps
>that's all I need to make my install work like it did before.
There's a module on CPAN - PPM::Repositories - which contains
a list of known repositories outside of ActiveState.
--
best regards,
randy kobes
------------------------------
Date: 3 Jul 2003 11:10:37 -0700
From: maximuszen@optonline.net (Max)
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <3a9c1232.0307031010.354ca718@posting.google.com>
Sinan,
Thanks for your feedback. I tried using the path but it didn't work...
my html directory is /var/www/html/dir1/dir2/file so I used
/dir1/dir2/file. It just printed out the path. In my other posting,
someone suggested using
print "Content-type: text/html\n\n
But something strange is happening now. I'm getting redirected to
http://search.netscape.com/nscp_results.adp?query=localhost&source=NSCPRedirect
I deleted the Content-type and Location line and I'm still getting
redirected...
The line before this statement is
while ($fetch->()) {print
$res2->{LastName},$res2->{FirstName},$res2->{MiddleName},$res2->{DOB},$res2{SSN},"<BR>";
Basically I'm fetching some data from a database and redirecting to
another html page.
Help.
What is a killfile?
John
"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns93ACACC3BFE96asu1cornelledu@132.236.56.8>...
> maximuszen@optonline.net (Max) wrote in
> news:3a9c1232.0307021051.2ba8fe56@posting.google.com:
>
> > "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message
> > news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8>...
> >>
> >> You can't get good answers without putting some effort into
> >> formulating your question. The posting guidelines for this group
> >> might help learn how:
> ...
> > That remark I wrote was intended towards a certain Jurgen Exner. I
> > read what you wrote in your message and I did post to the other group
> > as you advised. I appreciate the link you gave me, but it did not
> > solve the problem.
>
> From http://hoohoo.ncsa.uiuc.edu/cgi/primer.html:
>
> <blockquote>
> If you want to reference another file (not protected by access
> authentication) on your own server, you don't have to do nearly as much
> work. Just output a partial (virtual) URL, such as the following:
>
> Location: /dir1/dir2/myfile.html
>
>
> The server will act as if the client had not requested your script, but
> instead requested http://yourserver/dir1/dir2/myfile.html. It will take
> care of most everything, such as looking up the file type and sending the
> appropriate headers. Just be sure that you output the second blank line.
> </blockquote>
>
> Note the last sentence. Are you sure your code does that?
>
> > My guess is that those who are making the sarcastic
> > remarks have some insight into the problem but rather than sharing
> > their knowledge as this forum is meant to be are just shooting their
> > smart mouths off.
>
> No one is supposed to try to guess the information you did not provide, and
> you are suppose to do some of the work yourself. Since you have not given
> any new information, it is hard to come up with new suggestions. Try and
> give some context by providing a reasonable length script that exhibits the
> problem.
>
> Sinan.
------------------------------
Date: 3 Jul 2003 11:27:10 -0700
From: maximuszen@optonline.net (Max)
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <3a9c1232.0307031027.2a426516@posting.google.com>
I fixed the problem with the forwarding to netscape. For some reason
when I put the following code into the httpd.conf file to use Template
Toolkit, I got the forwarding to Netscape. But I still just get a
print out of what's inside the quotes. Does single or double quotes
make a difference?
PerlModule Apache::Template
# set various configuration options, e.g.
TT2IncludePath /usr/local/tt2/templates
TT2PreProcess header
TT2PostProcess footer
<Files *.tt2>
SetHandler perl-script
PerlHandler Apache::Template
</Files>
PerlModule Apache::MyTemplate
<Location /example2>
SetHandler perl-script
PerlHandler Apache::MyTemplate
</Location>
"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns93ACACC3BFE96asu1cornelledu@132.236.56.8>...
> maximuszen@optonline.net (Max) wrote in
> news:3a9c1232.0307021051.2ba8fe56@posting.google.com:
>
> > "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message
> > news:<Xns93AC6BFDB7AE7asu1cornelledu@132.236.56.8>...
> >>
> >> You can't get good answers without putting some effort into
> >> formulating your question. The posting guidelines for this group
> >> might help learn how:
> ...
> > That remark I wrote was intended towards a certain Jurgen Exner. I
> > read what you wrote in your message and I did post to the other group
> > as you advised. I appreciate the link you gave me, but it did not
> > solve the problem.
>
> From http://hoohoo.ncsa.uiuc.edu/cgi/primer.html:
>
> <blockquote>
> If you want to reference another file (not protected by access
> authentication) on your own server, you don't have to do nearly as much
> work. Just output a partial (virtual) URL, such as the following:
>
> Location: /dir1/dir2/myfile.html
>
>
> The server will act as if the client had not requested your script, but
> instead requested http://yourserver/dir1/dir2/myfile.html. It will take
> care of most everything, such as looking up the file type and sending the
> appropriate headers. Just be sure that you output the second blank line.
> </blockquote>
>
> Note the last sentence. Are you sure your code does that?
>
> > My guess is that those who are making the sarcastic
> > remarks have some insight into the problem but rather than sharing
> > their knowledge as this forum is meant to be are just shooting their
> > smart mouths off.
>
> No one is supposed to try to guess the information you did not provide, and
> you are suppose to do some of the work yourself. Since you have not given
> any new information, it is hard to come up with new suggestions. Try and
> give some context by providing a reasonable length script that exhibits the
> problem.
>
> Sinan.
------------------------------
Date: 3 Jul 2003 19:09:48 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <Xns93AD9A3F077EBasu1cornelledu@132.236.56.8>
maximuszen@optonline.net (Max) wrote in
news:3a9c1232.0307031010.354ca718@posting.google.com:
> Sinan,
>
> Thanks for your feedback.
For God's sake PLEASE stop top posting! If there is nothing of interest
in the post you are responding to, just delete everything before typing
anything.
> I tried using the path but it didn't work...
> my html directory is /var/www/html/dir1/dir2/file so I used
> /dir1/dir2/file. It just printed out the path. In my other posting,
> someone suggested using
>
> print "Content-type: text/html\n\n
>
> But something strange is happening now. I'm getting redirected to
>
> http://search.netscape.com/nscp_results.adp?query=localhost&source=NSCP
> Redirect
You mean to tell me that something like the example at:
http://www.unur.com/cgi-bin/redirect
is redirecting you to netscape.com?
Again, Apache configuration issues are beyond the scope of this group.
Bit by bit, you are giving details that might have been pertinent, but I
have neither the time nor the inclination after this to try to pull
information out of you.
> I deleted the Content-type and Location line and I'm still getting
> redirected...
>
> The line before this statement is
>
> while ($fetch->()) {print
> $res2->{LastName},$res2->{FirstName},$res2->{MiddleName},$res2->{DOB},$
> res2{SSN},"<BR>";
WTF?! How many times do you need to hear that the Location header needs
to be the first thing output from your script or else redirecting will
not work. The name might give you a clue: Header means something that is
at the head (beginning), you know?
> Basically I'm fetching some data from a database and redirecting to
> another html page.
That's not what you are doing. Is your script some kind of state secret
or something. This thread would have been long over and your problems
solved long ago if you had shown a reasonable length script.
> Help.
You are a troll.
> What is a killfile?
Somewhere I should have put you long time ago.
http://www.computerhope.com/jargon/k/killfile.htm
When people put you in their killfiles, they do not see your posts. That
means, they will not see your future questions, they will blissfully
avoid answering them.
Sinan.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 3 Jul 2003 13:56:10 -0700
From: maximuszen@optonline.net (Max)
Subject: Re: Automatic page forwarding in cgi perl script
Message-Id: <3a9c1232.0307031256.4c0f79d7@posting.google.com>
I found out the problem. The
print "Location: http://localhost/dir/dir/file";
is fine. You should view source on the output page. If there are
<HTML> tags like what I had it will just print out the contents of the
"".
Michael Budash <mbudash@sonic.net> wrote in message news:<mbudash-206D17.23392102072003@typhoon.sonic.net>...
> In article <3a9c1232.0307020544.c6c1635@posting.google.com>,
> maximuszen@optonline.net (Max) wrote:
>
> > "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> > news:<NRqMa.68$C43.41@nwrddc04.gnilink.net>...
> > > Max wrote:
> > > > print ("Location:
> > > > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html\n\n");
> > > >
> > > > Why won't this work?
> > >
> > > Works just fine for me.
> > > It prints the text
> > > Location:
> > > http://localhost/ElectronicMedicalRecord/OrderEntry/Orders.html
> > >
> > > to STDOUT. Did you expect it to do anything else?
> > >
> > > jue
> >
> > of course not... reading sometimes helps(like the subject line...) but
> > i have to admit your wit is brillant. i wish i had it.
> >
>
> welcome to everyone's killfile...
------------------------------
Date: Thu, 3 Jul 2003 16:50:50 +0100
From: "Paul Marquess" <paul.marquess@btinternet.com>
Subject: Re: BTree examples ??
Message-Id: <3f045140$0$10620$ed9e5944@reading.news.pipex.net>
"Jörg Westheide" <joerg@objectpark.org> wrote in message
news:0307KE7T+ienb+GcHIHRLKkXeg@objectpark.org...
> Hi Paul!
>
> > Can you elaborate on the performance issues on Win2k?
>
> Well, we have a program that reads data, stores them in a DB_File BTree
> and then reads and prints them (sorted).
> With some test data we had times of 40 minutes for a whole run under
> Linux. Under Win2K we killed it after 24 hours while it was still
> reading and storing the data. Profiling showed that inserting the data
> is the problem (and not in our code)
>
> > I don't do any development on Windows myself, and haven't had any
> > reports of bad performance (as far as I can remember).
>
> Maybe others don't use it with that much data. We had more than a
> million entries in the BTree and the db file grew to more than 1GB. It
> seemed to me that the perfomance became more worse the more data was
> stored. With only some 10,000 entries there was not a big difference
>
> > If there is a performance issue
> > with Windows, I'd like to fix it (if it is fixable), or document it
> > if it is not.
>
> I would like to see it fixed.
> If you need additional information, let me know
Hmm, that certainly is a big difference!
To take this any further, I need to reproduce the behaviour myself, so I
need a few more details on the data you are storing - for example, are all
keys fixed length? Are you using the default sorting algorithm that comes
with Btree? If not, can I see the user-defined sorting sub please? Is the
data in a completely random order or partially sorted?
Ideally, I'd like to have a look at the script you are using, plus a sample
of real data.
Paul
------------------------------
Date: Thu, 03 Jul 2003 11:37:54 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Call parent method indirectly
Message-Id: <Xns93AD80738E6E9sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Malte Ubl <ubl@schaffhausen.de> wrote in news:be16hb$32n$1@news.dtag.de:
> Eric J. Roode wrote:
>> How do you delegate to a parent method indirectly? This:
>>
>> $self->SUPER::$method(@args);
>
> my $super = "SUPER::$method";
> $self->$super(@args)
Interesting. I will try it.
>> Is there a way to do this without eval? I am using AUTOLOAD to
>> generate simple accessor/mutator methods in my class (table-driven
>> design), and want to delegate unknown methods to the parent class
>> (since many methods will be inherited from the parent).
>
> Maybe you want to use delegation to delegate (as opposed to
> inheritance)?
I'm sorry, I was using the word "delegate" loosely. :-)
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwRbz2PeouIeTNHoEQJ9GQCeMjozWvXlPlDGEtwqKZ3rGuaLqjkAoOLZ
BbrFtXFYxHMIEt7ZMl1eFo1S
=64Vv
-----END PGP SIGNATURE-----
------------------------------
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 5174
***************************************