[25395] in Perl-Users-Digest
Perl-Users Digest, Issue: 7640 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 13 09:05:57 2005
Date: Thu, 13 Jan 2005 06:05:26 -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, 13 Jan 2005 Volume: 10 Number: 7640
Today's topics:
[perl-python] 20050112 while statement <xah@xahlee.org>
Re: [perl-python] 20050112 while statement <cam.ac.uk@mh391.invalid>
Re: [perl-python] 20050112 while statement brianr@liffe.com
Re: Adding a delimiter inbetween number characters and <jurgenex@hotmail.com>
Re: Adding a delimiter inbetween number characters and <do-not-use@invalid.net>
Re: Adding a delimiter inbetween number characters and <do-not-use@invalid.net>
array of arrays: searching for wisdom ... (Alythh)
Re: array of arrays: searching for wisdom ... <toreau@gmail.com>
Re: array of arrays: searching for wisdom ... <nobull@mail.com>
Re: Best way to build up XHTML <vetler@gmail.com>
Re: Best way to build up XHTML <vetler@gmail.com>
Re: CGI: Execute a perl script inside another perl scri xdarcos@hotmail.com
Re: CGI: Execute a perl script inside another perl scri <nobull@mail.com>
Re: complex numbers <apardon@forel.vub.ac.be>
Re: Determining which module exported a specific functi <news@chaos-net.de>
Re: Determining which module exported a specific functi (Anno Siegel)
Re: Determining which module exported a specific functi <nobull@mail.com>
Re: disk space script (Anno Siegel)
Re: FAQ 4.30: How do I capitalize all the words on one <matthew.garrish@sympatico.ca>
Re: Loop through a text file line by line <news@chaos-net.de>
Perl CGI does not generate file. <gazza@192.168.1.1>
Re: Perl CGI does not generate file. <mritty@gmail.com>
Perl Distribution <GeorgeKinleyxxx@hotmail.com>
Re: Perl Distribution <GeorgeKinleyxxx@hotmail.com>
Perl on easyPhp <john@aderseen.com>
please # japh <igor.lobanov@gmail.com>
Re: please # japh <igor.lobanov@gmail.com>
Re: Print question <jurgenex@hotmail.com>
Random Functionality <sbryce@scottbryce.com>
Re: Random Functionality (Anno Siegel)
Re: Session ID / login security script <Support@GoMonitor.com>
Strange DBI error <lawrence.tierney@bipcontracts.com>
Re: Strange DBI error <phaylon@dunkelheit.at>
Re: Strange DBI error <nospam@bigpond.com>
Re: Strange DBI error <lawrence.tierney@bipcontracts.com>
Re: Strange DBI error <lawrence.tierney@bipcontracts.com>
Re: Strange DBI error <phaylon@dunkelheit.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jan 2005 02:18:26 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: [perl-python] 20050112 while statement
Message-Id: <1105611506.106440.135670@f14g2000cwb.googlegroups.com>
# here's a while statement in python.
a,b = 0,1
while b < 20:
print b
a,b = b,a+b
---------------
# here's the same code in perl
($a,$b)=(0,1);
while ($b<20) {
print $b, "\n";
($a,$b)= ($b, $a+$b);
}
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: Thu, 13 Jan 2005 11:06:44 +0000
From: Michael Hoffman <cam.ac.uk@mh391.invalid>
Subject: Re: [perl-python] 20050112 while statement
Message-Id: <cs5ko8$j5e$1@gemini.csx.cam.ac.uk>
Xah Lee wrote:
> # here's a while statement in python.
>
> [...]
>
> # here's the same code in perl
>
> [...]
So?
--
Michael Hoffman
------------------------------
Date: Thu, 13 Jan 2005 13:05:16 +0000
From: brianr@liffe.com
Subject: Re: [perl-python] 20050112 while statement
Message-Id: <vtvfa1h437.fsf@ssdevws28.admin.liffe.com>
"Xah Lee" <xah@xahlee.org> writes:
> # here's a while statement in python.
>
> a,b = 0,1
> while b < 20:
> print b
> a,b = b,a+b
>
> ---------------
> # here's the same code in perl
>
> ($a,$b)=(0,1);
> while ($b<20) {
> print $b, "\n";
> ($a,$b)= ($b, $a+$b);
> }
That python code produces a syntax error:
File "w.py", line 3
print b
^
IndentationError: expected an indented block
So, not the same then!
(As a matter of interest, is this sequence of posts intended to
demonstrate ignorance of both languages, or just one?)
--
Brian Raven
If you write something wrong enough, I'll be glad to make up a new
witticism just for you.
-- Larry Wall in <199702221943.LAA20388@wall.org>
------------------------------
Date: Thu, 13 Jan 2005 05:08:23 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <bnnFd.4676$SS6.3078@trnddc07>
toomanyjoes@mail.utexas.edu wrote:
> I've been posting on these groups for over
> 10 years back when it was DejaNews
"These groups" never were DejaNews.
DejaNews simply provided an archive for Usenet.
jue
------------------------------
Date: 13 Jan 2005 10:03:04 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <yzdvfa1n1kn.fsf@invalid.net>
Tad McClellan <tadmc@augustmail.com> writes:
> toomanyjoes@mail.utexas.edu <toomanyjoes@mail.utexas.edu> wrote:
> > One last post Sherm, then I'm done. No matter what obscenities you
> > respond with,
>
>
> Please show us exactly what obscenities Sherm posted that
> you are referring to.
>
> (it is customary to quote some context when composing a followup.)
>
>
> I for one, think you are making stuff up to support your
> untenable position.
Didn't you plonk him five minutes ago?
------------------------------
Date: 13 Jan 2005 10:47:10 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <yzdpt09mzj5.fsf@invalid.net>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> writes:
> toomanyjoes@mail.utexas.edu wrote in news:1105553915.762548.182620
> @c13g2000cwb.googlegroups.com:
>
> > Showing the passion of your emotions is very unattractive
>
> Lucky for us, this is not Fifth Wheel, we don't care about what you find
> attractive.
What's "Fifth wheel"? I didn't find google's hits helpful.
------------------------------
Date: 13 Jan 2005 01:35:54 -0800
From: alythh@netscape.net (Alythh)
Subject: array of arrays: searching for wisdom ...
Message-Id: <6a25ba72.0501130135.f6adfbd@posting.google.com>
hi people,
I've some troubles trying to access an array of arrays:
while using the format:
for $i ( 0 .. $#AoA ) {
$row = $AoA[$i];
for $j ( 0 .. $#{$row} ) {
print "element $i $j is $row->[$j]\n";
}
}
surely works, I was wandering if there is a way to scan @AoA for its
$i-th row, and returning it as @i_row, without rebuilding it (by
pushing one-by-one $row->[$j], as in previous example):
it is both an efficiency worry, and a styilistic one: that code is
awful!
Thanks for your help
Alessandro Magni
------------------------------
Date: Thu, 13 Jan 2005 12:00:01 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: array of arrays: searching for wisdom ...
Message-Id: <RwsFd.4220$IW4.87423@news2.e.nsc.no>
Alythh wrote:
> for $i ( 0 .. $#AoA ) {
> $row = $AoA[$i];
> for $j ( 0 .. $#{$row} ) {
> print "element $i $j is $row->[$j]\n";
> }
> }
>
> surely works, I was wandering if there is a way to scan @AoA for its
> $i-th row, and returning it as @i_row, without rebuilding it (by
> pushing one-by-one $row->[$j], as in previous example):
> it is both an efficiency worry, and a styilistic one: that code is
> awful!
Access it directly (and dereference at the same time);
my $i = 0;
my @i_row = @{$AoA[$i]};
--
Tore Aursand <tore@aursand.no>
"Every man usually has something he can do better than anyone else.
Usually it is reading his own handwriting." (Unknown)
------------------------------
Date: Thu, 13 Jan 2005 13:10:07 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: array of arrays: searching for wisdom ...
Message-Id: <cs5rlo$dda$1@sun3.bham.ac.uk>
Alythh wrote:
> hi people,
> I've some troubles trying to access an array of arrays:
> while using the format:
>
> for $i ( 0 .. $#AoA ) {
> $row = $AoA[$i];
> for $j ( 0 .. $#{$row} ) {
> print "element $i $j is $row->[$j]\n";
> }
> }
You should always declare all variables as lexically scoped in the
smallest applicable scope unless you have a reason to do otherwise.
> surely works, I was wandering if there is a way to scan @AoA for its
> $i-th row, and returning it as @i_row, without rebuilding it (by
> pushing one-by-one $row->[$j], as in previous example):
There is no push in the previous example.
The whole of the array referenced by the ARRAYref $row can be addressed
as @$row.
------------------------------
Date: Thu, 13 Jan 2005 09:55:49 +0100
From: "Vetle Roeim" <vetler@gmail.com>
Subject: Re: Best way to build up XHTML
Message-Id: <opski9rbfxx7nu7z@quickfix.opera.com>
On Wed, 12 Jan 2005 00:12:05 +0100, Bart van den Burg
<bart@NOSPAM.tvreclames.nl> wrote:
> Hi
>
> I showed my code to someone a while ago, and he said that it's rather
> unclean to have XHTML code within the Perl code. I must agree with this,
> because it doesn't really look al that nice, but I don't really know how
> to do it better.
Personally I prefer to build up XML in scripts (either by string
concatenation or using some XML module), and then transforming it with
XSLT to generate the final HTML or XHTML document. This has the added
benefit of making it easy for the people responsible for web design to
change it at will without bothering me. :) I guess this is also true if
you use some kind of templating.
[...]
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
------------------------------
Date: Thu, 13 Jan 2005 11:13:42 +0100
From: "Vetle Roeim" <vetler@gmail.com>
Subject: Re: Best way to build up XHTML
Message-Id: <opskjdc4gjx7nu7z@quickfix.opera.com>
On Thu, 13 Jan 2005 09:55:49 +0100, Vetle Roeim <vetler@gmail.com> wrote:
> On Wed, 12 Jan 2005 00:12:05 +0100, Bart van den Burg
> <bart@NOSPAM.tvreclames.nl> wrote:
>
>> Hi
>>
>> I showed my code to someone a while ago, and he said that it's rather
>> unclean to have XHTML code within the Perl code. I must agree with this,
>> because it doesn't really look al that nice, but I don't really know
>> how to do it better.
>
> Personally I prefer to build up XML in scripts (either by string
> concatenation or using some XML module), and then transforming it with
> XSLT to generate the final HTML or XHTML document. This has the added
> benefit of making it easy for the people responsible for web design to
> change it at will without bothering me. :) I guess this is also true if
> you use some kind of templating.
Just a small comment on this: One benefit of using XML is that
indepenendent modules (for an examples different components making up
different parts of web pages) can be created and their resulting XML
merged together.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
------------------------------
Date: 13 Jan 2005 03:14:28 -0800
From: xdarcos@hotmail.com
Subject: Re: CGI: Execute a perl script inside another perl script
Message-Id: <1105614868.393120.92820@z14g2000cwz.googlegroups.com>
Hello all,
I found your responses very strong and the idea of you might think that
I am "lazy/arrogant/selfish" make me feel uncomfortable because this is
not me. So the word "accidently" was well chosen because this was not
at all my purpose.
What I didn't mention is that I was a real perl beginner. My first
script was working well but all the environment variables were in it.
So I decided to move them to another one. You mentioned to have a look
to "perldoc -f do" OK but if you don't know the "do" command, it is not
so easy. I can also maybe explain that because I am not fluent in
English, my question could have been felt too direct. I would like to
apologize if it is what you felt.
To come back to my problem:
Brian, the short example you gave me works well also for me.
But when I try to use it with my web server (SunOne Web Server), it is
not working anymore:
------------x.pl---------------
do 'y.pl';
print "Content-type:text/html\n\n";
print "<html><head><title>HTTP Environment</title></head> <body>";
print "FOO=".$ENV{FOO};
print "</body></html>";
----------------------------------
Here is the output I get in my HTML browser:
FOO=
To be more complete in my investigation, I tried also with Apache and
here is what I get:
FOO=BAR
This works !!
So it seems this is a configuration problem of SunOne i.e nothing to do
with Perl.
Thanks for time and sorry for the inconvenience.
Have a good day.
Xavier
------------------------------
Date: Thu, 13 Jan 2005 13:39:31 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: CGI: Execute a perl script inside another perl script
Message-Id: <cs5tcs$e7n$1@sun3.bham.ac.uk>
xdarcos@hotmail.com wrote:
> Brian, the short example you gave me works well also for me.
> But when I try to use it with my web server (SunOne Web Server), it is
> not working anymore:
>
> ------------x.pl---------------
> do 'y.pl';
>
> print "Content-type:text/html\n\n";
> print "<html><head><title>HTTP Environment</title></head> <body>";
> print "FOO=".$ENV{FOO};
> print "</body></html>";
> ----------------------------------
>
> Here is the output I get in my HTML browser:
> FOO=
>
> To be more complete in my investigation, I tried also with Apache and
> here is what I get:
> FOO=BAR
> This works !!
> So it seems this is a configuration problem of SunOne i.e nothing to do
> with Perl.
As you say this is not related to Perl. The CGI standard does not define
the setting of the current working directory when a CGI process is
spawned. In the case of Apache it (almost?) always sets the CWD to the
directory containing the script. I'm guessing that SunOne does not do
this. You need to use a fully qualified filename in the do().
------------------------------
Date: 13 Jan 2005 07:47:46 GMT
From: Antoon Pardon <apardon@forel.vub.ac.be>
Subject: Re: complex numbers
Message-Id: <slrncuc9t2.5qu.apardon@rcpc42.vub.ac.be>
Op 2005-01-12, It's me schreef <itsme@yahoo.com>:
> Precisely. One have to convert complex number into vectors, and vector of
> complex numbers into vector of vectors, list of complex numbers into list of
> vectors, ...., you get the idea.
Wrong. My vector example was an illustration that you can build a user
class that behaves as you want. Python doesn't has a vecor class build
in. Yet I could write a vector class that behaved as you wished with
regard to your twice function.
What can be done for a vector class can be done again for a complex
class, no need to use the vector class for complex numbers.
> And my code no longer look like the equation I have on paper...
>
> Like I said, I've travelled down that path before with C++ and Modelica.
> It gets ugly.
Ugly, where? In the implementation of the class? That is possible.
In the use of the class, as you suggest by writing that
your code no longer looks like the equation you have on paper.
In that case I suggest the class was poorly done.
--
Antoon Pardon
------------------------------
Date: 13 Jan 2005 09:59:09 GMT
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Determining which module exported a specific function.
Message-Id: <slrncuchjc.ia.news@maki.homeunix.net>
Sisyphus wrote :
> Hi,
>
>
> How can I determine quickly and easily which module's documentation I
> need to consult ?
>
> Or, to rephrase, how can I quickly determine an imported function's
> fully qualified package name.
>
I don't know, if Perl supportes any help for this.
Otherwise you could use grep.
grep -r foo() /path/to/perlmodules
HTH
--
Epur Si Muove (Gallileo Gallilei)
------------------------------
Date: 13 Jan 2005 13:21:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Determining which module exported a specific function.
Message-Id: <cs5sl6$apc$1@mamenchi.zrz.TU-Berlin.DE>
Sisyphus <kalinaubears@iinet.net.au> wrote in comp.lang.perl.misc:
[...]
> Or, to rephrase, how can I quickly determine an imported function's
> fully qualified package name.
use Devel::Peek 'CvGV';
print CvGV( \ &imported_from_somewhere), "\n";
Anno
------------------------------
Date: Thu, 13 Jan 2005 13:28:03 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Determining which module exported a specific function.
Message-Id: <cs5snc$dut$1@sun3.bham.ac.uk>
Sisyphus wrote:
> how can I quickly determine an imported function's
> fully qualified package name.
B::svref_2object(\&an_imported_function)->GV->STASH->NAME
------------------------------
Date: 13 Jan 2005 13:56:26 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: disk space script
Message-Id: <cs5uma$apc$2@mamenchi.zrz.TU-Berlin.DE>
jc8glp1hu <jgarretthood@gmail.com> wrote in comp.lang.perl.misc:
[unattributed original posting snipped]
> So with perl you can just use system() or exec() to output to the
> command line.
>
> the only issue may be reading it back in .. in that case do a system()
> > diskinfo.txt and read it back in w/ your application then remove it
> when you are done w/ it.
>
> That's what I do w/ perl on a Unix environment, so maybe itll work for
> you on windows.
If that's how you're doing it, you're doing it wrong. Look up "qx" in
perlop.
Anno
------------------------------
Date: Thu, 13 Jan 2005 00:13:54 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: FAQ 4.30: How do I capitalize all the words on one line?
Message-Id: <gsnFd.30595$b64.869916@news20.bellglobal.com>
"l v" <lv@aol.com> wrote in message news:41e5ff2e$1_2@127.0.0.1...
> Matt Garrish wrote:
>
> Does ucfirst() not work for àáâãçèé? I currently do not have access to a
> box with multiple languages installed to test myself or I would.
>
You should be able to test by inserting any appropriate ansi character into
a string:
use locale;
$t = 'àack!';
print "$t\n";
print ucfirst $t;
__Output__
àack!
Àack!
Compared to:
$t = 'àack!';
print "$t\n";
print ucfirst $t;
__Output__
àack!
àack!
Matt
------------------------------
Date: 13 Jan 2005 10:20:57 GMT
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Loop through a text file line by line
Message-Id: <slrncucis8.ia.news@maki.homeunix.net>
toomanyjoes@mail.utexas.edu wrote :
>
> I'm trying to loop through a .txt file and grab a number at the
> beginning of the line. I want to save this number in a variable and
> ...
Have you read my posting in your other thread?
Take a look at the "sub printline", which does exactly what you are
asking for.
>
> The lines are distinct from one other, each one ends with a newline
> character. How do I loop through a text file line by line?
>
This is done within the while loop in the other posting.
If you replace <DATA> with <> you can read from STDIN.
You could also open a File with th open functioni (perldoc -f open).
HTH
--
Epur Si Muove (Gallileo Gallilei)
------------------------------
Date: Thu, 13 Jan 2005 13:29:59 GMT
From: Gazza <gazza@192.168.1.1>
Subject: Perl CGI does not generate file.
Message-Id: <rJuFd.169$VE5.153@newsfe2-win.ntli.net>
Hi,
I have written an HTML script, which, when run, presents the user with a
form in which to type in a file name and some text. The associated CGI
script is supposed to then create the file with the text in it. It's
simple but, unfortunately, the file doesn't get created. Yet, running the
CGI script on a BASH command line like this:
echo"nameoffiletocreate=[/path/to/file_name_here]&filetext=[some_text_here]"
| perl [path/to/]perl_cgi_file_creator.cgi
(all one line, of course) works.
The HTML script is here:
http://homepage.ntlworld.com/gary.hayward/My_HTML_Scripts/perl_cgi_file_creator.html
(cut and paste from source view) and the Perl CGI script is here:
http://homepage.ntlworld.com/gary.hayward/My_Perl_Scripts/perl_cgi_file_creator.txt
('.txt' because my web host doesn't provide CGI facilities (so the script
won't work there) and won't even allow access to anything with '.cgi' in
it's name apparently; the file name needs to end in '.cgi').
What have I done wrong?
Yours,
Gary Hayward.
------------------------------
Date: Thu, 13 Jan 2005 13:50:05 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Perl CGI does not generate file.
Message-Id: <h0vFd.2$Vx2.0@trndny01>
"Gazza" <gazza@192.168.1.1> wrote in message
news:rJuFd.169$VE5.153@newsfe2-win.ntli.net...
> I have written an HTML script
This is a contradiction in terms
> , which, when run, presents the user with a
> form in which to type in a file name and some text. The associated CGI
> script is supposed to then create the file with the text in it. It's
> simple but, unfortunately, the file doesn't get created. Yet, running
the
> CGI script on a BASH command line like this:
>
>
echo"nameoffiletocreate=[/path/to/file_name_here]&filetext=[some_text_he
re]"
> | perl [path/to/]perl_cgi_file_creator.cgi
>
> (all one line, of course) works.
>
> The HTML script is here:
>
http://homepage.ntlworld.com/gary.hayward/My_HTML_Scripts/perl_cgi_file_creator.html
>
> (cut and paste from source view) and the Perl CGI script is here:
>
>
http://homepage.ntlworld.com/gary.hayward/My_Perl_Scripts/perl_cgi_file_creator.txt
>
Why didn't you just copy and paste the code yourself? That would have
been far more polite. Regardless:
> $input3=<STDIN>;
> $input3=~s/\+/ /g;
> @input4 = split(/&/, $input3);
> foreach $time(0,1) {
> $input4[$time]=~s/%([\dA-Fa-f]{2})/pack("C", hex($1))/eg;
> $input4[$time]=~s/</</g;
> }
> $input4[0]=~s/nameoffiletocreate=//;
> $input4[1]=~s/filetext=//;
>
> print <<endofhtml;
<HTML snipped>
You are attempting to parse CGI parameters yourself. This is a bad
idea. You should be using a module that does this task for you. That
module is CGI.pm. Please read up on it at
perldoc CGI
Using that module, the entirety of the above code would be reduced to:
@input4 = (param('nameoffiletocreate'), param('filetext'));
> endofhtml
>
> open WF,">$input4[0]";
> print WF "$input4[1]";
> close WF;
> What have I done wrong?
You have not checked the return value of open. You have no idea if this
open succeeded. Perl will tell you that, and will also tell you *why*
it failed - but you have to tell it to tell you:
open WF "> $input4[0]" or die "Could not open $input4[0] for writing:
$!";
Now if that open fails, your script will terminate, and the error
message will be printed to your error log. If you do not have access to
the error log, add this line to the top of your script:
use CGI::Carp qw/fatalsToBrowser/;
That will cause the error to be displayed in your browser.
Once you have done this, you will likely be told exactly why your
program fails. As an offhand guess, I'd bet the CGI user doesn't have
permissions to create a new file.
Paul Lalli
------------------------------
Date: Thu, 13 Jan 2005 08:35:59 GMT
From: George Kinley <GeorgeKinleyxxx@hotmail.com>
Subject: Perl Distribution
Message-Id: <Xns95DD6B663BBE2GeorgeKinleyxxxhotma@131.228.6.99>
My question is not related to perl programing but about its distribution so
pardon me
Modules downlodable from CPAN site are not part of standard distribution
package (like Date::Calc),
how do they decide which module to be added as standard distribution , and
what are the criteria
-GK
------------------------------
Date: Thu, 13 Jan 2005 08:47:53 GMT
From: George Kinley <GeorgeKinleyxxx@hotmail.com>
Subject: Re: Perl Distribution
Message-Id: <Xns95DD6D6AE424EGeorgeKinleyxxxhotma@131.228.6.99>
George Kinley <GeorgeKinleyxxx@hotmail.com> wrote in
news:Xns95DD6B663BBE2GeorgeKinleyxxxhotma@131.228.6.99:
> Path:
> news2.nokia.com!news1.nokia.com!news2.nokia.com.POSTED!not-for-mail
> Newsgroups: comp.lang.perl.misc
> Subject: Perl Distribution
> From: George Kinley <GeorgeKinleyxxx@hotmail.com>
> Message-ID: <Xns95DD6B663BBE2GeorgeKinleyxxxhotma@131.228.6.99>
> User-Agent: Xnews/5.04.25
> Lines: 7
> Date: Thu, 13 Jan 2005 08:35:59 GMT
> NNTP-Posting-Host: 172.21.11.70
> X-Complaints-To: newsmaster@nokia.com
> X-Trace: news2.nokia.com 1105605359 172.21.11.70 (Thu, 13 Jan 2005
> 10:35:59 EET) NNTP-Posting-Date: Thu, 13 Jan 2005 10:35:59 EET
> Organization: Nokia
> Xref: news1.nokia.com comp.lang.perl.misc:300082
>
> My question is not related to perl programing but about its
> distribution so pardon me
> Modules downlodable from CPAN site are not part of standard
> distribution package (like Date::Calc),
> how do they decide which module to be added as standard distribution ,
> and what are the criteria
> -GK
>
found some answers
:-)
http://www.perl.com/CPAN/misc/cpan-faq.html
------------------------------
Date: Thu, 13 Jan 2005 12:07:56 +0100
From: "John Aderseen" <john@aderseen.com>
Subject: Perl on easyPhp
Message-Id: <41e6568c$0$23340$7a628cd7@news.club-internet.fr>
Hi,
Can anyone tell me if there is a simple way to install mod_perl.so on
easyPhp 1.7
Thank you,
Regards,
John Aderseen
------------------------------
Date: 13 Jan 2005 02:21:32 -0800
From: "igor.lobanov@gmail.com" <igor.lobanov@gmail.com>
Subject: please # japh
Message-Id: <1105611692.791638.147180@f14g2000cwb.googlegroups.com>
#!/usr/bin/perl
eval qq;
sub qq{qr/[^a-z]+/i}
# line 134\150\141\143\153\145\162\012\144\151\145\073;,
$,=' ',print((split(&qq,qq,$@
# just another comment
# line 116\040\160\145\162\154\075\067\075\067\075\062;,
))[4,5,8,2])
------------------------------
Date: 13 Jan 2005 05:15:26 -0800
From: "lio" <igor.lobanov@gmail.com>
Subject: Re: please # japh
Message-Id: <1105622126.020330.158180@f14g2000cwb.googlegroups.com>
The same but simpyfied
#!/usr/bin/perl
eval qq{
#line $$ "just another perl hacker"
die;};$@=~/j.+r/;print$&;
Regards, lio
http://www.template-toolkit.ru/
------------------------------
Date: Thu, 13 Jan 2005 05:10:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Print question
Message-Id: <lpnFd.4677$SS6.2551@trnddc07>
Sherm Pendley wrote:
> edgrsprj wrote:
>
>> What is being worked on here is a Perl program which can be used to
>> compare electromagnetic energy field pulse data with earthquake data
>
> ... yadda yadda. Yeah, we know. You've said it before - many times.
OHMYGOSH, is he back AAGGAAIIN?
I guess killfiles do work.
jue
------------------------------
Date: Wed, 12 Jan 2005 23:59:28 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Random Functionality
Message-Id: <UrqdnfGlof3ZgXvcRVn-rA@comcast.com>
I want to create a script that has random functionality.
I want the script to randomly choose between an unknown number of
subroutines and run one of them. By "unknown" I mean that the neither
names of the subroutines, the references to the subroutines, nor the
number of subroutines are hard coded into the script, but are determined
at runtime. This will allow me to add additional functions to the list
of possible random functions without having to update any other portion
of the script.
If that is as clear as mud, the code sample below demonstrates what I
want to do.
I came up with this. Is there a better way to do it?
use strict;
use warnings;
my @sub_list;
print &{$sub_list[int(rand(@sub_list))]};
BEGIN
{
push @sub_list, sub
{
return "Sub One was chosen\n";
};
push @sub_list, sub
{
return "Sub Two was chosen\n";
};
push @sub_list, sub
{
return "Sub Three was chosen\n";
};
}
------------------------------
Date: 13 Jan 2005 12:53:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Random Functionality
Message-Id: <cs5r0n$8qf$1@mamenchi.zrz.TU-Berlin.DE>
Scott Bryce <sbryce@scottbryce.com> wrote in comp.lang.perl.misc:
> I want to create a script that has random functionality.
>
> I want the script to randomly choose between an unknown number of
> subroutines and run one of them. By "unknown" I mean that the neither
> names of the subroutines, the references to the subroutines, nor the
> number of subroutines are hard coded into the script, but are determined
> at runtime. This will allow me to add additional functions to the list
> of possible random functions without having to update any other portion
> of the script.
>
> If that is as clear as mud, the code sample below demonstrates what I
> want to do.
>
> I came up with this. Is there a better way to do it?
>
>
>
> use strict;
> use warnings;
>
> my @sub_list;
>
> print &{$sub_list[int(rand(@sub_list))]};
>
> BEGIN
> {
> push @sub_list, sub
> {
> return "Sub One was chosen\n";
> };
>
>
> push @sub_list, sub
> {
> return "Sub Two was chosen\n";
> };
>
>
> push @sub_list, sub
> {
> return "Sub Three was chosen\n";
> };
> }
That code fulfills almost none of your requirements. The number of
subroutines is hard-coded (it is 3), as are their references. You only
avoid hard-coding their names by not giving them any.
Further, if you were to change the code above, a program running
the previous version would blithely ignore your changes. You're
not even close.
If you want the code to change at run-time (not a good idea in general),
you'll have to compile it at run-time. See "perldoc -f do" and "perldoc
-f eval" for alternative ways to do that.
Anno
------------------------------
Date: Thu, 13 Jan 2005 00:04:33 -0500
From: "B. Ghas" <Support@GoMonitor.com>
Subject: Re: Session ID / login security script
Message-Id: <10uc0igarfa1abd@corp.supernews.com>
Sorry for vagueness,
I am writing the code on IIS, Thanks for the Clue, and followup with
CGI::Session
Thanks
------------------------------
Date: Thu, 13 Jan 2005 11:31:42 GMT
From: "Lord0" <lawrence.tierney@bipcontracts.com>
Subject: Strange DBI error
Message-Id: <y_sFd.43$um5.16@newsfe2-gui.ntli.net>
Any reason why DBI (DBD::mySQL) would/might throw this error?
"Unknown URI::URL Schema"
We were running a CRON job, which does not use URI::URL, which failed with
this error during the night and have been unable to get the error to repeat.
Cheers
Lord0
------------------------------
Date: Thu, 13 Jan 2005 12:49:46 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Strange DBI error
Message-Id: <pan.2005.01.13.11.49.46.388394@dunkelheit.at>
Lord0 wrote:
> We were running a CRON job, which does not use URI::URL, which failed with
> this error during the night and have been unable to get the error to
> repeat.
Maybe it meant the connectstring for MySQL?
hth,
p
--
http://www.dunkelheit.at/
Das Tor zur Dunkelheit schwingt nur in eine Richtung...
------------------------------
Date: Thu, 13 Jan 2005 22:58:18 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Strange DBI error
Message-Id: <34n9jaF4d5dg1U2@individual.net>
Lord0 wrote:
> Any reason why DBI (DBD::mySQL) would/might throw this error?
>
> "Unknown URI::URL Schema"
>
> We were running a CRON job, which does not use URI::URL, which failed with
> this error during the night and have been unable to get the error to
> repeat.
>
> Cheers
>
> Lord0
Probably invalid user/db/password. It causes strange problems.
gtoomey
------------------------------
Date: Thu, 13 Jan 2005 12:59:07 GMT
From: "Lord0" <lawrence.tierney@bipcontracts.com>
Subject: Re: Strange DBI error
Message-Id: <vguFd.266$fv6.61@newsfe6-gui.ntli.net>
>> We were running a CRON job, which does not use URI::URL, which failed
>> with
>> this error during the night and have been unable to get the error to
>> repeat.
>
> Maybe it meant the connectstring for MySQL?
>
Nah - it couldn't have been cos the connection params have hardcoded into it
for ages..........
------------------------------
Date: Thu, 13 Jan 2005 13:22:18 GMT
From: "Lord0" <lawrence.tierney@bipcontracts.com>
Subject: Re: Strange DBI error
Message-Id: <eCuFd.95$9P5.13@newsfe3-gui.ntli.net>
>> Any reason why DBI (DBD::mySQL) would/might throw this error?
>>
>> "Unknown URI::URL Schema"
>>
>> We were running a CRON job, which does not use URI::URL, which failed
>> with
>> this error during the night and have been unable to get the error to
>> repeat.
>>
>> Cheers
>>
>> Lord0
>
> Probably invalid user/db/password. It causes strange problems.
I don't think so as the connection parameters are hard coded and have not
been changed in ages. Maybe it's indicative of a problem with the DB server?
------------------------------
Date: Thu, 13 Jan 2005 14:31:25 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Strange DBI error
Message-Id: <pan.2005.01.13.13.31.25.146367@dunkelheit.at>
Lord0 wrote:
> I don't think so as the connection parameters are hard coded and have not
> been changed in ages.
You should have got a filename and linenumber with that error. Check the
area around (the "calling-chain"[1]) that point, maybe you find out more.
As long as we don't know your code, it's really hard to give hints.
p
[1] Sry, Unable to find technical term for 'calling-chain'
in post at line 7.
--
http://www.dunkelheit.at/
I want, therefore I can.
------------------------------
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 7640
***************************************