[24306] in Perl-Users-Digest
Perl-Users Digest, Issue: 6497 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 1 00:05:36 2004
Date: Fri, 30 Apr 2004 21:05:06 -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 Fri, 30 Apr 2004 Volume: 10 Number: 6497
Today's topics:
Re: Books online???? <catcher@linuxmail.org>
Re: CGI.pm Escaping query strings - ampersand issue <invalid-email@rochester.rr.com>
Re: First edition of _Programming perl_, how useful is (Alex Withers)
Re: free source search engine (simple) ## comments? <gnari@simnet.is>
Re: free source search engine (simple) ## comments? <webmaster @ infusedlight . net>
hope this is easy, passing a url as a parameter <dannywork5@hotmail.com>
Re: hope this is easy, passing a url as a parameter <postmaster@castleamber.com>
Re: How to define a sub on the fly? (Malcolm Dew-Jones)
Re: MSSQL 2000 Connect Success <invalid-email@rochester.rr.com>
Re: OSs with Perl installed <matthew.garrish@sympatico.ca>
Re: OSs with Perl installed <abigail@abigail.nl>
Re: OSs with Perl installed <abigail@abigail.nl>
Re: OSs with Perl installed <lv@aol.com>
Re: OSs with Perl installed <jtc@shell.dimensional.com>
Re: OSs with Perl installed <matthew.garrish@sympatico.ca>
Re: OSs with Perl installed <postmaster@castleamber.com>
Re: print $query->scrolling_list <kkeller-usenet@wombat.san-francisco.ca.us>
Re: print $query->scrolling_list <invalid-email@rochester.rr.com>
Re: problem with pattern match <xxala_qumsiehxx@xxyahooxx.com>
reducing a regex <g-preston1@ti.com>
Re: reducing a regex <noreply@gunnar.cc>
Re: reducing a regex <spamtrap@dot-app.org>
what is purpose of 1; at end of scripts <dannywork5@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 30 Apr 2004 22:02:19 -0400
From: Robert <catcher@linuxmail.org>
Subject: Re: Books online????
Message-Id: <mfadnfwcsMu2mA7dRVn-ig@adelphia.com>
Henry Williams wrote:
> I have been researching Perl extensively for the last 3 weeks. Along
> the way I have found several Internet sites that have all the O'Reilly
> books on perl, online. The even have the copyright notice published
> along with all the books and all the chapters. The copyright clearly
> states:
>
> "This CD-ROM is intended for use by one individual. As such, you may
> make copies for your own personal use. However, you may not provide
> copies to others, or make this reference library available to others
> over a LAN or other network."
>
> However it is readily available on the Internet everywhere you care to
> hunt. I have resisted mass downloading these sites but do wonder, have
> any of you all noticed the same?
>
> I buy all my books but wonder what's up with all this? I am not
> posting URL's but that is a scarce barrier, as they are everywhere.
>
> I will add that if not for O'Reilly my IQ would be reduced by 15%. So
> to that extent I appreciate them a good deal. They have held me in
> good stead for years.
>
> What's up with all that? Heck you can get the real book from eBay for
> pennies on the dollar. And I'd rather fall asleep with a good book, in
> lieu of more favorable circumstances.
>
> HW
>
They are out there and you should report them to O'Reilly.
------------------------------
Date: Sat, 01 May 2004 01:44:01 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: CGI.pm Escaping query strings - ampersand issue
Message-Id: <4092FFFA.6040006@rochester.rr.com>
Matthew Salerno wrote:
> I have a cgi/mod_perl script that at one point it generates url's based on
> directories:
>
> foreach (@dirs){
> my $lnk = qq|<A HREF="index.cgi?List=$_&TestID=$testid" TARGET="$testid"
> ONCLICK="window.open('index.cgi?List=$_&testid=$testid',
> '$testid','toolbar=no,location=no,directories=no,status=no,menubar=no,scroll
> bars=yes,resizable=yes, width=450,height=230,left=100,top=100'); return
> false">|;
> print "$lnk1 here </a><br>";
> }
>
> The problem is that some of the directories contain ampersands "&".
>
> If there is an ampersand in the directory name, the the rest of the query
> string gets all messed up.
>
> ex.
> If the directory is titled:
> Paperwork_&_Cover
> The URL becomes
> http://testserv/index.cgi?List=Paperwork_&_Cover&testID=70821
>
> Before the print statement, I have tried the following:
>
> escape($lnk);
> Gives me:
> Software error:
> /TestDocs/70822/Paperwork_ No Documents in this system No such file or
> directory at /docs/index.cgi line 345.
>
> $_ =~ s/\&/\&\;/g;
> Gives me:
> Software error:
> /TestDocs/70822/Paperwork_ No Documents in this system No such file or
> directory at /docs/index.cgi line 345.
>
> $_ =~ s/\&/%26/g;
> Gives me:
> Software error:
> /TestDocs/70822/Paperwork_%26_Cover No Documents in this system No such file
> or directory at /docs/index.cgi line 345.
>
> I am going nuts trying to figure out how to get this to work. Can anyone
> offer up a bit of wisdom.
...
> Matt
Just a WAG: Try something like:
for(@dirs){
my $i=$_;
$i=s/&/%26/g;
... #using $i instead of $_
}
It looks like the errors might possibly be coming from something you are
doing with array @dir later on, and the code you have is placing the
escape codes into @dir, which then means @dir won't work when used for
other stuff later. I say this mostly because the errors you are getting
don't appear to be from a browser, but from Perl.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 1 May 2004 02:00:35 +0000 (UTC)
From: awithers@barney.gonzaga.edu (Alex Withers)
Subject: Re: First edition of _Programming perl_, how useful is it?
Message-Id: <slrnc96183.ruf.awithers@barney.gonzaga.edu>
On Fri, 30 Apr 2004, John J. Trammell wrote:
>On Fri, 30 Apr 2004 18:24:17 +0000 (UTC), Alex Withers wrote:
>
>> I have a first edition of _Programming perl_ and I am curious as to
>> how much of it is obsolete and/or irrelevant.
>
>It's 100% obsolete and irrelevant. Perl 4 is dead, dead, dead.
>
>But I'll buy it from you, if it's in good shape.
>
Not mine to sell, just to use. Thanks anyway.
Alex
------------------------------
Date: Sat, 1 May 2004 01:15:54 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6utlj$ao4$1@news.simnet.is>
"Robin" <webmaster @ infusedlight . net> wrote in message
news:c6usr4$lje$1@reader2.nmix.net...
>
> > you were also told by a more mischievous soul not to distribute
> > cgi scripts publicly because they are full of security holes,
> > and easily abused. this script , for example, can be used to hack
> > your site (again).
>
> how can this one be used to hack my site? I'm curious...
it is a consequence of your habit of keeping securty related files
in your web directory. in the same directory where your
'search engine' is reading. do you see the implications of that ?
gnari
------------------------------
Date: Fri, 30 Apr 2004 18:59:14 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6v3qu$nls$1@reader2.nmix.net>
"gnari" <gnari@simnet.is> wrote in message
news:c6utlj$ao4$1@news.simnet.is...
> "Robin" <webmaster @ infusedlight . net> wrote in message
> news:c6usr4$lje$1@reader2.nmix.net...
> >
> > > you were also told by a more mischievous soul not to distribute
> > > cgi scripts publicly because they are full of security holes,
> > > and easily abused. this script , for example, can be used to hack
> > > your site (again).
> >
> > how can this one be used to hack my site? I'm curious...
>
> it is a consequence of your habit of keeping securty related files
> in your web directory. in the same directory where your
> 'search engine' is reading. do you see the implications of that ?
>
what's your definition of a security related file? My stuff is mainly just
my personal site and zip files for various scripts and doc files...
-Robin
------------------------------
Date: Sat, 01 May 2004 03:43:45 GMT
From: "Danny" <dannywork5@hotmail.com>
Subject: hope this is easy, passing a url as a parameter
Message-Id: <R1Fkc.66816$Gd3.15983323@news4.srv.hcvlny.cv.net>
I am trying to pass a parameter to a cgi script, it is a URL that has its
own call to a cgi script with ? in statement.
for example
so my cgi (load.cgi) is getting confused because of the extra ? in the
statement.
my cgi redirects to the passed url
I call it like this:
www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin/pro
ducts.cgi?search=volvo
what do I do to get that entire url, right now it is stopping at the other ?
Thanks in advance
------------------------------
Date: Fri, 30 Apr 2004 22:55:50 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: hope this is easy, passing a url as a parameter
Message-Id: <40931fc8$0$198$58c7af7e@news.kabelfoon.nl>
Danny wrote:
> I am trying to pass a parameter to a cgi script, it is a URL that has its
> own call to a cgi script with ? in statement.
> for example
>
> so my cgi (load.cgi) is getting confused because of the extra ? in the
> statement.
> my cgi redirects to the passed url
>
> I call it like this:
> www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin/pro
> ducts.cgi?search=volvo
Encode the URL, this is wrong.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
------------------------------
Date: 30 Apr 2004 20:56:32 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: How to define a sub on the fly?
Message-Id: <40931ff0@news.victoria.tc.ca>
kj (socyl@987jk.com) wrote:
: Can someone please show me how to define a sub Foo::Bar::baz on
: the fly (i.e. when the module is loaded)?
Since that's the normal case, I'll assume you mean you want to define it
in an unusual manner. The following probably defines two subs called baz
and boz, though I can't test it while using this computer.
foreach $baz (qw(baz boz))
{ eval qq{
sub Foo::Bar::$baz
{ print "This is sub Foo Bar $baz\n";
}
};
}
(oh dear, ATARI sm125 appears to be toasting, bye bye to an old faithful
companion. I wonder if this will make sense. Better stop typing
------------------------------
Date: Sat, 01 May 2004 02:06:23 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: MSSQL 2000 Connect Success
Message-Id: <40930538.5010601@rochester.rr.com>
Henry Williams wrote:
...
> All the heck I wanted to do was to connect via a DSN to a darn MSSQL
> server, and get some data. I would have thought that was sort of
> germane given the pervasiveness of Microsoft in the land. With Active
> Perl being free, and with the availability of Tk, I rather expect Perl
> to take over the known world, except for maybe Bali or Taos.
...
>
> #!perl
> use warnings;
> use Win32::ODBC;
>
> $db = new Win32::ODBC( "MyDSN" ) || die "Error: " .
> Win32::ODBC::Error();
> if( ! $db->Sql( "SELECT * FROM tHe_NamE_Of_your_tAbLe" ) )
> {
> while( $db->FetchRow() )
> {
> my( @list ) = $db->Data();
> print "@list";
> print "\n" ;
> }
> }
> $db->Close();
...
> Henry
Well, you would be far better off if you:
use DBI;
rather than Win32::ODBC. With DBI, when you graduate to a better
database and/or OS, you won't have to modify any of your code except for
the connection string.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Fri, 30 Apr 2004 21:30:04 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: OSs with Perl installed
Message-Id: <r4Dkc.53967$OU.1218175@news20.bellglobal.com>
"Abigail" <abigail@abigail.nl> wrote in message
news:slrnc95pk2.egl.abigail@alexandra.abigail.nl...
>
> Take the set of people using Windows. Pick 100 random people from it.
> Ask them whether they miss having Perl under Windows.
>
> Take the set of people using a different OS than Windows. Pick 100
> random people from it. Ask them whether they would have used Windows
> instead if Windows had included Perl.
>
> Of the two hundred questions asked - how many "Yes" answers do you expect
> to get? Right. So does Microsoft.
>
Take that sampling where I work and then remove Perl from all the computers
of the people who say yes and you'd have a whole lot of unhappy people. Home
users might not care or notice, but most of the places I've worked have
implemented Perl scripts to "magically" perform mundane text processing
tasks for the employees (i.e., all they have to know is how to click on an
icon). Then again, we've created an image with Perl that we ghost onto new
boxes, so it's not really a big issue for me if M$ includes Perl or not.
Matt
------------------------------
Date: 01 May 2004 02:10:31 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc961on.egl.abigail@alexandra.abigail.nl>
Walter Roberson (roberson@ibd.nrc-cnrc.gc.ca) wrote on MMMDCCCXCVI
September MCMXCIII in <URL:news:c6uq1q$2h7$1@canopus.cc.umanitoba.ca>:
`' In article <slrnc95pk2.egl.abigail@alexandra.abigail.nl>,
`' Abigail <abigail@abigail.nl> wrote:
`' :Take the set of people using Windows. Pick 100 random people from it.
`' :Ask them whether they miss having Perl under Windows.
`'
`' :Take the set of people using a different OS than Windows. Pick 100
`' :random people from it. Ask them whether they would have used Windows
`' :instead if Windows had included Perl.
`'
`' :Of the two hundred questions asked - how many "Yes" answers do you expect
`' :to get? Right. So does Microsoft.
`'
`' Depends what you mean by "used Windows". I'm a unix sort of guy who
`' does some code development. I'd be very unlikely to switch to Windows
`' as my primary desktop -- but my perl code could be used pretty much
`' unchanged on Windows, then I'd be a lot more likely to do a Windows port
`' for the sake of my users (who aren't generally unix sort of people.)
But that doesn't sell more Windows copies. You're doing people who already
run Windows a favour. Microsoft won't care - they already sold Windows to
them. So, there's no gain for Microsoft to include Perl.
`' [What I gather from sampling postings here, is that adapting
`' unix-developed perl code for Windows is still a bother, rather than
`' just a matter of a few tweaks.]
It entirely depends on what you the program is doing. Many things run
without a problem under Windows. Other things are more problematic.
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: 01 May 2004 02:16:08 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc96238.egl.abigail@alexandra.abigail.nl>
Matt Garrish (matthew.garrish@sympatico.ca) wrote on MMMDCCCXCVI
September MCMXCIII in <URL:news:r4Dkc.53967$OU.1218175@news20.bellglobal.com>:
()
() "Abigail" <abigail@abigail.nl> wrote in message
() news:slrnc95pk2.egl.abigail@alexandra.abigail.nl...
() >
() > Take the set of people using Windows. Pick 100 random people from it.
() > Ask them whether they miss having Perl under Windows.
() >
() > Take the set of people using a different OS than Windows. Pick 100
() > random people from it. Ask them whether they would have used Windows
() > instead if Windows had included Perl.
() >
() > Of the two hundred questions asked - how many "Yes" answers do you expect
() > to get? Right. So does Microsoft.
() >
()
() Take that sampling where I work and then remove Perl from all the computers
() of the people who say yes and you'd have a whole lot of unhappy people. Home
() users might not care or notice, but most of the places I've worked have
() implemented Perl scripts to "magically" perform mundane text processing
() tasks for the employees (i.e., all they have to know is how to click on an
() icon). Then again, we've created an image with Perl that we ghost onto new
() boxes, so it's not really a big issue for me if M$ includes Perl or not.
But the point isn't whether people become unhappy if you remove Perl.
It won't make Microsoft sell more copies of Windows. Your example just
shows that even without including Perl in their product, people still use
(and buy) Windows. Show me a company that gives the inclusion of Perl
in the OS any significant weight in the decision whether it's going to be
Windows, or some non-Windows on the desktop. (Or even servers). Hands up,
who installed Linux at work just because Windows doesn't have Perl?
Abigail
--
:;$:=~s:
-:;another Perl Hacker
:;chop
$:;$:=~y:;::d;print+Just.$:
------------------------------
Date: Fri, 30 Apr 2004 21:38:50 -0500
From: l v <lv@aol.com>
Subject: Re: OSs with Perl installed
Message-Id: <40930df0$1_1@corp.newsgroups.com>
Abigail wrote:
> Matt Garrish (matthew.garrish@sympatico.ca) wrote on MMMDCCCXCVI
> September MCMXCIII in <URL:news:r4Dkc.53967$OU.1218175@news20.bellglobal.com>:
> ()
> () "Abigail" <abigail@abigail.nl> wrote in message
> () news:slrnc95pk2.egl.abigail@alexandra.abigail.nl...
> () >
> () > Take the set of people using Windows. Pick 100 random people from it.
> () > Ask them whether they miss having Perl under Windows.
> () >
> () > Take the set of people using a different OS than Windows. Pick 100
> () > random people from it. Ask them whether they would have used Windows
> () > instead if Windows had included Perl.
> () >
> () > Of the two hundred questions asked - how many "Yes" answers do you expect
> () > to get? Right. So does Microsoft.
> () >
> ()
> () Take that sampling where I work and then remove Perl from all the computers
> () of the people who say yes and you'd have a whole lot of unhappy people. Home
> () users might not care or notice, but most of the places I've worked have
> () implemented Perl scripts to "magically" perform mundane text processing
> () tasks for the employees (i.e., all they have to know is how to click on an
> () icon). Then again, we've created an image with Perl that we ghost onto new
> () boxes, so it's not really a big issue for me if M$ includes Perl or not.
>
>
> But the point isn't whether people become unhappy if you remove Perl.
> It won't make Microsoft sell more copies of Windows. Your example just
> shows that even without including Perl in their product, people still use
> (and buy) Windows. Show me a company that gives the inclusion of Perl
> in the OS any significant weight in the decision whether it's going to be
> Windows, or some non-Windows on the desktop. (Or even servers). Hands up,
> who installed Linux at work just because Windows doesn't have Perl?
>
>
> Abigail
Good point Abigail. Perl is not the deciding factor on what OS to
use/buy. It is however the first installation I do when I get a new
windows server.
Len
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
------------------------------
Date: 30 Apr 2004 21:08:38 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc9655m.m09.jtc@shell.dimensional.com>
In article <slrnc961on.egl.abigail@alexandra.abigail.nl>, Abigail wrote:
> Walter Roberson (roberson@ibd.nrc-cnrc.gc.ca) wrote on MMMDCCCXCVI
> September MCMXCIII in <URL:news:c6uq1q$2h7$1@canopus.cc.umanitoba.ca>:
> `' In article <slrnc95pk2.egl.abigail@alexandra.abigail.nl>,
> `' Abigail <abigail@abigail.nl> wrote:
> `' :Take the set of people using Windows. Pick 100 random people from it.
> `' :Ask them whether they miss having Perl under Windows.
> `'
> `' :Take the set of people using a different OS than Windows. Pick 100
> `' :random people from it. Ask them whether they would have used Windows
> `' :instead if Windows had included Perl.
> `'
> `' :Of the two hundred questions asked - how many "Yes" answers do you expect
> `' :to get? Right. So does Microsoft.
> `'
> `' Depends what you mean by "used Windows". I'm a unix sort of guy who
> `' does some code development. I'd be very unlikely to switch to Windows
> `' as my primary desktop -- but my perl code could be used pretty much
> `' unchanged on Windows, then I'd be a lot more likely to do a Windows port
> `' for the sake of my users (who aren't generally unix sort of people.)
>
> But that doesn't sell more Windows copies. You're doing people who already
> run Windows a favour. Microsoft won't care - they already sold Windows to
> them. So, there's no gain for Microsoft to include Perl.
However, some of these people may decide, at some point: "I'm tired of
not being able to use these useful programs because Microsoft didn't
include Perl on my system. Next time I need to upgrade my OS, I'm
switching to Linux - I see I can get a Linux machine at Walmart for $xxx.xx."
[I suppose I should shut up, since I wouldn't be particularly disappointed
if a substantial number of people decided to do this, and I don't want to
tip MS off. Sure, it's unlikely, but the future is uncertain. - ".5 * :-)"]
>
> `' [What I gather from sampling postings here, is that adapting
> `' unix-developed perl code for Windows is still a bother, rather than
> `' just a matter of a few tweaks.]
>
> It entirely depends on what you the program is doing. Many things run
> without a problem under Windows. Other things are more problematic.
>
>
> Abigail
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
Date: Fri, 30 Apr 2004 23:38:21 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: OSs with Perl installed
Message-Id: <IYEkc.54050$OU.1250454@news20.bellglobal.com>
"Abigail" <abigail@abigail.nl> wrote in message
news:slrnc96238.egl.abigail@alexandra.abigail.nl...
> Matt Garrish (matthew.garrish@sympatico.ca) wrote on MMMDCCCXCVI
> September MCMXCIII in
<URL:news:r4Dkc.53967$OU.1218175@news20.bellglobal.com>:
> ()
> () Take that sampling where I work and then remove Perl from all the
computers
> () of the people who say yes and you'd have a whole lot of unhappy
people. Home
> () users might not care or notice, but most of the places I've worked
have
> () implemented Perl scripts to "magically" perform mundane text
processing
> () tasks for the employees (i.e., all they have to know is how to click
on an
> () icon). Then again, we've created an image with Perl that we ghost onto
new
> () boxes, so it's not really a big issue for me if M$ includes Perl or
not.
>
>
> But the point isn't whether people become unhappy if you remove Perl.
> It won't make Microsoft sell more copies of Windows. Your example just
> shows that even without including Perl in their product, people still use
> (and buy) Windows. Show me a company that gives the inclusion of Perl
> in the OS any significant weight in the decision whether it's going to be
> Windows, or some non-Windows on the desktop. (Or even servers). Hands up,
> who installed Linux at work just because Windows doesn't have Perl?
>
>
I didn't mean to imply that it does. If, however, they want to be taken
seriously as an OS they have to begin adding in the tools that drive people,
like yourself, to have to resort to other platforms to get their work done
(and that, along with the ridiculous price tag, is what is driving people to
find better solutions). Perl's inclusion alone may not make a difference,
but it's absence is symptomatic of what is wrong with Windows. Do you really
want Movie Maker on your workstations, or Perl?
If I worked for Microsoft I would be very afraid of Linux...
Matt
------------------------------
Date: Fri, 30 Apr 2004 22:56:43 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: OSs with Perl installed
Message-Id: <40931ffc$0$198$58c7af7e@news.kabelfoon.nl>
Matt Garrish wrote:
> If I worked for Microsoft I would be very afraid of Linux...
Why?
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
------------------------------
Date: Fri, 30 Apr 2004 18:34:36 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: print $query->scrolling_list
Message-Id: <cruu6c.uo6.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In article <7f746dd.0404301704.7aed779c@posting.google.com>, Chris wrote:
> I have the following code and am trying to have different values than
> what the user clicks on.
>
> print $query->scrolling_list (
> -name=>'forsale',
> -value=>['No','Yes'],
> -size=>2
> -multiple=>'false');
>
> Right now when I view my source in the browser it shows as
><SELECT NAME="forsale" SIZE=2 FALSE>
><OPTION VALUE="No">No
><OPTION VALUE="Yes">Yes
></SELECT>
>
> and I need it to be (values below are different)
><SELECT NAME="forsale" SIZE=2 FALSE>
><OPTION VALUE="">No
><OPTION VALUE="s">Yes
></SELECT>
>
> How would I change the print $query-> to allow this.
Read the CGI documentation about using -labels.
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)
iD8DBQFAkv6ohVcNCxZ5ID8RAq3UAKCQ/OzVbu6uQEQQ/mCbeHvMK5M3KgCgi7yw
/cX54sBYILmJN8+kodsbjkc=
=qHAX
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 01 May 2004 01:50:40 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: print $query->scrolling_list
Message-Id: <40930189.2050901@rochester.rr.com>
Chris wrote:
> I have the following code and am trying to have different values than
> what the user clicks on.
>
> print $query->scrolling_list (
> -name=>'forsale',
> -value=>['No','Yes'],
> -size=>2
> -multiple=>'false');
>
> Right now when I view my source in the browser it shows as
> <SELECT NAME="forsale" SIZE=2 FALSE>
> <OPTION VALUE="No">No
> <OPTION VALUE="Yes">Yes
> </SELECT>
>
> and I need it to be (values below are different)
> <SELECT NAME="forsale" SIZE=2 FALSE>
> <OPTION VALUE="">No
> <OPTION VALUE="s">Yes
> </SELECT>
>
> How would I change the print $query-> to allow this.
...
> Chris
>
Did you miss the following in perldoc CGI?:
"The optional sixth argument is a pointer to an associative array
containing long user-visible labels for the list items (-labels). If not
provided, the values will be displayed."
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sat, 01 May 2004 01:27:02 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: problem with pattern match
Message-Id: <G1Dkc.43290$sH4.30222@newssvr29.news.prodigy.com>
"Mark Clements" <mark.clements@kcl.ac.uk> wrote in message
news:40928fb2$1@news.kcl.ac.uk...
> There are a number of characters that you can use
> to delimit a regular expression.
You can pretty much use *ANY* character. Whether that's a good thing or not
is totally debatable.
$x = 'you can even use an m as a delimiter';
print "yes\n" if $x =~ m m\mm;
--Ala
------------------------------
Date: Fri, 30 Apr 2004 22:16:22 -0500
From: "Jerry Preston" <g-preston1@ti.com>
Subject: reducing a regex
Message-Id: <c6v4q9$m7j$1@home.itg.ti.com>
Hi!
I am trying to figure out how to reduce or simplify the following:
/\+:\s+(\w+)\s+:\s+(\w+)\s+(\w+)\s+(\w+)\s+:\s+(\d)-(\d+)-(\d+)\s+:\s+=\s+(\
d+)\s+(\w+)\s+(\w+)\s+\[\s+(-?\d+.\d+),\s+(-?\d+.\d+)/;
Any ideas?
Thanks,
Jerry
------------------------------
Date: Sat, 01 May 2004 05:19:35 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: reducing a regex
Message-Id: <c6v5bs$gmmu8$1@ID-184292.news.uni-berlin.de>
Jerry Preston wrote:
> I am trying to figure out how to reduce or simplify the following:
>
> /\+:\s+(\w+)\s+:\s+(\w+)\s+(\w+)\s+(\w+)\s+:\s+(\d)-(\d+)-(\d+)\s+:\s+=\s+(\
> d+)\s+(\w+)\s+(\w+)\s+\[\s+(-?\d+.\d+),\s+(-?\d+.\d+)/;
>
> Any ideas?
Would you mind sharing your own thoughts on the subject?
How on earth would anybody else be able to suggest anything without
knowing what the regex is supposed to accomplish?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 30 Apr 2004 23:37:18 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: reducing a regex
Message-Id: <5KadnXj3IPrthg7dRVn-uw@adelphia.com>
Jerry Preston wrote:
> I am trying to figure out how to reduce or simplify the following:
... snip ...
> Any ideas?
It's difficult to give any specific advice without your own idea of what the
regex should be doing.
But in general, I've found it useful to use the /x modifier with really
large and/or hairy regexes. That will allow you to split it across multiple
lines, and include comments for each subexpression.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sat, 01 May 2004 03:45:57 GMT
From: "Danny" <dannywork5@hotmail.com>
Subject: what is purpose of 1; at end of scripts
Message-Id: <V3Fkc.66897$Gd3.15990208@news4.srv.hcvlny.cv.net>
I notice a lot of scripts that have a 1; at the bottom.
I am new to perl and trying to understand.
Usually at bottom of scripts that do something but do not print to a web
page or print this 1;
Thanks in advance
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6497
***************************************