[15491] in Perl-Users-Digest
Perl-Users Digest, Issue: 2901 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 29 00:05:23 2000
Date: Fri, 28 Apr 2000 21:05:09 -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: <956981109-v9-i2901@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Apr 2000 Volume: 9 Number: 2901
Today's topics:
Re: A can't find the beauty REGEXP <bmb@ginger.libs.uga.edu>
Re: A can't find the beauty REGEXP <uri@sysarch.com>
Re: A can't find the beauty REGEXP <lr@hpl.hp.com>
Re: A can't find the beauty REGEXP <uri@sysarch.com>
Re: a simple shopping cart required <sales@gboworld.com>
Re: Co <care227@attglobal.net>
Re: DBD::CSV Can't Find Text::CSV_XS <rootbeer@redcat.com>
Re: DBD::CSV Can't Find Text::CSV_XS <rootbeer@redcat.com>
Help with @inc error please.... <thetrader@worldnet.att.net>
help with @inc please <thetrader@worldnet.att.net>
Re: help with @inc please <rootbeer@redcat.com>
Help!! cannot redirect a frame document after submit <ericNOerSPAM@eworldresearch.com.invalid>
Re: Help: bol regexp in split string <rootbeer@redcat.com>
How do I update a list from another with common items? <jm.wood@home.com>
Re: How do I update a list from another with common ite <bmb@ginger.libs.uga.edu>
Re: how do you find perl? (Tad McClellan)
Re: Installing Modules In General (Tad McClellan)
Is there an auto array or variable that lists which sub <ctemp5NOctSPAM@specialmetals.com.invalid>
Re: Is there an auto array or variable that lists which <ctemp5NOctSPAM@specialmetals.com.invalid>
Re: mod-rewrite redirect using regexp <rootbeer@redcat.com>
Re: perl in NT .BAT files Question <brents@newsguy.com>
Re: perl in NT .BAT files Question <DNess@Home.Com>
Re: Something isn't working, and I can't figure it out <care227@attglobal.net>
Re: Something isn't working, and I can't figure it out <rootbeer@redcat.com>
Re: why is thi not working? (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Apr 2000 21:06:12 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: A can't find the beauty REGEXP
Message-Id: <Pine.A41.4.10.10004282100530.15944-100000@ginger.libs.uga.edu>
On Fri, 28 Apr 2000, Uri Guttman wrote:
[snip]
> DO> why not just s/\bWritelt/$1WriteThat/g
>
> well, because that won't work? you grabbed nothing to put into $1 and you
> spelled 'WriteIt' wrong. and he never said there was a word boundary
> before the word. maybe he wants FOOWriteIt to become FOOWriteThat.
>
> this is where lookbehind will work (i had posted earlier a case where it
> was overkill)
[snip]
On Fri, 28 Apr 2000, Larry Rosler wrote:
[snip]
> > why not just s/\bWritelt/$1WriteThat/g
>
> Because $1 has some unpredictable value?
>
> More to your point, he didn't say not to change 'fooWriteIt' to
> 'fooWriteThat'. The only specific exclusion was 'SolidWriteIt', as he
> showed in his attempt. So a negative lookbehind is called for.
[snip]
Wow! That's impressive. Even the examples are practically identical.
--
Brad
------------------------------
Date: Sat, 29 Apr 2000 01:14:46 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: A can't find the beauty REGEXP
Message-Id: <x77ldh1zei.fsf@home.sysarch.com>
>>>>> "BB" == Brad Baxter <bmb@ginger.libs.uga.edu> writes:
BB> On Fri, 28 Apr 2000, Uri Guttman wrote:
>> well, because that won't work? you grabbed nothing to put into $1 and you
>> spelled 'WriteIt' wrong. and he never said there was a word boundary
>> before the word. maybe he wants FOOWriteIt to become FOOWriteThat.
BB> On Fri, 28 Apr 2000, Larry Rosler wrote:
>> More to your point, he didn't say not to change 'fooWriteIt' to
>> 'fooWriteThat'. The only specific exclusion was 'SolidWriteIt', as he
>> showed in his attempt. So a negative lookbehind is called for.
BB> [snip]
BB> Wow! That's impressive. Even the examples are practically identical.
great minds?
but foo is so popular anyway.
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: Fri, 28 Apr 2000 18:35:33 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: A can't find the beauty REGEXP
Message-Id: <MPG.1373dc3cf73fce9098a9b4@nntp.hpl.hp.com>
In article <Pine.A41.4.10.10004282100530.15944-
100000@ginger.libs.uga.edu> on Fri, 28 Apr 2000 21:06:12 -0400, Brad
Baxter <bmb@ginger.libs.uga.edu> says...
> On Fri, 28 Apr 2000, Uri Guttman wrote:
> [snip]
> > DO> why not just s/\bWritelt/$1WriteThat/g
> >
> > well, because that won't work? you grabbed nothing to put into $1 and you
> > spelled 'WriteIt' wrong. and he never said there was a word boundary
> > before the word. maybe he wants FOOWriteIt to become FOOWriteThat.
> >
> > this is where lookbehind will work (i had posted earlier a case where it
> > was overkill)
> [snip]
>
>
> On Fri, 28 Apr 2000, Larry Rosler wrote:
> [snip]
> > > why not just s/\bWritelt/$1WriteThat/g
> >
> > Because $1 has some unpredictable value?
> >
> > More to your point, he didn't say not to change 'fooWriteIt' to
> > 'fooWriteThat'. The only specific exclusion was 'SolidWriteIt', as he
> > showed in his attempt. So a negative lookbehind is called for.
> [snip]
>
> Wow! That's impressive. Even the examples are practically identical.
Joined at the hip?
But he caught one more error than I did. It must be my newsreader font.
Yes, that's it, it's the font!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 29 Apr 2000 03:28:07 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: A can't find the beauty REGEXP
Message-Id: <x74s8l1t89.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> But he caught one more error than I did. It must be my newsreader
LR> font. Yes, that's it, it's the font!
you always blame your shorcomings on something else. be a man and take
the responsibility. what did the font ever do to you to deserve such a
harsh condemnation? shame on you!
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: Sat, 29 Apr 2000 02:54:44 GMT
From: gboworld.com <sales@gboworld.com>
Subject: Re: a simple shopping cart required
Message-Id: <8editf$eph$1@nnrp1.deja.com>
We have designed a frame shopping cart,
and a window shopping cart.
if interested, please visit
http://www.gboworld.com/index.html
In article <8ec7p8$24o$1@gxsn.com>,
"m a r k d w" <mark@markdw.com> wrote:
> Dear Group,
>
> I am after a simple shopping cart script. I have looked on the usual
freebie
> sites but all of the scripts I have found have been really over
complicated
> and don't really do what I want them to do..
> I will be selling advertising space on a website at £5 a go, so the
user
> will need to be able to type in the advert subject and sale price and
then
> submit it to the shopping basket. Then, in the usual shopping cart
way, they
> should be able to continue shopping and adding, deleting items from
their
> cart etc. Then at the checkout all I need to calculate is the total
price to
> send to the payment service I am using and an e-mail containing the
items to
> be sent to me and a confirmation to be sent the customer.
> The scripts I have looked at so far only allow set items to be added
to the
> cart. Even though all my items are the same price, there needs to be
3 or 4
> fields the user can fill in.
> If anyone can point me in the right direction I will be very
gratefull, or
> if someone wants to give me a quote for writing me a script like this
please
> mail me - mark@markdw.com
>
> Many thanks in advance,
>
> Mark Williams
> mark@markdw.com
>
>
--
Thanks,
gboworld.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Apr 2000 23:33:16 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Co
Message-Id: <390A57FC.94633510@attglobal.net>
Larry Rosler wrote:
>
> [What did you have in mind for a Subject? 'Co' just doesn't convey
> much. :-]
>
Hmm. I started the post, then decided to re re-read the docs. Then I
went to lunch, came back and took a break. I really have no idea what
I intended the subject to be. I can't think of any word starting with
"Co" that I could have been using to describe my question. Im as
confused by this as can be. =(
------------------------------
Date: Fri, 28 Apr 2000 19:50:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: DBD::CSV Can't Find Text::CSV_XS
Message-Id: <Pine.GSO.4.10.10004281944590.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Gabe wrote:
> I've been tring to install DBD::CSV and I keep getting the message:
> Checking for Text::CSV_XS, 0.16 or later ...
> You don't have installed the Text::CSV_XS package, version 0.16 or later.
Well, it looks as if perhaps your perl's @INC doesn't include a proper
installation of that module. Could you have more than one perl binary on
your machine? Does this command tell you anything interesting?
perl -wl -MText::CSV_XS -e 'print $Text::CSV_XS::VERSION;'
Could you have that module in your own private module dir? In that case,
you could try a command something like this, and see what you get.
PERL5LIB='/my/lib/dir' perl Makefile.PL
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 20:24:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: DBD::CSV Can't Find Text::CSV_XS
Message-Id: <Pine.GSO.4.10.10004282023060.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, I wrote:
> Could you have that module in your own private module dir? In that case,
> you could try a command something like this, and see what you get.
>
> PERL5LIB='/my/lib/dir' perl Makefile.PL
Of course, you may need another parameter to this command if you wish to
install the new module into your own private module directory; I forgot to
say so. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 01:52:19 GMT
From: "Free Lance" <thetrader@worldnet.att.net>
Subject: Help with @inc error please....
Message-Id: <nfrO4.39548$WF.1980351@bgtnsc04-news.ops.worldnet.att.net>
I get this error when trying to call
use LWP::Simple;
I know the module is in there at :
/usr/local/lib/site_perl/LWP/Simple.pm
but keep getting this error:
Can't locate LWP/Simple.pm in @INC (@INC contains:
/usr/libdata/perl/5.00503/mac
h /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd /u
sr/local/lib/perl5/site_perl/5.005 .) at parseentry.cgi line 3.
Could someone help or propose a solution?
Thanks
------------------------------
Date: Sat, 29 Apr 2000 01:55:23 GMT
From: "Free Lance" <thetrader@worldnet.att.net>
Subject: help with @inc please
Message-Id: <firO4.39550$WF.1979408@bgtnsc04-news.ops.worldnet.att.net>
I get this error when trying to call
use LWP::Simple;
I know the module is in there at :
/usr/local/lib/site_perl/LWP/Simple.pm
but keep getting this error:
Can't locate LWP/Simple.pm in @INC (@INC contains:
/usr/libdata/perl/5.00503/mac
h /usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd /u
sr/local/lib/perl5/site_perl/5.005 .) at parseentry.cgi line 3.
Could someone help or propose a solution?
Thanks
------------------------------
Date: Fri, 28 Apr 2000 20:07:06 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: help with @inc please
Message-Id: <Pine.GSO.4.10.10004282002410.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000, Free Lance wrote:
> Subject: help with @inc please
Please don't post the same article multiple times. If you're not sure
whether posting is successful, try a newsgroup with 'test' in the name.
Thanks.
> I get this error when trying to call
> use LWP::Simple;
>
> I know the module is in there at :
> /usr/local/lib/site_perl/LWP/Simple.pm
>
> but keep getting this error:
> Can't locate LWP/Simple.pm in @INC (@INC contains:
> /usr/libdata/perl/5.00503/mac
That's not the location of the module.
> h /usr/libdata/perl/5.00503
That's not the location - and it's a little odd. Did you miss the
line-wrapping?
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /u
That doesn't look like the location either.
> sr/local/lib/perl5/site_perl/5.005 .) at parseentry.cgi line 3.
Nor does that, but I'm pretty sure you're having problems with the line
breaks.
> Could someone help or propose a solution?
I hope that proposing a solution counts as help. :-)
Check what the FAQ says about keeping your own directory for modules, and
see the docs for the 'lib' pragma. Also, if someone installed this module
in some other way than via a command like 'make install', it looks as if
they did it wrong, and should probably go back and try again.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 21:46:31 -0700
From: ec <ericNOerSPAM@eworldresearch.com.invalid>
Subject: Help!! cannot redirect a frame document after submit
Message-Id: <12b4ac27.de434058@usw-ex0110-076.remarq.com>
Hi,
I'm fairly new to Perl, and I'm having a very hard time
trying to redirect a document in perl/cgi. Here is the
scoop. I have a two frame frameset (split-screen) document
with a FORM in the bottom frame. Once the user hits submit
and the data is sent and manipulated at the server's cgi
script, I'm trying to redirect a URL document to the
browser's window (the frame's parent), but I get an Internal
Server error. I've also tried to redirect a new document to
the orignal frame, but nothig. I have tried multiple
combinations of the print redirect() function, using -URL
and -TARGET => "_parent", but nothing.
Any help on this issue will be greatly appreciated.
EC
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
Date: Fri, 28 Apr 2000 19:57:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help: bol regexp in split string
Message-Id: <Pine.GSO.4.10.10004281951050.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000 occitan@esperanto.org wrote:
> Hi folks!
Saluton, samlingvano!
> My iPerl allows embedding bits of Perl in text documents by way of !{
> ... }! anywhere, possibly spanning several lines, or whole lines
> starting with !, as in:
>
> text text !{ Perl code }! text
> ! Perl code
> text
> !{ Perl
> code
> }!
> text
>
> The way this is implemented is by having the whole document in a
> string and successively shaving of beginnings up to and including a
> bit of Perl for transformation.
Probably better to use Parse::RecDescent, or a well-crafted regular
expression in s///, perhaps.
> This is done by applying various functions, like this one (in the bang
> style using !, the first 2 lines of regexp do 2 more things),
> returning leading text, one or another bit of Perl and following text
> on which it'll be applied in the next round:
>
> $splitter = sub {
> return $`, $1, $2 || $3 || $4, $'
> if $_[0] =~ /
> ^\# .* \n? |
> !< ([\s\S]*?) >! |
> !\{ ([\s\S]*?) \}! | !(\})! |
> ^! (.*) \n?
> /mx;
> @_;
> };
>
> The problem occurs when the text contains a ! right after a bit of Perl:
Yes; it's pretty tough to get a hairy regular expression like that to be
correct. You may be able to get something out of Jeffrey Friedl's
excellent book, Mastering Regular Expressions. But I'd probably use
Parse::RecDescent for this; that should make it pretty simple. (I hope!)
> On another topic, in this case, most of $1 thru $4 are not defined. Is
> there an elegant way to rewrite this such that I can use perl -w?
Check to see whether they're defined before you use them. :-)
if (defined $2) { ... }
Gxuu!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 01:23:19 GMT
From: "AEF" <jm.wood@home.com>
Subject: How do I update a list from another with common items?
Message-Id: <bQqO4.9338$95.75097@news1.rdc1.mb.home.com>
Two lists of employees.
List one.
$seniority $last_name $initials $date_hire $date_service
List two is updated for retirements with a list of new seniority numbers.
$new_sen $last_name $initials
What is the best way to go about matching the two lists to get the new
seniority number matched with
the date of hire and date of service?
I'd like the end product to be:
$new_sen $last_name $initials $date_hire $date_service
Thanks.
------------------------------
Date: Fri, 28 Apr 2000 22:17:25 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: How do I update a list from another with common items?
Message-Id: <Pine.A41.4.10.10004282203090.15944-100000@ginger.libs.uga.edu>
On Sat, 29 Apr 2000, AEF wrote:
> Two lists of employees.
> List one.
> $seniority $last_name $initials $date_hire $date_service
> List two is updated for retirements with a list of new seniority numbers.
> $new_sen $last_name $initials
> What is the best way to go about matching the two lists to get the new
> seniority number matched with
> the date of hire and date of service?
> I'd like the end product to be:
> $new_sen $last_name $initials $date_hire $date_service
> Thanks.
Here's one approach:
1 #!/usr/local/bin/perl -w
2 use strict;
3
4 # $seniority $last_name $initials $date_hire $date_service
5 my @list1 = (
6 [ 's1', 'ln1', 'i1', 'dh1', 'ds1' ],
7 [ 's2', 'ln2', 'i2', 'dh2', 'ds2' ],
8 [ 's3', 'ln3', 'i3', 'dh3', 'ds3' ],
9 [ 's4', 'ln4', 'i4', 'dh4', 'ds4' ],
10 );
11 # $new_sen $last_name $initials
12 my @list2 = (
13 [ 'NS1', 'ln1', 'i1',],
14 [ 'NS2', 'ln2', 'i2',],
15 [ 'NS3', 'ln3', 'i3',],
16 );
17 my %hash;
18 $hash{$_->[1]}{$_->[2]} = ['N/A', $_->[3], $_->[4]]
19 foreach ( @list1 );
20 $hash{$_->[1]}{$_->[2]}[0] = $_->[0]
21 foreach ( @list2 );
22
23 # I'd like the end product to be:
24 # $new_sen $last_name $initials $date_hire $date_service
25 foreach my $ln ( sort keys %hash ) {
26 print "$hash{$ln}{$_}[0] $ln $_ @{$hash{$ln}{$_}}[1,2]\n"
27 foreach ( sort keys %{$hash{ $ln }} );
28 }
Output:
NS1 ln1 i1 dh1 ds1
NS2 ln2 i2 dh2 ds2
NS3 ln3 i3 dh3 ds3
N/A ln4 i4 dh4 ds4
I used "N/A" to illustrate the case when list1 is longer than list2.
You'll have to figure out what to do if list2 is the longer. Perhaps
they're both always equal length ...
Also, I'm assuming that your lists aren't so long that they can't be
held in memory.
--
Brad
------------------------------
Date: Fri, 28 Apr 2000 20:47:05 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how do you find perl?
Message-Id: <slrn8gkc89.3v2.tadmc@magna.metronet.com>
On Fri, 28 Apr 2000 15:54:06 -0400, Brian Smith <mrsparkle@gamerzuniverse.com> wrote:
>Ok, I built a linut box running latest version of RedHat to run and test
>perl that I write. How do I find where perl is located?
which perl
or
whereis perl
>I think its
>/usr/bin/perl but I keep getting internal server errors when I try to run my
^^^^^^^^^^^^^
>scripts.
Please ask CGI questions in a newsgroup related to CGI, such as:
comp.infosystems.www.authoring.cgi
(you can tell that it is a CGI question because Perl doesn't
_have_ a server)
>And I know they work fine.
How do you know?
Did you try:
/usr/bin/perl -w myscript
??
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 28 Apr 2000 20:36:22 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Installing Modules In General
Message-Id: <slrn8gkbk6.3v2.tadmc@magna.metronet.com>
On Fri, 28 Apr 2000 13:42:26 -0700, Gabe <grichard@uci.edu> wrote:
>> Of course, it's even easier to use the CPAN module in most cases:
>>
>> perl -MCPAN -e shell
>
>I don't understand this. Can you explain what it does and why it's useful or
>point me to the relevant documentation?
for -e and -M:
perldoc perlrun
for the CPAN.pm module:
perldoc CPAN
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 28 Apr 2000 19:30:10 -0700
From: Richard A. DeVenezia <ctemp5NOctSPAM@specialmetals.com.invalid>
Subject: Is there an auto array or variable that lists which subs are defined in my program ?
Message-Id: <27080b08.06e132c8@usw-ex0102-016.remarq.com>
I have a form which allows a user to enter a 'method' to run.
The method is a sub in a perl program.
e.g. input field method has value xyz entered into it and a form
is submitted.
$method = $q->param('method');
# Is there a way I can check if xyz is a sub before calling the
sub $method ?
&$method();
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 28 Apr 2000 19:58:06 -0700
From: Richard A. DeVenezia <ctemp5NOctSPAM@specialmetals.com.invalid>
Subject: Re: Is there an auto array or variable that lists which subs are defined in my program ?
Message-Id: <00579a70.0e2ac76a@usw-ex0102-016.remarq.com>
Never mind (blush)
if (defined &$method) { &$method(); }
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 28 Apr 2000 20:22:37 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: mod-rewrite redirect using regexp
Message-Id: <Pine.GSO.4.10.10004282019230.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Dimitri Ostapenko wrote:
> I'm sorry to post this here, but I already tried
> com.infosystems.www.servers and couldn't get an answer.
So, if we can't help you, will you try rec.pets.cats next? :-)
If your question didn't get an answer the first time you asked it, there
may be a good reason for that. Maybe it was unclear what you wanted.
Maybe it looked like you were asking for a fish, rather than asking to
learn how to fish. Maybe nobody has an answer. Maybe you didn't wait
long enough before you gave up. Maybe it wasn't the most appropriate
newsgroup. There are lots of possible reasons. Posting again isn't
likely to fix any of them, unless you've changed something.
If you've asked clearly and no one has responded in a reasonable amount
of time, there's something else you can try before asking again. In
reading the newsgroup during the last month (you _have_ been doing that,
haven't you?) you must have noticed at least two or three people who
post frequently, politely, and accurately. A short, polite letter by
private e-mail to one of these folks asking for meta-help (help on
getting help on your problem) would not be out of line.
> I need to redirect to perl script based on substring in URL:
Could it be that you want to search for the docs, FAQs, and newsgroups
about how to tell a browser what to do? You may get some benefit from the
newsgroup comp.infosystems.www.authoring.cgi.
> RewriteEngine On
> RewriteBase /
> RewriteRule ^([^?&]+)[?&]client=([^/?&]+)redir.pl?file=$1&client=$2 [NC]
Are those Apache codes, or what? You may need docs for your webserver, or
for whatever piece of software likes to read code like that. :-)
Good luck with your project!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 20:32:35 -0500
From: Brent Stroh <brents@newsguy.com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <mrdkgssflvkrs9au58rdr5d731vu7cfoj3@4ax.com>
David Ness <DNess@Home.Com> wrote:
>I have successfully used, but without completely understanding, a
>Windows/perl `pun' under NT which allows a single file to contain both the OS
>commands to execute perl and the perl code itself. I don't remember the source
>of this pun, but it has been a part of lots of my perl work for the last
>couple of years, and some help about the use of '-w' and `strict'
>now cause me to want to see if there is a better way to do things
>with respect to this fragment.
---8<---
>Alternatively, is there some better way to handle this whole problem in
>Windows/perl?
From a shell prompt (CMD), use 'set' to show all the environment variables.
You should find PATHEXT=.COM;.EXE;.BAT;.CMD in there somewhere. Go to
Start->Settings->Control Panel->System->Environment and add this to the
values shown there. For some reason, all the environment variables aren't
shown. When you add it, include ;.PL (or whatever you use as a Perl
extension) at the end. This change allows you to use your Perl code just
like batch files - instead of typing 'foo.pl', you can just use 'foo'.
Now, from an Explorer window, go to View->Folder Options->File Types->New
Type. Create a Perl Script file type, with an Open action. For
'Application Used...' you want to fill in "D:\Perl\bin\Perl.exe "%1" %*" or
whatever the appropriate path on your system is. While you're in here, it
might be useful to add an Edit action, and set it up to call your favorite
editor. Then, you've got right-click access to that, also.
If you do modules, go ahead and create a .PM, also.
ActiveState's install will handle the Explorer association for you. I
don't think it does the PATHEXT trick, though.
The nice thing about doing this via associations, rather than batch files
and arcane trickery is that the code looks normal, and is completely
portable to *nix.
------------------------------
Date: Sat, 29 Apr 2000 01:55:56 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <390A4134.6B838228@Home.Com>
Brent Stroh wrote:
>
> From a shell prompt (CMD), use 'set' to show all the environment variables.
> You should find PATHEXT=.COM;.EXE;.BAT;.CMD in there somewhere. Go to
> Start->Settings->Control Panel->System->Environment and add this to the
> values shown there. For some reason, all the environment variables aren't
> shown. When you add it, include ;.PL (or whatever you use as a Perl
> extension) at the end. This change allows you to use your Perl code just
> like batch files - instead of typing 'foo.pl', you can just use 'foo'.
>
> Now, from an Explorer window, go to View->Folder Options->File Types->New
> Type. Create a Perl Script file type, with an Open action. For
> 'Application Used...' you want to fill in "D:\Perl\bin\Perl.exe "%1" %*" or
> whatever the appropriate path on your system is. While you're in here, it
> might be useful to add an Edit action, and set it up to call your favorite
> editor. Then, you've got right-click access to that, also.
>
> If you do modules, go ahead and create a .PM, also.
>
> ActiveState's install will handle the Explorer association for you. I
> don't think it does the PATHEXT trick, though.
>
> The nice thing about doing this via associations, rather than batch files
> and arcane trickery is that the code looks normal, and is completely
> portable to *nix.
Thanks for the information. What you say makes perfect sense to me, and
although I sure didn't know it was possible, I am happy to try it...
My one concern is that this sounds right at the frontier of where 98 may
differ from NT and from Win2K, but I'll give it a try all three places...
Thanks for taking the trouble to explain.
------------------------------
Date: Fri, 28 Apr 2000 23:40:40 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Something isn't working, and I can't figure it out
Message-Id: <390A59B8.66FF53A1@attglobal.net>
Makarand Kulkarni wrote:
>
> > print start_form(-action=>'/cgi-bin/addpage.cgi', -method=>POST),
> > hidden(-name=>'acct_id', -value=>'$acct'),
>
> here the hidden acct_id value gets set to the string "$acct" and NOT the value of
> $acct.
No, that line works fine. Its spattered all over everywhere, and
the field is printed properly in the HTML output. The problem is
somewhere in the file creation. Im gonna find it if it kills me.
But, Ive learned a few things along the way about Perl. One more
shouldn't be the end of me yet.
-DS
------------------------------
Date: Fri, 28 Apr 2000 20:50:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Something isn't working, and I can't figure it out
Message-Id: <Pine.GSO.4.10.10004282045010.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Drew Simonis wrote:
> Makarand Kulkarni wrote:
> >
> > > print start_form(-action=>'/cgi-bin/addpage.cgi', -method=>POST),
> > > hidden(-name=>'acct_id', -value=>'$acct'),
> >
> > here the hidden acct_id value gets set to the string "$acct"
> > and NOT the value of $acct.
>
> No, that line works fine. Its spattered all over everywhere, and
> the field is printed properly in the HTML output.
If that line of code passes the value of the variable $acct rather than
the five-character string '$acct' to start_form, then there's something
seriously (and very surprisingly!) wrong with your perl.
Please, check again. Could your real code perhaps use no quotes or double
quotes around the item after '-value'? Could it be that you're seeing the
value of $acct elsewhere in your output?
If you're certain that this is really working as you say, please cut your
code down to the smallest possible self-contained example which shows this
behavior, then please post that. Thanks.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 20:43:12 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: why is thi not working?
Message-Id: <slrn8gkc10.3v2.tadmc@magna.metronet.com>
On Fri, 28 Apr 2000 16:52:05 -0400, Brian Smith <mrsparkle@gamerzuniverse.com> wrote:
>it's actually
>
>print "Content-type: text/html\n\n";
>print 'hello world';
>
>i got help on it.. now it work with above text..
You really shouldn't lie to the browser like that.
Either give it HTML when you say that you are going to
give it HTML, or say that you are giving it text/plain.
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 2901
**************************************