[16527] in Perl-Users-Digest
Perl-Users Digest, Issue: 3939 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 7 18:07:10 2000
Date: Mon, 7 Aug 2000 15:05:27 -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: <965685926-v9-i3939@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 7 Aug 2000 Volume: 9 Number: 3939
Today's topics:
Box size algorithm? <sluppy@my-deja.com>
Re: Box size algorithm? (Tim)
Re: CGI.PM How to get all the Form's value? <info@digitaltango.com>
Re: Converting a number to another base <lr@hpl.hp.com>
Re: cookie (Colin Keith)
Re: date manipulation <lr@hpl.hp.com>
delimited text to HRML table ppopuri@my-deja.com
delimited text to HTML table ppopuri@my-deja.com
delimited text to HTML table ppopuri@hotmail.com
delimited text to HTML table ppopuri@hotmail.com
delimited text to HTML table ppopuri@hotmail.com
Re: delimited text to HTML table (Logan Shaw)
Re: Dereferencing correctly in regular expressions <lr@hpl.hp.com>
Re: Dreaded 500 message <dave@htxtech.com>
Re: Dreaded 500 message <bart.lateur@skynet.be>
Re: Dreaded 500 message <flavell@mail.cern.ch>
Re: dropping space from begginning & end of a string <linux@worsdall.demon.co.uk>
Re: find the number of characters in a string <aqumsieh@hyperchip.com>
Re: find the number of characters in a string <mauldin@netstorm.net>
Re: First Days of Perl (Newbie) <lr@hpl.hp.com>
Re: Game programming in perl...? <spragg@cs.ucdavis.edu>
Re: get method in a html form ??? (Colin Keith)
Re: get method in a html form ??? <sowinso@sowinso.com>
Have split question <jshaieb@wcg.net>
Re: Have split question <mauldin@netstorm.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 07 Aug 2000 20:33:54 GMT
From: sluppy <sluppy@my-deja.com>
Subject: Box size algorithm?
Message-Id: <8mn6fi$kel$1@nnrp1.deja.com>
Does anyone know of a good way to accomplish the following?
A box is an object with Length (L) Width (W) and Height (H).
An item is an object with Length (L) Width (W) and Height (H).
Assume that there are a variety of "boxes" available to choose from, all
with different (L) (W) (H) values.
Now assume that there are several "items" that may or may not have
different (L) (W) (H) values.
Is there a way to determine which of the "boxes" can completely enclose
all of the "items" ? Going further, if multiple "boxes" can enclose all
of the "items," can it be determined which "box" is the optimal and/or
most efficient solution?
I apologize in advance if this is a stupid question or is easily
answered somewhere else. I looked but couldn't find anything on this
topic. I'm putting it on a Perl newsgroup since that happens to be the
language I'm writing my application in. (Yes, I'm a total newbie to
Perl.)
Hopefully there will be a way to do this in a non-OOP manner, since I'm
not up on that stuff yet, but I will sincerely appreciate any and all
responses.
Thanks.
--T
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 20:41:55 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Box size algorithm?
Message-Id: <8F8999B07indigodimcom@166.93.207.145>
sluppy@my-deja.com (sluppy) wrote in <8mn6fi$kel$1@nnrp1.deja.com>:
>Does anyone know of a good way to accomplish the following?
>
>A box is an object with Length (L) Width (W) and Height (H).
>
>An item is an object with Length (L) Width (W) and Height (H).
>
>Assume that there are a variety of "boxes" available to choose from, all
>with different (L) (W) (H) values.
>
>Now assume that there are several "items" that may or may not have
>different (L) (W) (H) values.
>
>Is there a way to determine which of the "boxes" can completely enclose
>all of the "items" ? Going further, if multiple "boxes" can enclose all
>of the "items," can it be determined which "box" is the optimal and/or
>most efficient solution?
Unfortunately, this reduces to the well known "Knapsack Problem", which
has no known efficient algorithm that finds the optimal solution. It may
be possible to devise a heuristic algorithm that gives acceptable results,
but that is off topic for a Perl newsgroup. Perhaps a newsgroup on
algorithms or computer theory would be of more use to you.
-T
------------------------------
Date: Mon, 07 Aug 2000 19:31:17 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Re: CGI.PM How to get all the Form's value?
Message-Id: <98Ej5.17176$FZ1.172757@news20.bellglobal.com>
Thanks! it works fine!
-- Etienne
<sjs@yorku.ca> wrote in message news:slrn8otpc1.33e.sjs@john.sympatico.ca...
> Etienne Laverdiere <info@digitaltango.com> wrote:
> >Hi all, I am working with CGI.pm And I want to get all the values of
> >the "query_string" in a hastable. I tried
> >
> >$query = new CGI;
> >local %data = ();
> >%data= $query->Vars;
> >
> >to get all the values of the <FORM> in %data but it seems to works only
> >when the FORM's method was a POST. It doesn't works when it was a GET.
> >Do you know any "easy" way to get these values? I wrote
> >a "read_query_string" and a "parse_data_form" functions, but it is
> >quite 'unesthetic', I rather prefer a '%data = $query->Vars' solution.
>
> I use:
>
> #!/usr/bin/perl -w
> use strict;
> use CGI qw/:standard/;
>
> my %form_contents = map { $_ => param($_) } param();
>
> I don't know if it's the nicest way, but it's sufficiently lazy and
> sufficiently graspable for me.
>
> Steve
------------------------------
Date: Mon, 7 Aug 2000 11:57:37 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Converting a number to another base
Message-Id: <MPG.13f8a6807571afd298ac3d@nntp.hpl.hp.com>
In article <WZ4j5.7$Mb1.1140@vic.nntp.telstra.net> on Sun, 6 Aug 2000
13:29:19 +1000, Rhonda Woodward <kalinabears@hdc.com.au> says...
...
> There have been a few postings recently regarding converting a
> number from one base to another.
> I have been using the script below - running from the command
> line on my Active Perl (hence all the "<STDIN>"s and "print"s).
> It will convert positive integers from any base in the range
> 2 to 16, to any base in the range 2 to 16.
> It does this by first converting to base 10, then to the second
> specified base.
That is an unnecessary step. There is nothing special about base 10,
except that by default the Perl print() function converts a number to a
string in base-10 representation before printing it. The internal
representatin is binary -- integer or floating-point.
...
> I would expect that it has been done before, though I (and apparently
> some others) have been unable to find it.
Then none of you looked at CPAN. A search for 'convert base' yields
this:
Math::BaseCalc: Convert numbers between various bases
> Cheers,
> Rob
'Rob' ne 'Rhonda'. ???
> $base1=<STDIN>; # Enter the base $number.
> chomp $base1;
It is good programming practice to use the 'use strict;' pragma,
requiring declaration of all variables.
chomp(my $base1 = <STDIN>);
...
> # check that the $base1 number contains only numeric characters
> @base1byt=split(//,$base1);
> foreach $base1byt (@base1byt) {
> unless ($base1byt =~/[0-9]/) {
> print "Neither base number can contain any non numeric characters";
> exit;
> }
> }
Perl provides many operators that work on strings. Any time you do
character-by-character processing, there is usually a Better Way To Do
It.
Either of these tests will reveal a non-digit character in a string:
/\D/
tr/0-9//c
...
> # check that the number contains only hexadecimal characters
Left as an exercise. See above for clues.
...
> # change any alpha hex characters to their numeric value
> foreach $byt (@byt) {
> $byt =~s/a/10/i;
> $byt =~s/b/11/i;
> $byt =~s/c/12/i; # can all this be put in one line?
> $byt =~s/d/13/i;
> $byt =~s/e/14/i;
> $byt =~s/f/15/i;
> }
Lots of ways to do it in one line.
$byt =~ s/([a-fA-F])/ord(lc $1) - ord('a') + 10/e;
A bit more naturally:
$byt = ord(lc $byt) - ord('a') + 10 if $byt =~ /a-fA-f/;
A hash lookup would be more efficient.
my %h = ( a => 10, b => 11, ... f => 15 ); # Save this elsewhere.
$byt = $h{lc $byt} || $byt;
Or you can make the hash twice the size and avind the case conversion.
...
> if ($base1 != 10) { # no need to convert a number to itself.
No need to do this at all, as I said.
...
> if ($base2 !=10) { # no need to convert a number to itself.
> # convert the decimal $num to the desired base.
OK, but that assumes all you are doing is using print(). A general
routine would do string-to-string, so you would need to do '10' also.
BTW, [s]printf will handle several bases: 16, 10, 8, 2 (in Perl 5.6).
But why special-case anything? Just do it!
> $d=$num%$base2;
> $q=int($num/$base2);
Spacing between tokens makes Perl code so much easier to read!
> @bin=(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F);
Those letters are barewords. Don't use them. Perl provides sequence
generating operators, also:
my @bin = ( 0 .. 9, 'A' .. 'F' );
> $b=$bin[$d];
> if ($q==0) {
> print "$number, base $base1 = $b, base $base2";
> }
> else {
The above test and print are superfluous.
> while ($q!=0) {
> $d=$q%$base2;
> $q=int($q/$base2);
> $b="$bin[$d]"."$b";
All the quotes you have are superfluous. But these aren't:
$b = "$bin[$d]$b";
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 07 Aug 2000 18:11:06 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: cookie
Message-Id: <_YCj5.92$DT4.2848812@nnrp2.clara.net>
In article <8umj5.73229$N4.1958725@ozemail.com.au>, "Troy Rasiah" <troyr@vicnet.net.au> wrote:
> I've been wondering if this is a problem with Internet Explorer or
I have a memory that its a problem with IE and it not giving up cookies
until you reload the program. But I can't find any evidence to substantiate
this. (Besides which, I have to try and make it look like I'm working
occassionally:)
>Anyone have any suggestions or comments......
Set it to a time that has already passed and it'll expire straight away. I
don't think it will solve the problem, because I do'nt think that's where
the problem lies. But still... Try our esteemed collegues over in
comp.infosystems.www.*, they'll prolly know the asnwer:)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Mon, 7 Aug 2000 12:39:43 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: date manipulation
Message-Id: <MPG.13f8b0568a428cb398ac3f@nntp.hpl.hp.com>
In article <3997115b.43920573@news.newsguy.com> on Sat, 05 Aug 2000
13:10:32 GMT, Keith Calvert Ivey <kcivey@cpcug.org> says...
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> >Following your sequence of steps, I would find this in perlfaq4: "How do
> >I find yesterday's date?". It isn't hard to relate that to the original
> >question: "I was wondering if there is a tried and tested way of
> >calculating dates (day/month/year) in the future from a given date."
>
> I'm still using 5.005_03 (ActiveState build 522), and my copy of
> perlfaq4 has an answer for that question that doesn't take
> daylight-savings time into account. I'm assuming since you're
> recommending it that the answer has been revised for Perl 5.6
> (though Bart Lateur's answer in this thread has the same
> problem). Unfortunately, the question is missing from
>
> http://www.perl.com/pub/doc/manual/html/pod/perlfaq4.html
>
> which I had thought was a copy of the Perl 5.6 documentation.
> I guess I ought to install 5.6.
You are correct that the 5.6 FAQ has an explicit solution for this non-
problem. But I don't recommend that, as it is pure pedantry or one-up-
manship.
I can't believe anyone would really care about the summer-time anomalies
in the real world. But if they did, the entire solution to take it into
account is this:
Instead of basing the time from time() and adding the offset (an
integral number of days), use as the base:
int(time() % 86400) * 86400 + 86400/2
This gives the date at local noon, from which summer-time anomalies in
the date are absent.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 07 Aug 2000 21:26:01 GMT
From: ppopuri@my-deja.com
Subject: delimited text to HRML table
Message-Id: <8mn9h2$n01$1@nnrp1.deja.com>
Hi,
Does anyone know of a scipt which converts delimited text into an html
table and consequently an HTML page. I am working on a project where
the end-user ftp's a file to
the server and the CGI is supposed to pick it up and do two things with
it. Firstly, the CGI should convert the delimited text file into an
HTML page involving tables.
Secondly, a link to this newly created HTML file should be added on to
another page which maintains the links of all converted files.
Your assitance is greatly appreciated.
Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 21:24:50 GMT
From: ppopuri@my-deja.com
Subject: delimited text to HTML table
Message-Id: <8mn9eq$mu1$1@nnrp1.deja.com>
Hi,
Does anyone know of a scipt which converts delimited text into an html
table and consequently an HTML page. I am working on a project where
the end-user ftp's a file to
the server and the CGI is supposed to pick it up and do two things with
it. Firstly, the CGI should convert the delimited text file into an
HTML page involving tables.
Secondly, a link to this newly created HTML file should be added on to
another page which maintains the links of all converted files.
Your assitance is greatly appreciated.
Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 21:25:22 GMT
From: ppopuri@hotmail.com
Subject: delimited text to HTML table
Message-Id: <8mn9fq$mvk$1@nnrp1.deja.com>
Hi,
Does anyone know of a scipt which converts delimited text into an html
table and consequently an HTML page. I am working on a project where
the end-user ftp's a file to
the server and the CGI is supposed to pick it up and do two things with
it. Firstly, the CGI should convert the delimited text file into an
HTML page involving tables.
Secondly, a link to this newly created HTML file should be added on to
another page which maintains the links of all converted files.
Your assitance is greatly appreciated.
Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 21:25:30 GMT
From: ppopuri@hotmail.com
Subject: delimited text to HTML table
Message-Id: <8mn9g2$mvn$1@nnrp1.deja.com>
Hi,
Does anyone know of a scipt which converts delimited text into an html
table and consequently an HTML page. I am working on a project where
the end-user ftp's a file to
the server and the CGI is supposed to pick it up and do two things with
it. Firstly, the CGI should convert the delimited text file into an
HTML page involving tables.
Secondly, a link to this newly created HTML file should be added on to
another page which maintains the links of all converted files.
Your assitance is greatly appreciated.
Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 21:25:39 GMT
From: ppopuri@hotmail.com
Subject: delimited text to HTML table
Message-Id: <8mn9gc$mvq$1@nnrp1.deja.com>
Hi,
Does anyone know of a scipt which converts delimited text into an html
table and consequently an HTML page. I am working on a project where
the end-user ftp's a file to
the server and the CGI is supposed to pick it up and do two things with
it. Firstly, the CGI should convert the delimited text file into an
HTML page involving tables.
Secondly, a link to this newly created HTML file should be added on to
another page which maintains the links of all converted files.
Your assitance is greatly appreciated.
Thank you.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 7 Aug 2000 16:46:14 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: delimited text to HTML table
Message-Id: <8mnan6$728$1@provolone.cs.utexas.edu>
In article <8mn9eq$mu1$1@nnrp1.deja.com>, <ppopuri@my-deja.com> wrote:
> Does anyone know of a scipt which converts delimited text into an html
>table and consequently an HTML page.
I don't know of a script, but if you're interesting in writing it, it
isn't that difficult. Here is some example code:
@headings = qw{ col1 col2 col3 col4 };
print "<TABLE>\n";
print "<TR>", map ("<TH>$_</TH>", @headings), "</TR>\n";
while (<>)
{
chomp;
print "<TR>", map ("<TD>$_</TD>", split (/,/, $_)), "</TR>\n";
}
print "</TABLE>\n";
Hope that helps.
- Logan
------------------------------
Date: Mon, 7 Aug 2000 12:58:47 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Dereferencing correctly in regular expressions
Message-Id: <MPG.13f8b4d08fe3e0698ac40@nntp.hpl.hp.com>
In article <MPG.13f6a77efd88fa2f9896c8@news> on Sat, 05 Aug 2000
12:35:43 GMT, jason <elephant@squirrelgroup.com> says...
> Larry Rosler writes ..
...
> >It is surprising that, when Perl interpolates a scalar into a double-
> >quotish context, function calls or method invocations () are not
> >evaluated, but array indexes [] or hash keys {} are evaluated (no matter
> >how complicated they may be). Even there, whitespace between tokens,
> >which would be ignored in an ordinary expression, inhibits the
> >evaluation of the suffix [] or {} as other than a simple string. The
> >same approach could have been used to disambiguate the () suffix.
> >
> >Perhaps someone can provide a rationale for this inconsistent situation,
> >other than "that's the way it is".
>
> surely it's a simple case of - you've gotta draw the line somewhere .. I
> mean what does
>
> print "if(1) { print 'abc'; }";
>
> end up printing if code is evaluated as well as variables being
> interpolated ?
You have jumped from the simple evaluation of a function invocation to
the evaluation of arbitrary Perl code within a double-quoted string.
Please don't try to wash away my question by inappropriate reductio ad
absurdum.
> do you only evaluate code where it's a method call on
> a blessed reference that has been successfully interpolated ? .. do you
> print any output of the function in the middle of the string ? .. or do
> you just print the function return code in the middle of the string and
> the STDOUT of the function after the string ?
These same questions would obtain if the function in question were
called within the evaluation of an array offset or a hash key.
> I don't know the reason .. but in my mind there are a massive number of
> reasons providing ample rationale for why code is not evaluated unless
> it's in order to resolve a variable interpolation
You haven't given one reason yet, IMO. Why should:
"xyz$foo->('bar')xyz"
be different from:
"xyz$baz->[$foo->('bar')]xyz"
or the equivalent hash-key calculation?
With Perl 6 in view, backwards-compatibility arguments won't pertain in
trying to get the new language 'right'!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 07 Aug 2000 14:41:00 -0400
From: David Somner <dave@htxtech.com>
Subject: Re: Dreaded 500 message
Message-Id: <398F02BC.DBE38969@htxtech.com>
Okay, that is much more reasonable than any of the other posts that I
got here. BTW, this is the ONLY language newsgroup that doesnt seem to
care about the language's implementation throughout the platforms. I've
seen this before with other languages. This one will probably follow
those into obscurity unless something else happens.
Anyway, I'll see what they say over in the that other newsgroup about
the PWS for Win95/Win98. Happy programming!
BTW, everything program wise is running just fine with the OmniHTTPd
server.
--Dave
Kent Perrier wrote:
>
> David Somner <dave@htxtech.com> writes:
>
> > Hello!
> >
> > I am getting the 500 Server Error message.
> > I am using Win95 and Win98 (two different platforms)
> > I have updated to latest DCOM 1.3 from Microsoft
> > I have installed the Microsoft Installer
> > I have installed ActivePerl
> > I have MS Personal Web Server 1.x installed
> > I have /cgi-bin on c:\cgi-bin and virtualized to http://myspot/cgi-bin
> > I have /datadir on c:\datadir and virtualized to http://myspot/datadir
> > I have /cgi-bin set to execute, no read
> > I have /datadir set to read, no execute
> > I have a .htm file in my WWWROOT directory to test the .CGI script out
> > I have made the registry changes for .pl, .plx and .cgi files
> >
> > I can run perl from a command prompt and get the correct output from the
> > .CGI files
> > When I run a .CGI file in a web browser, I get the 500 Server Error
> > message
>
> Perhaps you should ask your question in comp.infosystems.www.authoring.cgi
> where the real experts on cgi exist. You will probably get a better, more
> informed response there.
>
> Kent
> --
> "I can't get over the fact that Hillary Clinton's greatest public feat
> was to help her husband lie to the rest of us."
>
> --Historian, and Ms. Rodham-Clinton's biographer, Joyce Milton.
------------------------------
Date: Mon, 07 Aug 2000 19:58:56 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Dreaded 500 message
Message-Id: <875uoso70bde1418lbnairm4q3ni3hs5tc@4ax.com>
David Somner wrote:
>BTW, this is the ONLY language newsgroup that doesnt seem to
>care about the language's implementation throughout the platforms. I've
>seen this before with other languages.
No, they do. But you're having a web server problem, which is not part
of Perl's implementation.
--
Bart.
------------------------------
Date: Mon, 7 Aug 2000 21:47:32 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Dreaded 500 message
Message-Id: <Pine.GHP.4.21.0008072143240.16865-100000@hpplus03.cern.ch>
On Mon, 7 Aug 2000, David Somner hung upside-down from a handy
news-sever and proclaimed to the foregathered multitude:
> BTW, this is the ONLY language newsgroup that doesnt seem to
> care about the language's implementation throughout the platforms.
I don't think you understand what's going on.
> I've seen this before with other languages.
You just said it's the ONLY one. Now I'm convinced you don't know
what's going on.
> This one will probably follow
> those into obscurity unless something else happens.
Yeah, whatever.
------------------------------
Date: Mon, 7 Aug 2000 18:53:33 +0100
From: Mark Worsdall <linux@worsdall.demon.co.uk>
Subject: Re: dropping space from begginning & end of a string
Message-Id: <YCsqHnAdevj5Ew2a@worsdall.demon.co.uk>
In article <398EDD23.EE0048C6@home.com>, Michael Carman
<mjcarman@home.com> writes
>Andreas Kahari wrote:
>>
>> Mark Worsdall <linux@worsdall.demon.co.uk> wrote:
>> >
>> >How could I drop the space from the beginning and the end?
>>
>> $string =~ s/^\s*|\s*$//g;
>>
>
>Two points:
> 1) Needless replacement of empty strings.
> (You want '\s+', not '\s*')
> 2) The alternation makes it slower than splitting it into two
> regex's.
>
>As Abigail is trying to nudge everyone to do, look at the FAQ:
>
>perldoc perlfaq4: "How do I strip blank space from the beginning/end of
>a string?"
Oh yes:-)
--
He came from Econet - Oh no, I've run out of underpants :(
Home:- jaydee@wizdom.org.uk http://www.wizdom.org.uk
Shadow:- webmaster@shadow.org.uk http://www.shadow.org.uk
Work:- netman@hinwick.demon.co.uk http://www.hinwick.demon.co.uk
Web site Monitoring:- http://www.shadow.org.uk/SiteSight/
------------------------------
Date: Mon, 07 Aug 2000 19:56:07 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: find the number of characters in a string
Message-Id: <7avgxcdew6.fsf@merlin.hyperchip.com>
Jim Mauldin <mauldin@netstorm.net> writes:
> "Godzilla!" wrote:
> >
> <snip rant>
>
> True, my example would wipe out the letters.
>
> > $letters = $string =~ tr/a-zA-Z/a-zA-Z/;
>
> is correct;
Your example is still better, IMHO. It does NOT wipe out
the letters:
% perl -wl
$string = "9 of 15 cats are there";
$letters = $string =~ tr/a-zA-Z//;
print "Letters: $letters";
print "String : $string";
__END__
Letters: 14
String : 9 of 15 cats are there
--Ala
------------------------------
Date: Mon, 07 Aug 2000 20:10:09 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: find the number of characters in a string
Message-Id: <398F171F.8A41135A@netstorm.net>
Ala Qumsieh wrote:
>
> Jim Mauldin <mauldin@netstorm.net> writes:
>
> > "Godzilla!" wrote:
> > >
> > <snip rant>
> >
> > True, my example would wipe out the letters.
> >
> > > $letters = $string =~ tr/a-zA-Z/a-zA-Z/;
> >
> > is correct;
>
> Your example is still better, IMHO. It does NOT wipe out
> the letters:
>
> % perl -wl
> $string = "9 of 15 cats are there";
> $letters = $string =~ tr/a-zA-Z//;
> print "Letters: $letters";
> print "String : $string";
> __END__
> Letters: 14
> String : 9 of 15 cats are there
>
> --Ala
"If the REAPLACEMENTLIST is null, the SEARCHLIST is replicated". What
kills me is that I knew this.
-- Jim
------------------------------
Date: Mon, 7 Aug 2000 12:05:48 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: First Days of Perl (Newbie)
Message-Id: <MPG.13f8a8642d97ce5c98ac3e@nntp.hpl.hp.com>
In article <018b3150.b5980480@usw-ex0103-023.remarq.com> on Sun, 06 Aug
2000 10:07:32 -0700, Diablito <diab.litoNOdiSPAM@usa.net.invalid>
says...
> "David Kocchi" <dkocchi@home.com> wrote:
> >I downloaded active perl on my windows PC. After I write a line
> of script,
> >and save it as a text file. How do I view what I have written?
> According to
> >the book I'm reading it says to save the file with a cgi
> extension. When I
> >save the file it also adds the .txt at the end is this write?
> test.cgi.txt
> >
>
> I guess you are editing the file in notepad.Select the "all
> files" while saving the document (otherwise it will add a .txt
> extension).Also make sure that the .cgi extension is associated
> with perl.exe.
Or you can simply use explicit double-quotes when you name the file when
saving it.
None of this has the least bit to do with Perl, though.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 7 Aug 2000 20:29:43 GMT
From: Adam Trace Spragg <spragg@cs.ucdavis.edu>
Subject: Re: Game programming in perl...?
Message-Id: <8mn67n$f7h$1@mark.ucdavis.edu>
Jeff Yoak <jeff@yoak.com> wrote:
: That's cool. Can we see it in action?
Hmmm. I'll post a sample turn when I get home, since you asked nicely. :)
The game actually just ended last night, and was moderately successful, for
a first attempt. (Hey, I think the fact that the game ran for 14 turns (about
10 weeks?) marks it for "success" in and of itself).
Adam
------------------------------
Date: Mon, 07 Aug 2000 18:21:15 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: get method in a html form ???
Message-Id: <v6Dj5.93$DT4.2849407@nnrp2.clara.net>
In article <8mmfum$1vi$1@nnrp1.deja.com>, Fred Docouto <docouto@my-deja.com> wrote:
>Hello,
>
>I need to know if the length of the query
>is limited in the get method in a htlm form ?
That depends on where you mean. If you mean by the browser sending the
request, then a URL has a maximum length. 256 chrs iirc, and I *think* that
includes the query_string. Check <http://www.rf.cx/> or
<http://www.w3c.org/> for this sort of thing (or visit
comp.infosystems.www.*, they'll know)
It may be limited by your browser also, though most will happily send URL's
of > 2K (I know, it triggers alarms in our log files)
If you mean in CGI.pm - which is of course why you're asking here and not
elsewhere, isn't it? - No, not afaik. Data sent via a POST method is
restricted though. You can set this by $CGI::POST_MAX.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Mon, 07 Aug 2000 21:43:09 GMT
From: "Brian A. Sayrs" <sowinso@sowinso.com>
Subject: Re: get method in a html form ???
Message-Id: <N3Gj5.889$3T4.204923@sea-read.news.verio.net>
"Fred Docouto" <docouto@my-deja.com> wrote in message
news:8mmfum$1vi$1@nnrp1.deja.com...
> Hello,
>
> I need to know if the length of the query
> is limited in the get method in a htlm form ?
>
> thank you
>
> Fred
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
I have two answers for you:
1) this is not a perl question, so there is probably a much better group to
ask this in, and
2) yes.
--
Brian A. Sayrs
Owner, Southwind Solutions
------------------------------
Date: Wed, 02 Aug 2000 01:29:19 GMT
From: Johnny Shaieb <jshaieb@wcg.net>
Subject: Have split question
Message-Id: <Pine.SOL.3.96.1000801202426.26875C-100000@mail>
If I have the following line to parse,,, how do I get what's in the
middle.
$line = "(945)";
#I now I can do this
($tmp1,$num,$tmp2) = split(/\(,\)/,$line);
#but how do I rip out whats in the middle, without using the above
#line.
Johnny Shaieb
------------------------------
Date: Mon, 07 Aug 2000 20:46:27 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Have split question
Message-Id: <398F1FA0.5599CD09@netstorm.net>
Johnny Shaieb wrote:
>
> If I have the following line to parse,,, how do I get what's in the
> middle.
>
> $line = "(945)";
>
> #I now I can do this
> ($tmp1,$num,$tmp2) = split(/\(,\)/,$line);
Won't work at all.
>
> #but how do I rip out whats in the middle, without using the above
> #line.
>
see
perldoc perlop
looking for m/PATTERN/cgimosx and paying particular attention to the use
of /g and the issue of "list context".
($num) = $line=~ /\d+/g;
-- Jim
------------------------------
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 3939
**************************************