[19292] in Perl-Users-Digest
Perl-Users Digest, Issue: 1487 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 10 11:05:36 2001
Date: Fri, 10 Aug 2001 08: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: <997455908-v10-i1487@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 10 Aug 2001 Volume: 10 Number: 1487
Today's topics:
Re: A Simple Regular Expression !! <jurgenex@hotmail.com>
Re: CGI.pm --> open FILE,">>file.txt"; <andras@mortgagestats.com>
Re: Connecting to a remote MS SQL server <bkennedy99@Home.com>
Re: Help pls - very new at perl Gordon.Haverland@gov.ab.ca
Re: Is an element in a table ? nobull@mail.com
Re: Is an element in a table ? (Anno Siegel)
Re: Is an element in a table ? (Anno Siegel)
Re: Location: cgi problem <richard@sunsetandlabrea.com>
Re: perl - write text file to server help (Charlie Abbott)
Re: Perl 5.6 Pollute (Anno Siegel)
perlTK syntax question (Stan Brown)
Pipe the output of a command to script <joeybach@hotmail.com>
Re: Pipe the output of a command to script <joeybach@hotmail.com>
Re: Pipe the output of a command to script <Thomas@Baetzler.de>
Re: Poor man's HTML hidden field message digest?? (Tad McClellan)
repeating substituation <richard@sunsetandlabrea.com>
Re: repeating substituation <Thomas@Baetzler.de>
Re: telnet session through perl <Thomas@Baetzler.de>
Re: This is not a question ... call me slow if you like (Martien Verbruggen)
Re: This is not a question ... call me slow if you like (Martien Verbruggen)
Re: Update: (Perl) programming contest loosely based on <tsee@gmx.net>
Re: Using LWP to traverse site & download file <Thomas@Baetzler.de>
Re: Why is $i so popular? (Anno Siegel)
Re: Why is $i so popular? (Tad McClellan)
Re: Why is $i so popular? <paul@net366.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 10 Aug 2001 07:55:34 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: A Simple Regular Expression !!
Message-Id: <3b73f5e7$1@news.microsoft.com>
"Henry Butowsky" <henryb@ntlworld.com> wrote in message
news:i7Pc7.9902$zs.55582@news11-gui.server.ntli.net...
> I need to see if two strings are equal have tried
What's wrong with "eq"?
jue
------------------------------
Date: Fri, 10 Aug 2001 10:37:28 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: CGI.pm --> open FILE,">>file.txt";
Message-Id: <3B73F1A7.8E63534F@mortgagestats.com>
Eric Bohlman wrote:
> Stephen Edelblut <viper16336@mindspring.com> wrote:
> > My cgi script saves data entered on a form to file.txt (using CGI.pm). It
> > works fine, but it only sends it to /cgi_bin/file.txt where the cgi script
> > is located. I want it to send it to a file.txt in my root directory (or some
> > other folder other that my cgi_bin directory). The code I'm using is:
> > open FILE,">>file.txt";
> > How do I change ">>file.txt" if I want it to open
> > www.mysite.com/textfile/file.txt? Currently file.txt is in my cgi_bin
> > directory. Whatever I try never works.
>
> You find out what actual *directory* the *URL* you gave maps to, and then
> include its path in the filename. Remember that URLs are *not* filesystem
> paths.
One way to do that is to look at the DOCUMENT_ROOT environment variable, which
should give you the full absolute path to the directory that your URL is mapped
to. Try
open FILE, ">>$ENV{DOCUMENT_ROOT}/textfile/file.txt";
It is generally a good idea to check the return value of open, and it would be
extra useful in your situation.
------------------------------
Date: Fri, 10 Aug 2001 13:15:55 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: Connecting to a remote MS SQL server
Message-Id: <f8Rc7.89659$EP6.21836022@news1.rdc2.pa.home.com>
"Jim Turner" <jimt+nospam@netins.net> wrote in message
news:3B72AE45.F5BB48B0@netins.net...
> Hi,
>
> I'm a bit confused on what I should be doing
> to accomplish this. I'm very new to database
> interaction using perl.
>
> The server I am trying to connect to is a
> generic install of MS SQL (v6.0 I believe, but
> I may be wrong there) on a NT server in a remote
> office. What I will be connecting from is a
> Digital UNIX 4.0e server. Perl version installed
> is 5.6.0.
I have heard that DBD::Sybase may be able to give native support for some
versions of MS SQL server, and the fact that you have an older version may
increase those odds. If that doesn't work, you can do at least two things,
one is install DBI::ProxyServer on some windows machine that can connect to
the server using builtin windows drivers (DBD::ODBC or DBD::ADO), then
create a DBI handle with DBD::Proxy to connect to the server. The other
possibility is to get an ODBC-ODBC bride (easysoft has one, check google),
install the server on some machine on the Windows network, install a ODBC
driver manager on the Unix server, and finally install the bridge driver on
the Unix server. This allows you to set up a local ODBC data source that
simply relays connection to the bridge server, and lets you specify a DSN to
forward commands to (the MS SQL server, of source). Hope this helps!
--Ben Kennedy
------------------------------
Date: Fri, 10 Aug 2001 14:40:51 GMT
From: Gordon.Haverland@gov.ab.ca
Subject: Re: Help pls - very new at perl
Message-Id: <3b73f1cd.178597107@news.gov.ab.ca>
On Thu, 02 Aug 2001 21:17:27 -0400, Carlos Beguigne
<beguigne@hotmail.com> wrote:
>open(file_1, '>>"$file"') or die "$file: REASON -> $!";
>the open statement generates the following error:
>order.996801242.dat: REASON -> Invalid argument at example2.pl line
>15.
>If I remove the "" from $file then it creates a file called $file
You want the variable $file _interpolated_ for the open call, hence
you need to put $file within double quotes. The double quotes should
surround the append operator as well. Nothing gets interpolated
within single quotes. So, you want:
open( file_1, ">> $file" ) or die "$file: REASON -> $!";
Gord
------------------------------
Date: 10 Aug 2001 14:12:37 +0100
From: nobull@mail.com
Subject: Re: Is an element in a table ?
Message-Id: <u93d706ou2.fsf@wcl-l.bham.ac.uk>
plop740@mail.ru writes:
> I have 2 lists of data: list A and list B
>
> What's the quickest way to see if, and how many elements of A are in B
> ?
This is FAQ "How do I compute the intersection of two arrays?"
Those who will not learn from the FAQs are condemned to repost them.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 10 Aug 2001 14:09:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is an element in a table ?
Message-Id: <9l0pup$qam$1@mamenchi.zrz.TU-Berlin.DE>
According to Tina Mueller <news@tinita.de>:
> Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr> wrote:
> > Here is my solution... there must be better :
>
> > $n = 0;
> > foreach (@listA) { # if @listA is smaller
> > $n += grep(/^$_$/, @listB);
> > }
[doesn't work. valid critique snipped]
> but you're going through the arrays in O(n^2).
>
> that can be made quicker:
>
> my %seen;
> my $n=0;
> @seen{@a}=(1)x@a;
> for (@b) {
> $n++ unless --$seen{$_}
> };
It also naturally avoids the awkward way of using a regex (/^$_$/) for
an equality test.
Using --$seen is an ingenious technique to secure that each element in
$b is counted only once, even if many are present. That wasn't specified,
I think, but I like it. If you don't mind the obfuscation, the loop
can be compacted:
$n += ! --$seen{ $_} for @b;
Anno
------------------------------
Date: 10 Aug 2001 14:18:49 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is an element in a table ?
Message-Id: <9l0qg9$qam$2@mamenchi.zrz.TU-Berlin.DE>
According to <nobull@mail.com>:
> plop740@mail.ru writes:
>
> > I have 2 lists of data: list A and list B
> >
> > What's the quickest way to see if, and how many elements of A are in B
> > ?
>
> This is FAQ "How do I compute the intersection of two arrays?"
Well, the FAQ doesn't address counting of the elements. Tackling
that directly may lead to a somewhat different solution.
Anno
------------------------------
Date: Fri, 10 Aug 2001 14:19:30 +0000
From: Richard Chamberlain <richard@sunsetandlabrea.com>
Subject: Re: Location: cgi problem
Message-Id: <c2Rc7.13138$tq.1491526@news6-win.server.ntlworld.com>
Anno Siegel wrote:
> Your post -- off topic for clpm
sorry - I didn't realise that.
> and devoid of diagnosable content for any group
sorry - I didn't realise that either, at the time I wrote it I thought it
was clear, but it was late - reading it back it doesn't make much sense.
> -- annoyed a lot of people.
sorry - didn't mean to.
> Expect to be annoyed back.
consider me told off.
>
> Anno
>
Richard
------------------------------
Date: 10 Aug 2001 06:28:18 -0700
From: charlie@disc7.com (Charlie Abbott)
Subject: Re: perl - write text file to server help
Message-Id: <3250787.0108100528.201bccd2@posting.google.com>
mgjv@tradingpost.com.au (Martien Verbruggen) wrote in message news:<slrn9n57i0.cq.mgjv@martien.heliotrope.home>...
> Even if we knew what you were asking[1] we probably wouldn't help you.
> To find programs, you should use searchengines and such. This newsgroup
I did use search engines and have tried all the usual Perl [download
script] sites thats why i turned to this group for help.
> tends to talk about Perl, the language. Not about all possible programs
> that may happen to have been written in Perl[2].
>
> If you're interested in solving your problem by actually writing a
> program, please come back once you have written something and you are
> stuck. When you do, make sure that you actually specify what you are
> trying to do in a way that a programmer (most of us are) can understand.
>
> Martien
>
> [1] Your problem is totally underspecified. What do you mean with 'write
> and update'? What do you mean by 'to a server'? What do you mean by
> 'need a redirect'? Are you talking about CGI? If so, make sure that you
> first understand CGI (and NO, this is not the place to ask or learn
> about CGI).
Im writing a Actionscript site that requires a Perl script to add some
variables to a text.txt file [644] that sits in a folder on my server,
once the variables have been passed to the text file the script will
need to jump [redirect] to another page on my site - as i understand
it this is a very simple action for Perl to perform and is in demand
by quite a few [if the posts on other groups are anything to go on]
Actionscript & Lingo programmers but there seems to be no pre written
scripts for this function anywhere on the net.
>
> [2] I'm boldly assuming that you wanted a program written in Perl. If
> not, then you are totally and utterly offtopic, and you should be
> ashamed of yourself.
As there don't seem to be any off the shelf solutions for this Perl
script i will need a program written.
Charlie
------------------------------
Date: 10 Aug 2001 14:32:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl 5.6 Pollute
Message-Id: <9l0r9u$qam$3@mamenchi.zrz.TU-Berlin.DE>
According to Brent Dax <brentdax1@earthlink.net>:
> "Eric" <eric@mizuhocap.com> wrote in message
> news:3B72EAF0.E66175FF@mizuhocap.com...
> > Does anyone know of a way to enable the POLLUTE option in perl 5.6 on a
> > one off basis ( a switch perhaps ), rather then having to recompile the
> > whole thing and forcing this environment POLLUTION in all cases?
>
> I don't believe there's a way to do that. You could compile two versions of
> Perl (/usr/bin/perl and /usr/bin/perl-superfund?) and just make sure you
> call the right one when you need pollution.
It is usually sufficient to define PERL_POLLUTE when translating the
offending source. PERL_POLLUTE is evaluated by include-files (perl.h,
embed.h and embedvar.h) which are included by such sources. These
define the missing sans-PL_ symbols. I won't swear this works in all
cases, but it did in a few.
Anno, who also used to keep a -DPERL_POLLUTE-compiled perl around
------------------------------
Date: 10 Aug 2001 10:33:03 -0400
From: stanb@panix.com (Stan Brown)
Subject: perlTK syntax question
Message-Id: <9l0rav$q20$1@panix2.panix.com>
I'm doing my first serious perlTK script, and I have a very simple syntax
question.
I have been creating widgets like this:
$entry = $Table->Entry(-textvariable => \$data_fields{$col} ,
-relief => 'sunken' ,
-validate => 'focusin' ,
-validatecommand => sub
{
Enter_entry_fields($col)
},
-width => "$$hash_pointer{$col}{'DATA_PRECISION'}");
And now I need to create some scrolled listboxes. The example code in the
widget demo uses a different method, involving qw//. I was wondering if
someone could look at the following, and see if I am interpeting corectly
the way to translate the above.
$entry = $Table->Scrolled(qw/Listbox
-height 1
-relief 'sunken'
-width "$$hash_pointer{$col}{'DATA_PRECISION'}
-validate 'focusin'
-validatecommand sub
{
Enter_entry_fields($col)
},
-setgrid 1 -scrollbars e/);
What I hope this does is create a scrolled listbox with properties just
like the Entry widget abov. I recognize I will have to fill in the valuse
seperately.
Thanks.
------------------------------
Date: Fri, 10 Aug 2001 14:14:47 GMT
From: "joeybach" <joeybach@hotmail.com>
Subject: Pipe the output of a command to script
Message-Id: <20010810.102214.722308542.17258@hotmail.com>
I am looking to pipe the output of a command to a script, like grep foo
|./perl.pl.
process the output of the grep in the perl script.
Does IO::Pipe handle this?
I just don't no where to start to look for this
------------------------------
Date: Fri, 10 Aug 2001 14:26:22 GMT
From: "joeybach" <joeybach@hotmail.com>
Subject: Re: Pipe the output of a command to script
Message-Id: <20010810.103350.1856669179.17258@hotmail.com>
Uh ... I got it next time "poke it with a stick" a little more before I post
while (<STDIN>){.....}
if any one has another way please post it.
In article <20010810.102214.722308542.17258@hotmail.com>, "joeybach"
<joeybach@hotmail.com> wrote:
> I am looking to pipe the output of a command to a script, like grep foo
> |./perl.pl.
> process the output of the grep in the perl script. Does IO::Pipe handle
> this?
> I just don't no where to start to look for this
------------------------------
Date: Fri, 10 Aug 2001 16:33:30 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Pipe the output of a command to script
Message-Id: <arr7nt06ani0r8i3urgvvgnjb1u4br5sbp@4ax.com>
On Fri, 10 Aug 2001 "joeybach" <joeybach@hotmail.com> wrote:
>I am looking to pipe the output of a command to a script, like grep foo
>|./perl.pl.
>process the output of the grep in the perl script.
>Does IO::Pipe handle this?
>I just don't no where to start to look for this
perldoc perlopentut
and check out the section "Pipe Opens" or use backticks, i.e.
my $grep = `grep foo bar`;
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Fri, 10 Aug 2001 08:47:59 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Poor man's HTML hidden field message digest??
Message-Id: <slrn9n7lvv.voa.tadmc@tadmc26.august.net>
Eric Bohlman <ebohlman@omsdev.com> wrote:
>Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
>> I am wondering first off why my if comparison (in my Perl script) doesn't
>> work? The number 24.9473684210533 appears on the screen yet when I run a
>> comparision for this number I get a false value. Am I getting rounding
>> errors?
There is a FAQ about that:
"Why am I getting long decimals (eg, 19.9499999999999)
instead of the numbers I should be getting (eg, 19.95)?"
>Yep. One of the first practical lessons programmers learn about floating
>point arithmetic is that you never compare two floating-point numbers for
>exact equality unless you're sure that they hold whole numbers. Try this
>for kicks:
>
>my $i=0;
>while ($i!=1) {
> print "$i\n";
> $i+=.1;
>}
And the usual way of diagnosing such problems is to output the
numbers with lots of significant figures.
You can see the effect earlier if you replace the print() above with:
printf "%30.20f\n", $i;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 10 Aug 2001 15:06:31 +0000
From: Richard Chamberlain <richard@sunsetandlabrea.com>
Subject: repeating substituation
Message-Id: <fKRc7.23444$e%3.2547952@news2-win.server.ntlworld.com>
Hi,
I'm using the following code:
$sectionHTML=~s/'/\\'/g;
$sectionHTML=~s/ffffff/000000/g;
$sectionHTML=~s/\"Times\"/\"Verdana\"/g;
so I'm replacing ' with \', ffffff with 000000 and "Times" with "Verdana"
in a big document.
I'm sure there is probably a much better way of doing that.
Any pointers?
Thanks,
Richard
------------------------------
Date: Fri, 10 Aug 2001 16:24:50 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: repeating substituation
Message-Id: <l2r7ntk3b0h0jffor30qq9rb5ef84159e3@4ax.com>
On Fri, 10 Aug 2001, Richard Chamberlain <richard@sunsetandlabrea.com>
wrote:
>Hi,
>
>I'm using the following code:
>
>$sectionHTML=~s/'/\\'/g;
>$sectionHTML=~s/ffffff/000000/g;
>$sectionHTML=~s/\"Times\"/\"Verdana\"/g;
>
>so I'm replacing ' with \', ffffff with 000000 and "Times" with "Verdana"
>in a big document.
>
>I'm sure there is probably a much better way of doing that.
Hm, OTTOH:
my %replace = ( "\'" => "\\\'",
"ffffff" => "000000",
"Times" => "Verdana" );
my $strings = join '|', keys %replace;
$sectionHTML =~ s/($strings)/$replace{$1}/g;
This might not work well if you have substitutions where one key is a
prefix of the other and of course it's still not very efficient - it
just looks more efficient because we unload all of the work on the
regex engine.
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Fri, 10 Aug 2001 17:03:20 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: telnet session through perl
Message-Id: <9js7ntsbvtnetlvpsnmfsa84rl6lk187k1@4ax.com>
Hi,
On Fri, 10 Aug 2001, "Scaramouche" <e.quesada@verizon.net> wrote:
>i'm attempting to create an html page that'll list a number of ip addresses.
>my goal is to allow (intranet) users to click on these hyperlinks, pass the
>specific ipaddress as the 'QUERY_STRING' value, to a script that'll in turn
>kick off a telnet session to that specific ipaddress.
[...]
What do you want to do? Open a telnet client on the user's side? Then
you should try '<A HREF="telnet://hostname/">telnet to hostname</A>'
in your HTML. Of course, the user must have the proper client mappedh
to handle telnet:// style URLs in his browser.
You can't simply run a telnet client from a CGI program to have the
telnet client run on the server - what happens is that you start the
telnet, and once that program tries to read input, it gets an EOF and
thus it exits. You could - at least theoretically - write a CGI
program that could run a telnet and exchange input/output with the
user via some sort of session - but I bet that it ain't pretty.
If you really want to do that, you should read up on the open3()
function and check out some papers that Randal L. Schwarz recommended
to me when I asked about how to keep run CGI programs running in the
background:
> You'll have to fork anything you want running after the end of the
> CGI-handling process. See
> <http://www.stonehenge.com/perl/googlecolumnsearch> and enter "fork"
> in the search box for my magazine column archive (now at 130+ columns)
> that mention forking.
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Fri, 10 Aug 2001 23:10:36 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: This is not a question ... call me slow if you like...
Message-Id: <slrn9n7nac.cq.mgjv@martien.heliotrope.home>
On Fri, 10 Aug 2001 13:35:01 +0100,
Paul Fortescue <paul@net366.com> wrote:
> But I think I've just realised what those funny signatures are at the bottom
> of these postings.
>
[snip of 15 line JAPH]
Seems you did. However, normally signatures are less than 4 lines long,
where lines are kept within 80 characters :) Maybe you can compress it
:)
Martien
--
Martien Verbruggen |
Interactive Media Division | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use
NSW, Australia | being a damn fool about it.
------------------------------
Date: Fri, 10 Aug 2001 23:47:00 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: This is not a question ... call me slow if you like...
Message-Id: <slrn9n7pek.cq.mgjv@martien.heliotrope.home>
On Fri, 10 Aug 2001 23:10:36 +1000,
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On Fri, 10 Aug 2001 13:35:01 +0100,
> Paul Fortescue <paul@net366.com> wrote:
>> But I think I've just realised what those funny signatures are at the bottom
>> of these postings.
>>
> [snip of 15 line JAPH]
>
> Seems you did. However, normally signatures are less than 4 lines long,
> where lines are kept within 80 characters :) Maybe you can compress it
>:)
And just to prove that compression makes it shorter, run the following
through
perl -MCompress::Zlib -MMIME::Base64 -l
for (unpack(("A67"x6).("A59"x8), uncompress(decode_base64(q(
eJw9k4uR4zAMQ1vin+y/sntQvOeZxIoEiiCAbB+PX2ReO8tebZxt6DtvuuLM3tY72dvaq7dWcU52
X81tzNm5/wDjntTNcc/kAA2P27SbKFB8ztPbbo3u62f9gGEqSPpbpf/IcMmMWIJZ8LP+vz9o3n3J
BOA71R96tQ4f8/6QRSm01/2SURy2FXv5DXUw4mf3QNBPh/RhLN+Bawe1AUDdONllxGkOdEVUZEBS
3CvXxE6qQD2onlo1hN+1oenmExp+S/m0RtNTMEMG0I3+Vh1tHctk4fDdirKZ4pf5mFnt5M6Yx7av
rQG0ifRib2ntFR0BR13i2QUJ7gh0TGDWNjBgOWof9amNGPCISuQaMZdCJfsZMOLT7JmvEjg8g3yQ
X6cQcUkkGZMIrIa6Nz6Ho1Ss3GBiXPjdFhK2UMUyvg09SUgWF4jZX+RI0W8ptT5kQpO4DLSVgc/T
Qiwg6/XlhIBoUjQlBehbSqwCM45DPaLosuXiGY7xhBi5ldZo+nZ1/gi7dHl/CVJRmG1XlKohlupt
fxOo+v4BN9e1hg==))))) { y/0-79/_/; print }
It's definitely much more obscured, but still too long, though :) And if
I didn't have to post it, I probably wouldn't have to use the mime
encoding, but it'd still be too long.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Fri, 10 Aug 2001 15:05:37 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Update: (Perl) programming contest loosely based on the prisoners' dilemma
Message-Id: <9l0m17$r0b$07$1@news.t-online.com>
"Yves Orton" <demerphq@hotmail.com> schrieb im Newsbeitrag
news:74f348f7.0108100359.2b7908f4@posting.google.com...
> This sounds like Core-Wars or Core-Bots.
>
> Yves
> Im interested in hearing more though. Sounds neat.
Yeah, now that you mention Core Wars, it reminds me of it, too. Only
concerning the playing grounds, however.
I cannot really tell you a lot more because there isn't yet. Before I start
working on the platform for the contest (eg. the glue between the entries),
I wanted to get some feedback if such a contest is wanted at all.
Considering the incredible amount of follow-ups, I might not start at all...
Steffen
------------------------------
Date: Fri, 10 Aug 2001 15:59:08 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Using LWP to traverse site & download file
Message-Id: <o0p7ntsaj522dkn137hh85og1044nuioua@4ax.com>
Hi,
On 10 Aug 2001, ralawrence@my-deja.com (Richard Lawrence) wrote:
>I've written a perl script which attempts to download MAME ROM's
>automatically from www.mame.dk. [...]
I don't think that the mame.dk crew would appreciate that. After all,
they're taking all those steps to prevent people from doing it.
I have not spent much time on this, but it looks like their cgi code
"identifies" a request made by LWP by its properly encoded URIs:
------8<---( cut here )---8<------
#!/usr/bin/perl -w
use strict;
use HTTP::Request;
my $req = new HTTP::Request GET => "http://localhost/foo?bar=|";
print $req->uri();
------8<---( cut here )---8<------
Some notes on your code: If you pass in more than one parameter to a
sub, you could write: "my( $param, $param2, ... ) = @_;.
The construct
unless( some_test )
{
print $error_message;
exit;
}
looks better as:
die $error_message unless some_test;
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: 10 Aug 2001 13:18:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Why is $i so popular?
Message-Id: <9l0mu9$nlv$1@mamenchi.zrz.TU-Berlin.DE>
According to Yves Orton <demerphq@hotmail.com>:
> Ps Slighlty different question, what the origin of @_ and $_? Is
> there a story to it or did it just happen?
Well, in C there is a convention to use names beginning with "_" for
things the user isn't supposed to touch, or things (like system
variables) they may use, but which have a certain meaning the user
must be aware of. Presumably the assumption is that people don't
come up with variable names like that on their own. That would make
"_" the name of, well, yer basic system variable. If that is really
what prompted Larry (or the designers of other languages with
similar variables) is another question.
Anno
------------------------------
Date: Fri, 10 Aug 2001 09:21:41 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Why is $i so popular?
Message-Id: <slrn9n7nv5.voa.tadmc@tadmc26.august.net>
Paul Fortescue <paul@net366.com> wrote:
>I don't however, know why foo and bar exist, I was already past it by then!
http://www.tuxedo.org/~esr/jargon/html/entry/foobar.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 10 Aug 2001 16:04:03 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: Why is $i so popular?
Message-Id: <997455832.6118.0.nnrp-13.d4f094e4@news.demon.co.uk>
That, surprisingly, is quite funny. But does anyone know the real reason, or
is it something so obvious that I am making a foo| of myself by even asking
the question? Or is it an American thing (I am from the UK)
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:dhj7nt4qtjor3ucnpj332plcahb00ibaa0@4ax.com...
> Paul Fortescue wrote:
>
> >I don't however, know why foo and bar exist, I was already past it by
then!
>
> There appears to be an RFC about it.
>
> <ftp://ftp.rfc-editor.org/in-notes/rfc3092.txt>
>
> But do note the date.
>
> --
> Bart.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1487
***************************************