[25449] in Perl-Users-Digest
Perl-Users Digest, Issue: 7694 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 26 09:05:40 2005
Date: Wed, 26 Jan 2005 06:05:23 -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 Wed, 26 Jan 2005 Volume: 10 Number: 7694
Today's topics:
[OT] Re: HAVE YOU HEARD THE GOOD NEWS! <1usa@llenroc.ude.invalid>
Re: ASP Perlscript/VBScript Order of execution <janschiffman@hotmail.com>
Re: Avoid long timeout on DNS lookup of nonexistent hos <invalid@earthlink.net.invalid>
Re: Avoid long timeout on DNS lookup of nonexistent hos <1usa@llenroc.ude.invalid>
Re: File::Find gives me current dir (.)? <bernie@fantasyfarm.com>
Re: File::Find gives me current dir (.)? <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: Grep Text File for Lines Containing 1 or 2 Words <tadmc@augustmail.com>
Re: HAVE YOU HEARD THE GOOD NEWS! <hendrik_maryns@despammed.com>
Re: how to write a tutorial <xah@xahlee.org>
Re: how to write a tutorial <kst-u@mib.org>
Re: how to write a tutorial <cwilbur@mithril.chromatico.net>
Re: mysql: doable? <toreau@gmail.com>
Re: Old tutorial - now corrected <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: Old tutorial - now corrected binnyva@hotmail.com
Re: Old tutorial - now corrected <toreau@gmail.com>
Re: Old tutorial - now corrected <1usa@llenroc.ude.invalid>
pattern matching <joericochuyt@msn.com>
Re: pattern matching <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: pattern matching <nobull@mail.com>
Re: pattern matching <noreply@gunnar.cc>
Re: pattern matching <nobull@mail.com>
Re: pattern matching <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: pattern matching <joericochuyt@msn.com>
Problem installing modules on redhat 9 - strange connec (championsleeper)
Problem with encoding with Spreadsheet::Writer <sam.wun@authtec.com>
Re: qiuckie for creating a file with date in name <nobull@mail.com>
Redirect problems... <mattias@torsfred.com>
Re: Redirect problems... <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: Redirect problems... chris-usenet@roaima.co.uk
Re: Redirect problems... <mattias@torsfred.com>
Re: regular expressions <scobloke2@infotop.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Jan 2005 11:58:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: [OT] Re: HAVE YOU HEARD THE GOOD NEWS!
Message-Id: <Xns95EA46F3955CCasu1cornelledu@127.0.0.1>
Hendrik Maryns <hendrik_maryns@despammed.com> wrote in
news:N5GdnT33IZNg8mrcRVnyuw@scarlet.biz:
> Is there something we can do against this? Where to report this abuse?
> spamcop.net doesn't accept newsgroup spam...
From the headers of the message:
Complaints-To: groups-abuse@google.com
Injection-Info: c13g2000cwb.googlegroups.com; posting-host=172.167.184.51;
posting-account=5pomSA0AAACmu2kA0jXJtGc2VbAXRf6M
Xref: wnmaster12 comp.lang.perl.misc:539329
X-Received-Date: Wed, 26 Jan 2005 03:20:31 GMT (bgtnsc04-
news.ops.worldnet.att.net)
C:\Dload> nslookup 172.167.184.51
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Server: UnKnown
Address: 192.168.0.1
Name: ACA7B833.ipt.aol.com
Address: 172.167.184.51
So, Google, AOL and AT&T are candidates for abuse complaints.
Sinan.
------------------------------
Date: 26 Jan 2005 00:01:46 -0800
From: "LinnAxis" <janschiffman@hotmail.com>
Subject: Re: ASP Perlscript/VBScript Order of execution
Message-Id: <1106726506.139013.167720@f14g2000cwb.googlegroups.com>
1) Firstly, thanks for all the friends responses. Remind me to find
another resource next time I have a question.
2) All of the code is server side. It was actually a simple question.
------------------------------
Date: Wed, 26 Jan 2005 09:26:20 GMT
From: Someone Else <invalid@earthlink.net.invalid>
Subject: Re: Avoid long timeout on DNS lookup of nonexistent host?
Message-Id: <0nJJd.7347$cZ1.5650@newsread2.news.atl.earthlink.net>
Replying to my own post to thank everyone, and summarize the
outcome. (Brief toppost noted.)
Someone Else wrote:
[...]
> The issue has to do with how to avoid the long (~18 sec) time-out on a
> DNS lookup of a nonexistent host (at least it's long with Active Perl
> running under Windows).
[using gethostbyname()]
[...]
All three answers fit together very nicely:
1) Net::DNS turned out to solve the immediate problem. I can now
run ~3-4 lookups/sec, instead of waiting 18 sec each for all
those negative replies.
2) Multi-threading will surely make it go like lightning.
3) ppm was a dream come true. All I had to do was: (a) figure
out that the module name was 'net-dns', not 'net::dns', (b)
remember to be connected to the internet (:-), and (c) type 'ppm
install net-dns'. Down it came, and in it went. No fuss, no muss.
There were two minor glitches with using it:
4) At least on my system (Windows ME, and who-knows-what
site-specific peculiarities), Net::DNS::Resolver->new(...) gets
confused about the WinME registry (that possibility is noted in
the documentation). To get it to work, I had to explicitly
initialize the list of nameservers, e.g.:
$res = Net::DNS::Resolver->new(
nameservers => [qw(207.69.188.187 207.69.188.186)],
);
I still get an intimidating warning:
> Use of uninitialized value in concatenation (.) or string at C:/Perl/site/lib/Ne
> t/DNS/Resolver/Win32.pm line 43.
I'll have to track that down later. Of course I could just omit
the '-w' switch, but I agree that it is a bug in Perl that '-w'
is not mandatory, and my fingers type it by reflex.
5) For some reason (which I have yet to investigate):
$query = $res->search($domainName);
often returns false, but with $res->errorstring set to NOERROR.
As I said, I have to look into the cause, but two temporary
solutions seem to be: (a) set recursion on; or (b) try about 20
times before giving up. E.g., for option (a):
my $res = Net::DNS::Resolver->new(
nameservers => [qw(207.69.188.187 207.69.188.186)],
recurse => 1,
);
Anyway, thanks again for all the help. With luck this thread may
be useful to someone in the future (someone who can divine the
correct Google search).
-- David
To make invalid valid, reverse the letters
------------------------------
Date: Wed, 26 Jan 2005 11:54:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Avoid long timeout on DNS lookup of nonexistent host?
Message-Id: <Xns95EA464303674asu1cornelledu@127.0.0.1>
Someone Else <invalid@earthlink.net.invalid> wrote in
news:0nJJd.7347$cZ1.5650@newsread2.news.atl.earthlink.net:
> 3) ppm was a dream come true. All I had to do was: (a) figure
> out that the module name was 'net-dns', not 'net::dns', (b)
> remember to be connected to the internet (:-), and (c) type 'ppm
> install net-dns'. Down it came, and in it went. No fuss, no muss.
By the way, if you just type ppm on the command line, you can issue
searches against the repositories you have available. So, for example,
you might have done:
ppm> s dns
Searching in Active Repositories
...
20. Net-DNS [0.48] Perl DNS resolver module
...
ppm> i 20
Package 20:
====================
Install 'Net-DNS' version 0.48 in ActivePerl 5.8.6.811.
====================
Downloaded 88558 bytes.
...
> I'll have to track that down later. Of course I could just omit
> the '-w' switch, but I agree that it is a bug in Perl that '-w'
> is not mandatory, and my fingers type it by reflex.
use warnings;
is preferable to the -w switch because it allows you to turn selected
warnings on/off as appropriate.
Sinan.
------------------------------
Date: Wed, 26 Jan 2005 08:25:26 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: File::Find gives me current dir (.)?
Message-Id: <bh6fv0t8fd56mlqcdu14sgisjb893pu3d5@library.airnews.net>
Tad McClellan <tadmc@augustmail.com> wrote:
} And
}
} use warnings;
}
} is better than -w.
I thought they were the same... what's the difference??
/b\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Wed, 26 Jan 2005 14:36:03 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: File::Find gives me current dir (.)?
Message-Id: <Xns95EA94877CAD1elhber1lidotechnet@62.89.127.66>
Bernie Cosell <bernie@fantasyfarm.com> wrote:
> Tad McClellan <tadmc@augustmail.com> wrote:
>
> } And
> }
> } use warnings;
> }
> } is better than -w.
>
> I thought they were the same... what's the difference??
From perlrun.pod
"A new, fine-grained warning facility is also available if
you want to manipulate entire classes of warnings; see the
warnings manpage or the perllexwarn manpage."
--
Cheers,
Bernard
------------------------------
Date: Tue, 25 Jan 2005 23:06:36 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Grep Text File for Lines Containing 1 or 2 Words
Message-Id: <slrncve9as.63h.tadmc@magna.augustmail.com>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> see
>
> perldoc a2p
Make that:
man a2p
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Jan 2005 11:25:02 +0100
From: Hendrik Maryns <hendrik_maryns@despammed.com>
Subject: Re: HAVE YOU HEARD THE GOOD NEWS!
Message-Id: <N5GdnT33IZNg8mrcRVnyuw@scarlet.biz>
Is there something we can do against this? Where to report this abuse?
spamcop.net doesn't accept newsgroup spam...
H.
------------------------------
Date: 25 Jan 2005 23:12:25 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: Re: how to write a tutorial
Message-Id: <1106723545.429728.308620@f14g2000cwb.googlegroups.com>
in my previous two messages, i've criticized the inanity of vast
majority of language documentations and tutorials in the industry. I've
used the Python tutorial's chapter on class as an example. I've
indicated that proper tutorial should be simple, covering just common
cases, be self-contained, and be example based. Documenting or covering
the language's functionalities manifest as it is. An exemplary case of
this style i've indicated is Stephen Wolfram Mathematica documentation.
Following is a tutorial on Python's classes. It is part of a
a-Python-a-day mailing list. As an example, it shows what i mean by
covering the language's functionalities as is, without needing to chalk
up to rocket sciences. If expanded slightly and edited, it can supplant
sections 9.0 to 9.4 of the Python tutorial. Languages Tutorials should
follow this style.
---------------
From: xah@xahlee.org
Subject: [perl-python] 20050124 classes and objects
Date: January 24, 2005 6:44:14 AM PST
To: perl-python@yahoogroups.com
# -*- coding: utf-8 -*-
# Python
# in Python, one can define a boxed set
# of data and functions, which are
# traditionally known as "class".
# in the following, we define a set of data
# and functions as a class, and name it xxx
=A9class xxx:
=A9 "a class extempore! (^_^)"
=A9 i=3D1 # i'm a piece of data
=A9 def okaydokey(self): return "okaydokey"
=A9 def square(self,a): return a**a
# in the following,
# we create an object, of the class xxx.
# also known as "instantiate a class".
x =3D xxx()
# data or functions defined in a class
# are called the class's attributes or
# methods.
# to use them, append a dot and
# their name after the object's name.
print 'value of attribute i is:', x.i
print "3 squared is:", x.square(3)
print "okaydokey called:", x.okaydokey()
# in the definition of function inside a
# class, the first parameter "self" is
# necessary. (you'll know why when you need to)
# the first line in the class definition
# is the class's documentation. It can
# be accessed thru the __doc__
# attribute.
print "xxx's doc string is:", x.__doc__
# one can change data inside the class
x=2Ei =3D 400
# one can also add new data to the class
x=2Ej=3D4
print x.j
# or even override a method
x=2Esquare =3D 333
# (the following line will no longer work)
# print "3 squared is:", x.square(3)
# in Python, one must be careful not to
# overwrite data or methods defined in a
# class.
#-----------------------
# for a obfuscated treatment with a few
# extra info, see
# http://python.org/doc/2.3.4/tut/node11.html
# in Python terminal, type help() then
# topic CLASSES to read about existing
# datatypes as classes, and classes in
# Python
# try to write a class with one data of
# integer and two functions, one
# increases it by 1, one decreases it by
# 1. note: inside a class definition,
# to refer to data inside itself use
# self. e.g. self.i
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: Wed, 26 Jan 2005 09:35:48 GMT
From: Keith Thompson <kst-u@mib.org>
Subject: Re: how to write a tutorial
Message-Id: <lnis5kttvw.fsf@nuthaus.mib.org>
"Xah Lee" <xah@xahlee.org> writes:
[snip]
> Following is a tutorial on Python's classes.
[snip]
Please stop posting this to comp.lang.c. I'm sure the folks in most
of the other newsgroup aren't interested either -- or if they are,
they can find it in comp.lang.python.
Followups redirected.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
------------------------------
Date: Wed, 26 Jan 2005 09:39:26 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: how to write a tutorial
Message-Id: <87ekg8zgcz.fsf@mithril.chromatico.net>
>>>>> "XL" == Xah Lee <xah@xahlee.org> writes:
XL> I've used the Python tutorial's chapter on class as
XL> an example. I've indicated that proper tutorial should be
XL> simple, covering just common cases, be self-contained, and be
XL> example based.
"Correct" is not in your list of criteria. Big surprise, that.
Followups set appropriately.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: Wed, 26 Jan 2005 11:36:37 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: mysql: doable?
Message-Id: <UoKJd.6057$Sl3.142213@news4.e.nsc.no>
asdfkajsdflkjsadlfkjoewqifoeiwjf@yahoo.com wrote:
> I have a database containing text entries, userid and a unique
> increasing number.
>
> I have the unique number and userid to one of these rows.
>
> Is there any mysql commands that would let me select the previous and
> next (based on the unique number) row for this same userid?..
You should really ask in a place specific to SQL or MySQL. Perl has
nothing to do with databases.
> Example, the database looks like:
>
> row1|text1|userid1|1
> row2|text2|userid2|2
> row3|text3|userid3|6
> row4|text4|userid1|10
> row5|text5|userid2|12
> row6|text6|userid2|16
> row7|text7|userid1|20
> row8|text8|userid1|25
> row9|text9|userid1|28
>
> Based on knowing the unique number being 20 and userid being "userid1",
> I want the query to retrieve only row4, row7 and row8...
Didn't you want the _previous_ and _next_ record? That's row4 and row8.
I assume you meant that you _also_ want the "current" record, too. Try
something like this, if that's the case;
SELECT * FROM table WHERE user_id = ? AND unique_id < 20;
SELECT * FROM table WHERE user_id = ? AND unique_id = 20;
SELECT * FROM table WHERE user_id = ? AND unique_id > 20;
As you can see, you most probably are better off having a list of the
entries for each user, and base the query on that instead. That will
leave you with fewer queries to the database.
--
Tore Aursand <tore@aursand.no>
"To cease smoking is the easiset thing I ever did. I ought to know,
I've done it a thousand times." (Mark Twain)
------------------------------
Date: Wed, 26 Jan 2005 09:01:35 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Old tutorial - now corrected
Message-Id: <Xns95EA5BD28E103elhber1lidotechnet@62.89.127.66>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
> What if the year is 2014? Then, $date above will be set to
> "26-1-20014". Do you think that is correct? If so, you are even
> more dimwitted than I give you credit for.
The line between being critical and being needlessly abusive is not
fine by any means. You have managed to cross it anyway. You do so on a
regular basis. It was uncalled for in this case and is uncalled for
almost every time you stoop to it.
--
Cheers,
Bernard
------------------------------
Date: 26 Jan 2005 02:12:32 -0800
From: binnyva@hotmail.com
Subject: Re: Old tutorial - now corrected
Message-Id: <1106734352.682873.318020@f14g2000cwb.googlegroups.com>
Most of the programs there are very old relics - about
two to three years old - I am too lazy to update them.
I should do that - I know. Maybe sometime this year...
Anyway the subject is the tutorial - not my old scripts.
Thank You,
Binny V A
http://www.geocities.com/binnyva/code
------------------------------
Date: Wed, 26 Jan 2005 11:30:41 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: Old tutorial - now corrected
Message-Id: <kjKJd.6079$IW4.126878@news2.e.nsc.no>
binnyva@hotmail.com wrote:
> Most of the programs there are very old relics - about
> two to three years old - I am too lazy to update them.
> I should do that - I know. Maybe sometime this year...
>
> Anyway the subject is the tutorial - not my old scripts.
Aren't the scripts _a part of_ the tutorial?
--
Tore Aursand <tore@aursand.no>
"To cease smoking is the easiset thing I ever did. I ought to know,
I've done it a thousand times." (Mark Twain)
------------------------------
Date: Wed, 26 Jan 2005 12:16:58 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Old tutorial - now corrected
Message-Id: <Xns95EA4A1F82687asu1cornelledu@127.0.0.1>
"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in
news:Xns95EA5BD28E103elhber1lidotechnet@62.89.127.66:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>
>> What if the year is 2014? Then, $date above will be set to
>> "26-1-20014". Do you think that is correct? If so, you are even
>> more dimwitted than I give you credit for.
>
> The line between being critical and being needlessly abusive is not
> fine by any means. You have managed to cross it anyway.
I agree that the last sentence of that paragraph was completely
unnecessary and indeed my point would have been better made had I had
the sense not to post that. I apologize.
On the other hand, please take a look at:
<http://groups-
beta.google.com/group/comp.lang.perl.misc/msg/ec9bf41c19ec1b40>
(<http://tinyurl.com/4gyfy>)
and compare it to my comments this time.
The OP claimed that he had read the comments and made changes to take
those comments into account. Upon reading his code again, I did not
think he had actually done that at all.
Elsethread, the OP has claimed that the code I commented on was not part
of the tutorial. I am not able to figure out what is and what is not a
part of the tutorial. I simply followed the link he posted. There was
some stuff about men and cowards and LOC etc and some links listed on
the left. So, I followed one of those links, specifically, the one that
said 'Perl'.
Going back, I now see a link titled "Next" on the page. I did not see
that originally.
To bring up the usefullness quotient of this thread a little, I am going
to recommend "Picking up Perl" to anyone who is looking for an
introductory Perl tutorial:
http://www.ebb.org/PickingUpPerl/
Actually visiting:
http://learn.perl.org/
and seeing what is available to new users would also not be a bad idea.
Sinan.
------------------------------
Date: Wed, 26 Jan 2005 07:10:27 -0500
From: "yusufdestina" <joericochuyt@msn.com>
Subject: pattern matching
Message-Id: <454a6f50ab99b7d642ae3e7bcb6fa820@localhost.talkaboutprogramming.com>
hi all,
I'm stuck on this one...
How do I retrieve the content of the next string inside the ' signs??
example:
$text = "This is \'very important\'";
Do I have to use split for this?
tnx
------------------------------
Date: Wed, 26 Jan 2005 13:35:55 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: pattern matching
Message-Id: <Xns95EA8A55AB497elhber1lidotechnet@62.89.127.66>
"yusufdestina" <joericochuyt@msn.com> wrote:
> hi all,
> I'm stuck on this one...
> How do I retrieve the content of the next string inside the ' signs??
> example:
> $text = "This is \'very important\'";
^ ^
There's no need to escape single quotes within a double-quoted string.
And vice versa.
> Do I have to use split for this?
No, split() is not the best tool for this.
my ( $single_quoted ) = $text =~ m/'([^']+)'/;
This assumes you have only one single-quoted string in $text.
--
Cheers,
Bernard
------------------------------
Date: Wed, 26 Jan 2005 12:40:38 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: pattern matching
Message-Id: <ct82r2$fdv$1@sun3.bham.ac.uk>
yusufdestina wrote:
> I'm stuck on this one...
That's probably because you are jumping ahead to 'how' before thinking
about 'what'.
> How do I retrieve the content of the next string inside the ' signs??
> example:
> $text = "This is \'very important\'";
> Do I have to use split for this?
No, but you do have to first undersand your problem more precisely
before you can attempt to solve it.
For example extract the portion of $text between the first and last '
signs you could do:
my ($extract) = $text =~ /'(.*)'/;
Note: defined($extract) will, quite resonably, be false if $text
contains less than two ' signs.
------------------------------
Date: Wed, 26 Jan 2005 13:44:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: pattern matching
Message-Id: <35pi1aF4p7vo9U1@individual.net>
yusufdestina wrote:
> hi all,
> I'm stuck on this one...
To get stuck, you need to try first. What did you try?
> How do I retrieve the content of the next string inside the ' signs??
> example:
> $text = "This is \'very important\'";
> Do I have to use split for this?
No (but it would be possible). A capturing regex would be a more
suitable way. Recommended reading:
http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlrequick.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 26 Jan 2005 12:45:38 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: pattern matching
Message-Id: <ct834d$fdv$2@sun3.bham.ac.uk>
Bernard El-Hagin wrote:
> my ( $single_quoted ) = $text =~ m/'([^']+)'/;
>
> This assumes you have only one single-quoted string in $text.
If you make that assumption then your pattern is uncessarily
complicated. You will get the same result with:
/'(.*)'/
------------------------------
Date: Wed, 26 Jan 2005 14:04:40 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: pattern matching
Message-Id: <Xns95EA8F34FB957elhber1lidotechnet@62.89.127.66>
Brian McCauley <nobull@mail.com> wrote:
> Bernard El-Hagin wrote:
>
>> my ( $single_quoted ) = $text =~ m/'([^']+)'/;
>>
>> This assumes you have only one single-quoted string in $text.
>
> If you make that assumption then your pattern is uncessarily
> complicated.
Habit. :-)
--
Cheers,
Bernard
------------------------------
Date: Wed, 26 Jan 2005 08:19:15 -0500
From: "yusufdestina" <joericochuyt@msn.com>
Subject: Re: pattern matching
Message-Id: <8b8558b1695e65ba462483ec6567d2a5@localhost.talkaboutprogramming.com>
tnx all, this is heavy stuff :)
------------------------------
Date: 26 Jan 2005 04:19:24 -0800
From: strepxe@yahoo.co.uk (championsleeper)
Subject: Problem installing modules on redhat 9 - strange connection problem
Message-Id: <103a78f3.0501260419.7bd07435@posting.google.com>
Hi,
I am trying to install perl modules using CPAN and get some very
strange errors. Setting the scene:
- Running RH9
- Using perl 5.8.0
- I login as root
- the cpan archive is in /root/.cpan
- I can access the internet (using browser, links, dig)
When I attempt use of CPAN for installing modules the output [end]
shows that it cannot get information from the sites.
What is strange is that if I run the command:
/usr/bin/links -source
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
then the file is downloaded.
When perl runs it as
sh -c "/usr/bin/links -source
http://cpan.teleglobe.net/authors/01mailrc.txt.gz" > <some_filename>
it does not work.
I'm a bit confused as regards where to go next. I'm not sure but think
it may be an o/s problem but cannot see anything which could be
preventing the communicaitons - even with firewall temporarily off.
I'm going to investigate more and will post any findings I have. Would
appreciate any advice or pointers people could offer.
SC
================================================================================
[root@localhost CPAN]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.61)
ReadLine support available (try 'install Bundle::CPAN')
cpan> o conf urllist
urllist
http://cpan.teleglobe.net/
Type 'o conf' to view configuration edit options
cpan> o conf urllist unshift http://cpan.teleglobe.net/
cpan> o conf urllist push http://cpan.teleglobe.net
cpan> install Bundle::CPAN
CPAN: Storable loaded ok
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
LWP failed with code[404] message[Not Found]
Fetching with LWP:
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
LWP failed with code[404] message[Not Found]
Fetching with LWP:
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
LWP failed with code[404] message[Not Found]
Trying with "/usr/bin/links -source" to get
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
Receive timeout
System call "/usr/bin/links -source
"http://cpan.teleglobe.net/authors/01mailrc.txt.gz" >
/root/.cpan/sources/authors/01mailrc.txt"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz]
doesn't exist
Trying with "/usr/bin/ncftpget" to get
http://cpan.teleglobe.net/authors/01mailrc.txt.gz
NcFTPGet 3.1.5
Usages:
ncftpget [flags] remote-host local-dir remote-path-names... (mode
1)
ncftpget -f login.cfg [flags] local-dir remote-path-names... (mode
2)
ncftpget [flags] ftp://url.style.host/path/name (mode
3)
ncftpget -c [flags] remote-host remote-path-name > stdout (mode 4)
ncftpget -c [flags] ftp://url.style.host/path/name > stdout (mode 5)
...
...
...
================================================================================
------------------------------
Date: Wed, 26 Jan 2005 19:03:46 +0800
From: sam <sam.wun@authtec.com>
Subject: Problem with encoding with Spreadsheet::Writer
Message-Id: <ct7v1i$11p3$1@news.hgc.com.hk>
Hi,
I use Spreadsheet::Writer save chinese character fields into spread
sheet. However my client reported these fields are not readable by
Excel. If they copy these characters directly from the web page into
excel spreadsheet, it is readable, but not with those converted by
Spread::Writer.
Is there any workaround for this encoding problem when using
Spreadsheet::Writer?
Thanks
Sam
------------------------------
Date: Wed, 26 Jan 2005 12:27:43 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: qiuckie for creating a file with date in name
Message-Id: <ct821t$f0v$1@sun3.bham.ac.uk>
Paul Lalli wrote:
>
> Something along the lines of
> my @time = localtime(time);
> my $file = sprintf("File_%4d%2d%2d_%2d%2d%2d.done",
> $time[5]+1900,$time[4]+1, @time[3,2,1,0]);
That almost works but is unsightly. The OP probably wanted numbers
padded with leading zeros not spaces.
There is, however, another function you can use in place of sprintf()
especially for this job to be found in one of the standard Perl modules.
This function takes a template a bit like that used in sprintf() but the
elements of the template directly correspond to various representations
of bits of the time structure return by localtime().
> read about localtime in
> perldoc -f localtime
And while you are there you can also read about the function I mention
above.
------------------------------
Date: Wed, 26 Jan 2005 11:22:22 GMT
From: Mattias Torsfred <mattias@torsfred.com>
Subject: Redirect problems...
Message-Id: <O3LJd.390$4c.47527@juliett.dax.net>
Hi, I'm having problem with redirection. Case...
1. HTML with FORM (generated with perl)
2. I want to redirect user after filling out FORM and POST data.
I have tried with....
if ($ENV{'REQUEST_METHOD'} eq 'POST'){
print redirect('some.pl') #This will generate a new HTML page
}
...i want the user to fill out the FORM then get an "Thanks for...."
page that redirect him/her to for example an login page...
I will be pleased if any takes time to help me :)
//Mattias Torsfred
------------------------------
Date: Wed, 26 Jan 2005 13:00:19 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Redirect problems...
Message-Id: <Xns95EA844C8E95Delhber1lidotechnet@62.89.127.66>
Mattias Torsfred <mattias@torsfred.com> wrote:
> Hi, I'm having problem with redirection. Case...
>
> 1. HTML with FORM (generated with perl)
> 2. I want to redirect user after filling out FORM and POST data.
>
> I have tried with....
>
> if ($ENV{'REQUEST_METHOD'} eq 'POST'){
> print redirect('some.pl') #This will generate a new HTML page
> }
use CGI;
...
print $query->redirect('http://www.useCGI.pm/');
--
Cheers,
Bernard
------------------------------
Date: Wed, 26 Jan 2005 13:00:39 +0000
From: chris-usenet@roaima.co.uk
Subject: Re: Redirect problems...
Message-Id: <nsgkc2-kap.ln1@moldev.cmagroup.co.uk>
Mattias Torsfred <mattias@torsfred.com> wrote:
> Hi, I'm having problem with redirection. Case...
> if ($ENV{'REQUEST_METHOD'} eq 'POST'){
> print redirect('some.pl') #This will generate a new HTML page
> }
> I will be pleased if any takes time to help me :)
I presume you're using the CGI module on the basis that you're referencing
a redirect() function. So, "perldoc CGI" and search for the bit that
tells you how to use it properly.
Chris
------------------------------
Date: Wed, 26 Jan 2005 13:30:21 GMT
From: Mattias Torsfred <mattias@torsfred.com>
Subject: Re: Redirect problems...
Message-Id: <NXMJd.394$4c.48366@juliett.dax.net>
Thanks Bernard, I will check that out...cheers //Mattias Torsfred
Bernard El-Hagin skrev:
> Mattias Torsfred <mattias@torsfred.com> wrote:
>
>
>>Hi, I'm having problem with redirection. Case...
>>
>>1. HTML with FORM (generated with perl)
>>2. I want to redirect user after filling out FORM and POST data.
>>
>>I have tried with....
>>
>>if ($ENV{'REQUEST_METHOD'} eq 'POST'){
>> print redirect('some.pl') #This will generate a new HTML page
>>}
>
>
>
> use CGI;
>
> ...
>
> print $query->redirect('http://www.useCGI.pm/');
>
>
------------------------------
Date: Wed, 26 Jan 2005 09:31:05 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: regular expressions
Message-Id: <ct7o0p$br7$1@sparta.btinternet.com>
Sokar wrote:
> hi,
>
> I have the string
>
> $variable = ",1,2,3,4,5";
>
> I was wondering if anyone knew a regular expression that would remove the
> first "," so that I would have
>
> $variable = "1,2,3,4,5"
>
Tell the group which regular expressions you have tried. They'll then be
able to help you better.
Have you read the FAQ and tried command "perldoc perlre"?
------------------------------
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 7694
***************************************