[25457] in Perl-Users-Digest
Perl-Users Digest, Issue: 7702 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 27 21:05:37 2005
Date: Thu, 27 Jan 2005 18:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 27 Jan 2005 Volume: 10 Number: 7702
Today's topics:
Re: *HELP WITH WRITING SPIDERS/BOTS/WANDERERS* tiberiousmining@hushmail.com
[ANNOUNCE] SQL::Preproc 0.10, an SQL preprocessor for P <dean.arnold@sbcglobal.net>
[perl-python] 20050127 traverse a dir <xah@xahlee.org>
Re: [perl-python] 20050127 traverse a dir <matternc@comcast.net>
Re: [perl-python] 20050127 traverse a dir <antbyte.The.Flow@gmail.com>
Re: [perl-python] 20050127 traverse a dir <a@a.invalid>
Re: [perl-python] 20050127 traverse a dir <antbyte.The.Flow@gmail.com>
Re: cannot open and write file <HelgiBriem_1@hotmail.com>
cookie related problem... <tanja@verso.co.izbaciovo>
Re: cookie related problem... <spamtrap@dot-app.org>
Re: cookie related problem... <tanja@verso.co.izbaciovo>
Re: how to write a tutorial <drewc@rift.com>
htaccess rewriterule in combination with POST form <bart@NOSPAM.tvreclames.nl>
Re: htaccess rewriterule in combination with POST form <flavell@ph.gla.ac.uk>
Looping Dir entires with space <eric@afaik.us>
Re: Looping Dir entires with space <eric@afaik.us>
Re: Looping Dir entires with space <noreply@gunnar.cc>
Re: Old tutorial - now corrected binnyva@hotmail.com
Re: Old tutorial - now corrected <mritty@gmail.com>
Re: Old tutorial - now corrected (Anno Siegel)
Re: Perl Script <lawshouse.public@btconnect.com>
Re: Radix Sort in CPAN <1usa@llenroc.ude.invalid>
Recieve a $100 gift! <residulizer@imasales.com>
Re: why not multiple statement modifiers? <nobull@mail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Jan 2005 13:13:29 -0800
From: tiberiousmining@hushmail.com
Subject: Re: *HELP WITH WRITING SPIDERS/BOTS/WANDERERS*
Message-Id: <1106860409.116606.136030@f14g2000cwb.googlegroups.com>
I just built a simple one and it is crawling right now. It is very
simple and very fundemental at this point as I am experimenting also
with crawler mobility and Perl.
Tiberious Mining.
------------------------------
Date: Thu, 27 Jan 2005 19:03:54 GMT
From: Dean Arnold <dean.arnold@sbcglobal.net>
Subject: [ANNOUNCE] SQL::Preproc 0.10, an SQL preprocessor for Perl
Message-Id: <IAzpK0.2sy@zorch.sf-bay.org>
I'm pleased to announce the first release of SQL::Preproc,
an embeded SQL preprocessor for Perl.
It should be available on CPAN soon, but is also available
at http://www.presicient.com/sqlpp
In support of SQL::Preproc's test suite, I've also CPAN'd
bug fix releases of DBD::Chart (0.81) and DBIx::Chart (0.02).
(Also available at http://www.presicient.com/dbdchart and
http://www.presicient.com/dbixchart, respectively)
This release of SQL::Preproc has been tested on
- WinXP w/ AS Perl 5.8.3 and DBI 1.42, using both DBD::CSV and
DBD::Teradata.
- Linux (Fedora Core 2) w/ AS Perl 5.8.6 and DBI 1.46, using just DBD::CSV.
Note that this release has not yet been tested to support
updatable cursors, or stored procedure calls, though test suites
are provided for them. I hope to address those in a month or
so after I get other projects off my plate.
This release should be considered alpha level, but I'd appreciate
any feedback wrt features or testing, esp for other database
systems/DBI drivers.
Comments/suggestions/patches/bug reports welcome.
Regards,
Dean Arnold
Presicient Corp.
------------------------------
Date: 27 Jan 2005 11:37:05 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: [perl-python] 20050127 traverse a dir
Message-Id: <1106854625.289187.28710@z14g2000cwz.googlegroups.com>
# -*- coding: utf-8 -*-
# Python
suppose you want to walk into a directory, say, to apply a string
replacement to all html files. The os.path.walk() rises for the
occasion.
=A9 import os
=A9 mydir=3D '/Users/t/Documents/unix_cilre/python'
=A9 def myfun(s1, s2, s3):
=A9 print s2 # current dir
=A9 print s3 # list of files there
=A9 print '------=3D=3D(^_^)=3D=3D------'
=A9 os.path.walk(mydir, myfun, 'somenull')
----------------------
os.path.walk(base_dir,f,arg) will walk a dir tree starting at
base_dir, and whenever it sees a directory (including base_dir), it
will call f(arg,current_dir,children), where the current_dir is the
string of the current directory, and children is a *list* of all
children of the current directory. That is, a list of strings that are
file names and directory names. Try the above and you'll see.
now, suppose for each file ending in .html we want to apply function
g to it. So, when ever myfun is called, we need to loop thru the
children list, find files and ending in html (and not a directory),
then call g. Here's the code.
=A9 import os
=A9 mydir=3D '/Users/t/web/SpecialPlaneCurves_dir'
=A9 def g(s): print "g touched:", s
=A9 def myfun(dummy, dirr, filess):
=A9 for child in filess:
=A9 if '.html' =3D=3D os.path.splitext(child)[1] \
=A9 and os.path.isfile(dirr+'/'+child):
=A9 g(dirr+child)
=A9 os.path.walk(mydir, myfun, 3)
note that os.path.splitext splits a string into two parts, a portion
before the last period, and the rest in the second portion. Effectively
it is used for getting file suffix. And the os.path.isfile() make sure
that this is a file not a dir with .html suffix... Test it yourself.
one important thing to note: in the mydir, it must not end in a
slash. One'd think Python'd take care of such trivia but no. This took
me a while to debug.
also, the way of the semantics of os.path.walk is nice. The myfun can
be a recursive function, calling itself, crystalizing a program's
semantic.
---------------------------
# in Perl, similar program can be had.
# the prototypical way to traverse a dir
# is thru File::Find;
use File::Find qw(find);
$mydir=3D '/Users/t/web/SpecialPlaneCurves_dir';
find(\&wanted, $mydir);
sub g($){print shift, "\n";}
sub wanted {
if ($_ =3D~/\.html$/ && -T $File::Find::name) { g $File::Find::name;}
$File::Find::name;
}
# the above showcases a quick hack.
# File::Find is one of the worst module
# there is in Perl. One cannot use it
# with a recursive (so-called) "filter"
# function. And because the way it is
# written, one cannot make the filter
# function purely functional. (it relies
# on the $_) And the filter function
# must come in certain order. (for
# example, the above program won't work
# if g is moved to the bottom.) ...
# the quality of modules in Perl are
# all like that.
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: Thu, 27 Jan 2005 15:01:12 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: [perl-python] 20050127 traverse a dir
Message-Id: <UNSdnezK9cMU1WTcRVn-pQ@comcast.com>
Xah Lee wrote:
<snip>
>
> # the above showcases a quick hack.
> # File::Find is one of the worst module
> # there is in Perl. One cannot use it
> # with a recursive (so-called) "filter"
> # function. And because the way it is
> # written, one cannot make the filter
> # function purely functional. (it relies
> # on the $_) And the filter function
> # must come in certain order. (for
> # example, the above program won't work
> # if g is moved to the bottom.) ...
>
> # the quality of modules in Perl are
> # all like that.
Is it just me, or is the disappointing lack of flamewars
slowly ratcheting up the level of vitriol in his posts?
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: 27 Jan 2005 17:20:59 -0800
From: "The Flow" <antbyte.The.Flow@gmail.com>
Subject: Re: [perl-python] 20050127 traverse a dir
Message-Id: <1106875259.426213.252030@z14g2000cwz.googlegroups.com>
Xah Lee,
Do you want to be taken seriously?
First, stop posting.
Second, learn perl.
Third, learn python.
------------------------------
Date: Fri, 28 Jan 2005 01:36:19 GMT
From: Timo Virkkala <a@a.invalid>
Subject: Re: [perl-python] 20050127 traverse a dir
Message-Id: <nGgKd.620$zi5.487@read3.inet.fi>
The Flow wrote:
> Do you want to be taken seriously?
> First, stop posting.
> Second, learn perl.
> Third, learn python.
No. Second, learn Python. Third, learn Perl (optional). :)
But we do agree on the first.
--
Timo Virkkala
------------------------------
Date: 27 Jan 2005 17:39:00 -0800
From: "The Flow" <antbyte.The.Flow@gmail.com>
Subject: Re: [perl-python] 20050127 traverse a dir
Message-Id: <1106876340.013509.296840@f14g2000cwb.googlegroups.com>
Sorry about that... (I forgot what he was trying to teach)
Thanks for the clarification
--
The Flow
------------------------------
Date: Fri, 21 Jan 2005 13:55:28 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: cannot open and write file
Message-Id: <aa22v0tcciqi2f22adtde93kqg76bjp6va@4ax.com>
On Fri, 21 Jan 2005 08:22:40 -0500, Chris Mattern
<matternc@comcast.net> wrote:
>Roll wrote:
>
>> i want to try writing to a file. i try this coding
>> <write.cgi>
>> #!/usr/bin/perl
>> open(OUTF,">>/root/a.conf");
>> print OUTF "anc";
>> close OUTF
>>
>> but when i open this page using a web browser, it give me an error 403??
>> can anyone tell me y is this so did i miss some coding or it should be
>> written in another way?
>
>You web process does not have permission to write to /root/a.conf.
.... and the OP can test this by doing things properly:
#!/usr/bin/perl
use warnings;
use strict;
my $out = '/root/a.conf';
open(OUTF,">>", $out) or die "Cannot open $out for appending:$!";
print OUTF "anc";
close OUTF or die "Cannot close $out:$!";
--
Helgi Briem hbriem AT simnet DOT is
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
------------------------------
Date: Thu, 27 Jan 2005 22:15:41 +0100
From: "Tanja" <tanja@verso.co.izbaciovo>
Subject: cookie related problem...
Message-Id: <41f959fe$1@news.s5.net>
$URL=http://www.oglasnik.hr/perl/oglasnik.pl?izdanje=$izdanje;
use LWP::Simple;
unless (defined ($content = get $URL)) {
die "could not get $URL\n";
}
---------------------------
When I get content from web, I have a problem with cookie authorization.
If I read from IE , server read cookie and get full data.
Please help.
------------------------------
Date: Thu, 27 Jan 2005 16:35:42 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: cookie related problem...
Message-Id: <bJKdneuBzOksw2TcRVn-pQ@adelphia.com>
Tanja wrote:
> $URL=http://www.oglasnik.hr/perl/oglasnik.pl?izdanje=$izdanje;
> use LWP::Simple;
> unless (defined ($content = get $URL)) {
> die "could not get $URL\n";
> }
Please post your real code. The above has a simple syntax error in it. I'm
not just nit-picking - You've forgotten to quote a string in the quote
above, and I suspect that the way you're quoting it in your real code is
the key to your problem.
> When I get content from web, I have a problem with cookie authorization.
> If I read from IE , server read cookie and get full data.
"A problem"? What would that problem be? Please don't paraphrase or
summarize - just paste the error message.
> Please help.
Ask Perl for help first. Add the following to the top of your script:
#!/usr/bin/perl
use warnings;
use strict;
Have you read the posting guidelines that appear here twice a week? If you
haven't read them yet, please do.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 27 Jan 2005 23:28:34 +0100
From: "Tanja" <tanja@verso.co.izbaciovo>
Subject: Re: cookie related problem...
Message-Id: <41f96b13$1@news.s5.net>
This script work normally, I don't have any Error message, but result is
different from perl, and Internet Explorer.
Perl result is without phone numbers
Real code:
==============================================================
#c:\perl
#
$URL="http://www.oglasnik.hr/perl/oglasnik.pl?izdanje=1888;rubrika=150101;st
art=0";
use LWP::Simple;
unless (defined ($content = get $URL)) {
die "could not get $URL\n";
}
==============================================================
Perl result:
150101 alfa 145 1.6 boxer - motor, mjenjač i dr. mehanika, ___/________
150101 alfa 145/146 1.6, 98.g. - dijelovi mehanike s elektronikom,
___/________
150101 alfa 146 1.4 TS, motor u dijelovima ulja pumpa nova, ___/________
150101 alfa 156 1.8 TS, 99.g: getriba, kompresor klime, servo bubanj
kočnica, mješač zraka, ___/________
150101 alfa 156 2.4 JTD, 00.g. - turbina original za 150KS, 600 ?,
___/________
150101 Alfa 164 2.0, 91.g. - motor, ___/________
IE result:
150101 alfa 145 1.6 boxer - motor, mjenjač i dr. mehanika, 098/9232-700
150101 alfa 145/146 1.6, 98.g. - dijelovi mehanike s elektronikom,
098/9393-807
150101 alfa 146 1.4 TS, motor u dijelovima ulja pumpa nova, 091/2537-331
150101 alfa 156 1.8 TS, 99.g: getriba, kompresor klime, servo bubanj
kočnica, mješač zraka, 091/7309-217
150101 alfa 156 2.4 JTD, 00.g. - turbina original za 150KS, 600 ?,
091/3832-413
150101 Alfa 164 2.0, 91.g. - motor, 091/5538-020
==============================================================
IE-cookie: korisnik@oglasnik[2].txt
==============================================================
ogl_i1888
fRToPUEW6zeO4KNSpUAejQ
oglasnik.hr/
1536
2153322112
29724753
2888660272
29688543
*
ogl_user
korisnik
oglasnik.hr/
1536
2153322112
29724753
2888960272
29688543
*
==============================================================
------------------------------
Date: Fri, 21 Jan 2005 13:23:08 GMT
From: drewc <drewc@rift.com>
Subject: Re: how to write a tutorial
Message-Id: <0n7Id.135415$Xk.80179@pd7tw3no>
You should not be giving such advice! (and the crosspost ... WTF?).
I've been trying to follow along with your perl/python yahoo group, but
your posts are terrible.
Perhaps you should provide the output of the code you post. Then i'd
actually know what i'm trying to achieve. As it is i have to cut/paste
your code into an interpreter just to figure out what it does.
What does this have to do with Lisp? (i'm in c.l.l).
drewc
Xah Lee wrote:
> i've started to read python tutorial recently.
> http://python.org/doc/2.3.4/tut/tut.html
>
> Here are some quick critique:
>
> quick example:
> If the input string is too long, they don't truncate it, but return it
> unchanged; this will mess up your column lay-out but that's usually
> better than the alternative, which would be lying about a value. (If
> you really want truncation you can always add a slice operation, as in
> "x.ljust( n)[:n]".
>
> better:
> If the input string is too long, they don't truncate it, but return it
> unchanged;
> -----------------
> delete: Reverse quotes (``) are equivalent to repr(), but their use is
> discouraged.
> -----------------
> similarly, many places mentioning uncritical info such as warning or
> reference to other languages should be deleted.
>
> the tutorial should be simple, concise, to the point, stand along.
> Perhaps 1/5th length of the tutorial should be deleted for better.
> Follow the above principles.
>
> at places often a whole paragraph on some so called computer science
> jargons should be deleted. They are there more to showcase inane
> technicality than do help the reader. (related, many passages with
> jargons should be rewritten sans inane jargon. e.g. mutable object.)
>
> one easy way to understand these principles is to compare perl's
> documentation or unix man pages to Python's. The formers are often
> irrelevant, rambling on, not stand-along (it is written such that it
> unnecessarily requires the reader to be knowledgable of lots of other
> things). Python docs are much better, but like many computer language
> manuals, also suffers from verbiage of tech jargons. (these jargons or
> passages about them are usually there to please the authors
> themselves).
>
> A exemplary writing in this direction is the Mathematica manual by
> Stephen Wolfram. Any intelligent layman sans computer science degree
> can read it straightforwardly, and learn unhindered a language that is
> tantamount to features of lisp languages. Such documentation is not
> difficult to write at all. (contrary to the lot of "computer
> scientists" or IT pundits morons.) All it take is some simple
> principles outlined above.
> Xah
> xah@xahlee.org
> http://xahlee.org/PageTwo_dir/more.html
>
------------------------------
Date: Thu, 27 Jan 2005 23:38:28 +0100
From: "Bart van den Burg" <bart@NOSPAM.tvreclames.nl>
Subject: htaccess rewriterule in combination with POST form
Message-Id: <ctbquj$dv7$1@reader10.wxs.nl>
Hi
I´m currently building a new page, and instead of
http://.../page.pl?param1=val1¶m2=val2
I'm using
http://.../page/val1/val2
then in .htaccess:
RewriteEngine On
RewriteRule ^page/(\d+)/(\d+)$ site.pl?page=page¶m1=$1¶m2=$2
This works perfectly fine. in my script i can access the parameters using
the param() function.
The problem however is, when i have a form like this:
<form action="page/val1/val2" method="post">
<input type="text" name="param3" value="val3"/>
<input type="submit" value="go!"/>
</form>
i can't access param1 and param2 from my script anymore!
Long story for a short question: What can I do, so that i can access those
parameters again, but still making the form method="post"?
(I'm not really sure whether this is due to Perl or not, but i hope you know
the answer...)
------------------------------
Date: Thu, 27 Jan 2005 23:36:53 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: htaccess rewriterule in combination with POST form
Message-Id: <Pine.LNX.4.61.0501272322280.22257@ppepc56.ph.gla.ac.uk>
On Thu, 27 Jan 2005, Bart van den Burg wrote:
> I´m currently building a new page, and instead of
> http://.../page.pl?param1=val1¶m2=val2
> I'm using
> http://.../page/val1/val2
You don't seem to have a Perl problem...
> then in .htaccess:
> RewriteEngine On
> RewriteRule ^page/(\d+)/(\d+)$ site.pl?page=page¶m1=$1¶m2=$2
>
> This works perfectly fine.
(except that you've now turned a static path component into a query
string, and baffled all the caches and indexing robots from here to
W3C.)
So: very interesting... but what are you trying to achieve?
> in my script i can access the parameters using
> the param() function.
I think we've already grasped that this is a "stealth CGI" question,
as the c.l.p.m-ers are accustomed to call it.
> The problem however is, when i have a form like this:
> <form action="page/val1/val2" method="post">
> <input type="text" name="param3" value="val3"/>
> <input type="submit" value="go!"/>
> </form>
>
> i can't access param1 and param2 from my script anymore!
method=post is different. I'd have to recommend reading its
documentation and/or following a CGI.pm tutorial, depending on whether
you're interested in the technical detail, or trying to get something
running in production, respectively.
> Long story for a short question: What can I do, so that i can access
> those parameters again, but still making the form method="post"?
On the basis of what you're posting (this is all that we have to go on
in usenet discussions, you understand - nothing personal - and I'm
sure you're kind to animals and small children and all that), I'd have
to suggest that you a) study the CGI interface in a bit more detail,
in particular the difference between GET and POST requests, 2) try to
make a habit of putting some context around your questions so we can
see how they are meant to fit in, and 3) raise CGI-specific questions
on comp.infosystems.www.authoring.cgi (beware the automoderation bot),
and try to limit postings on this group to issues which really relate
to the Perl language.
> (I'm not really sure whether this is due to Perl or not, but i hope
> you know the answer...)
I'd be happier to offer it in the right place. But frankly (and again
I stress this is nothing personal), once you understand the principles
of this part of the protocol, the answer should seem self-evident.
Until you understand this part of the HTTP protocol, I don't see how
/any/ answer could make sense. But none of that is specific to the
Perl programming language - which really puts it off-topic here.
best I can do at this time of night...
------------------------------
Date: Thu, 27 Jan 2005 20:05:30 -0500
From: Eric Anderson <eric@afaik.us>
Subject: Looping Dir entires with space
Message-Id: <35thevF4rs3cgU1@individual.net>
I am developing a Perl CGI application that needs to work on both
Windows and UNIX. In a couple of places in the app, I read a list of
files from a directory. My basic code is something like:
my $config_dir = '/conf/';
if( -d $config_dir ) {
my $file;
while(defined($file=<$config_dir*>)) {
print "$file\n";
}
}
This seems to work just fine. But if the variable $config_dir has a
string with a space in it (e.g. '/Program Files/Foo Bar') then it
doesn't seem to list the files correctly. The app seems to be reading
each part of the path (split on the space) as it's own file. So my
output will be something like:
/Program
Files/Foo
So my first thought is to change the code to the following:
my $config_dir = '/Program Files/';
if( -d $config_dir ) {
my $file;
while(defined($file=<"$config_dir"*>)) {
print "$file\n";
}
}
This makes it work fine with there is a space in the path but now it
doesn't work when there is not a space in the path. If $config_dir is
set to '/conf/' I don't get a listing at all.
So my question is how do I iterate through a list of files in a
directory in such a way that will work on both UNIX and Windows and work
when the path has a space and doesn't have a space. Also sometimes I
will need to do stuff like:
while(defined($file=<$config_dir/foo/bar/*>)) {
print "$file\n";
}
I need this to work when $config_dir has a space and doesn't have a
space. I checked google and the various perl man pages but wasn't able
to find the answer I am looking for. Any help would be greatly appreciated.
Eric
------------------------------
Date: Thu, 27 Jan 2005 20:11:52 -0500
From: Eric Anderson <eric@afaik.us>
Subject: Re: Looping Dir entires with space
Message-Id: <35thqtF4ppbaqU1@individual.net>
Eric Anderson wrote:
> So my question is how do I iterate through a list of files in a
> directory in such a way that will work on both UNIX and Windows and work
> when the path has a space and doesn't have a space.
Nevermind. After some additional searching I found the following method:
opendir(DIR,$config_dir);
foreach my $file ( readdir(DIR) ) {
print "$file\n";
}
closedir(DIR);
Thanks anyway,
Eric
------------------------------
Date: Fri, 28 Jan 2005 02:37:43 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Looping Dir entires with space
Message-Id: <35tj7rF4qf9llU1@individual.net>
Eric Anderson wrote:
> I am developing a Perl CGI application that needs to work on both
> Windows and UNIX. In a couple of places in the app, I read a list of
> files from a directory. My basic code is something like:
>
> my $config_dir = '/conf/';
> if( -d $config_dir ) {
> my $file;
> while(defined($file=<$config_dir*>)) {
> print "$file\n";
> }
> }
>
> This seems to work just fine. But if the variable $config_dir has a
> string with a space in it (e.g. '/Program Files/Foo Bar') then it
> doesn't seem to list the files correctly.
<snip>
> So my question is how do I iterate through a list of files in a
> directory in such a way that will work on both UNIX and Windows and work
> when the path has a space and doesn't have a space.
You can escape the spaces before the while loop:
$config_dir =~ s/ /\\ /g;
I'm still not sure about the portability of the <dir/*> notation, and
usually I use opendir() and readdir() when I need portable code.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 27 Jan 2005 11:25:01 -0800
From: binnyva@hotmail.com
Subject: Re: Old tutorial - now corrected
Message-Id: <1106853901.148392.301710@z14g2000cwz.googlegroups.com>
Not everybody said that I have to junk my tutorial.
Two or three persons said that - the majority said that I
have to improve the tutorial. Anyway even if everyday
would have asked me to trash the tutorial, I would not
have done so. Come on guys, we are programmers - if we
see a lot of errors when we first run a new program, do
we scrape the project or do we correct it? Thats what I
am trying to do.
Binny.
------------------------------
Date: Thu, 27 Jan 2005 20:15:15 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Old tutorial - now corrected
Message-Id: <nZbKd.191$091.73@trndny02>
<binnyva@hotmail.com> wrote in message
news:1106853901.148392.301710@z14g2000cwz.googlegroups.com...
> Come on guys, we are programmers - if we
> see a lot of errors when we first run a new program, do
> we scrape the project or do we correct it? Thats what I
> am trying to do.
But in the *meantime*, you are displaying faulty code allegedly
intentioned to help new programmers. Professional programmers do NOT
release code they know to be buggy *before* repairing it. It is not
good enough to say that you'll eventually fix it, all the while allowing
the possibility of some unsuspecting newbie finding and attempting to
learn from it. That is, I believe, what most people are complaining
about.
Paul Lalli
------------------------------
Date: 27 Jan 2005 21:44:32 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Old tutorial - now corrected
Message-Id: <ctbnc0$1og$1@mamenchi.zrz.TU-Berlin.DE>
<binnyva@hotmail.com> wrote in comp.lang.perl.misc:
> Not everybody said that I have to junk my tutorial.
> Two or three persons said that - the majority said that I
> have to improve the tutorial. Anyway even if everyday
> would have asked me to trash the tutorial, I would not
> have done so.
Then why did you ask our opinion?
> Come on guys, we are programmers - if we
> see a lot of errors when we first run a new program, do
> we scrape the project or do we correct it? Thats what I
> am trying to do.
"We" don't publish every brain fart on the web. That's what you're doing,
and it's wrong.
Anno
------------------------------
Date: Thu, 27 Jan 2005 21:48:20 +0000
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Re: Perl Script
Message-Id: <q5oiv05fqgbvarnlbb3v73g5o3hq6n0tmb@4ax.com>
On 27 Jan 2005 04:52:55 -0800, "padmakumar" <padmakumarp@gmail.com>
wrote:
>I have a one standard directory structure(Root directory and its sub
>directories).
>I'vebeen asked to write a perl script to create a database which
>maintains directory structure
There are two questions here: firstly how do you write an application
which creates a "database which maintains directory structure";
secondly how do you do that specifically in Perl.
I'm not sure I understand the first question, but it's not appropriate
to ask it here. This is a group for discussing the coding of the
program in Perl, not the design of it.
Once you've worked out the first question then the second one is a
valid topic here, but custom says that you'll only get help if you
have had a try at coding your program in Perl first, and come here to
get advice on how to make it better.
------------------------------
Date: 21 Jan 2005 13:58:46 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Radix Sort in CPAN
Message-Id: <Xns95E55B5F18AFDasu1cornelledu@132.236.56.8>
Sherm Pendley <spamtrap@dot-app.org> wrote in
news:U7adnWKUwfJtaW3cRVn-vQ@adelphia.com:
> Edward Wijaya wrote:
>
>> Does anybody know if there is an implementation of Radix sort in
>> CPAN? I can't find anything searchin in CPAN.
>
> I go to <http://search.cpan.org>, type in "radix sort", and
> immediately get a list of links back. The first link is a module
> called Sort::Radix.
>
> Looking at the docs, I see "Edward Wijaya" listed as the implementor.
> If you're not lying about your name, this is a *really* stupid attempt
> to pimp your module. I see the copyright is 2005, so obviously it's
> new. Go to the c.l.p.announce list and make a proper announcement,
> instead of posting fake questions about it.
Running the example
use strict;
use warnings;
use Sort::Radix;
my @array = qw(flow loop pool Wolf root sort tour);
radix_sort(\@array);
print "@array\n";
from http://search.cpan.org/~ewijaya/Sort-Radix-0.01/lib/Sort/Radix.pm
yields:
C:\Temp> t
Undefined subroutine &Sort::Radix::radix_sort called at C:\Temp\t.pl
line 7.
This seems to be because the sub radix_sort is placed _after_ the
__END__ marker in the module file.
Fixing that yields:
C:\Temp> t
Argument "flow" isn't numeric in subtraction (-) at Sort/Radix.pm line
44.
Wolf flow loop pool root sort tour
While I do not have time to debug this thing, I think it is a very bad
sign when the only routine exported by the module is placed after
__END__.
Tried reporting the bug but I guess the module is not in the system yet.
I got directed to <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sort-Radix>.
Sinan.
------------------------------
Date: Thu, 27 Jan 2005 16:25:39
From: "Charles Peterson" <residulizer@imasales.com>
Subject: Recieve a $100 gift!
Message-Id: <T4CdnQ0x3un_92TcRVn-2w@comcast.com>
Right now, residulizer.com is running a promotion so unheard of it's amazing.
The next 500 people to join will recieve an extra $100 worth of rotation , absolutely free! All you have to do is check it out and get in while this offer is still available. With a promotion like this, the next 500 could fill up today!
What do I have to do to get the $100 of rotation? Simply check us out at residulizer.com, sign up, and pay the random sponsors and admin fee, and you will automatically riecieve the $100 credit, but act fast because it won't last. Make sure that you pay your membership so that you can recieve payment of those that are in your downline! Have a great day and check us out now!
P.S. don't for you MLMers, don't forget to bring your downline!
---
MAF Anti-Spam ID: 20050121132653G4k9TuI4
------------------------------
Date: Fri, 21 Jan 2005 12:28:07 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: why not multiple statement modifiers?
Message-Id: <csqs70$77$1@sun3.bham.ac.uk>
ioneabu@yahoo.com wrote:
> How often have people had to change:
>
> dosomething() if $true;
>
> to
>
> if ($true)
> {
> dosomething() for @list;
> }
I'd say that if I consider hours spent actually cutting Perl code (as
opposed to total elapsed time) it would be every 2 to 10 hours.
------------------------------
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 7702
***************************************