[26470] in Perl-Users-Digest
Perl-Users Digest, Issue: 8635 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 6 00:05:32 2005
Date: Sat, 5 Nov 2005 21:05:04 -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 Sat, 5 Nov 2005 Volume: 10 Number: 8635
Today's topics:
Re: ActivePerl 5.8 build 508: some installation queries <sisyphus1@nomail.afraid.org>
Re: FAQ 4.41 How can I remove duplicate elements from a <samwyse@gmail.com>
Re: FAQ 4.41 How can I remove duplicate elements from a <abigail@abigail.nl>
Re: FAQ 4.41 How can I remove duplicate elements from a <1usa@llenroc.ude.invalid>
Re: How to get html help of ActivePerl <1usa@llenroc.ude.invalid>
Re: How to get html help of ActivePerl <matthew.garrish@sympatico.ca>
Re: How to get html help of ActivePerl <samwyse@gmail.com>
Re: How to get html help of ActivePerl <1usa@llenroc.ude.invalid>
Re: The Purpose of the Precious Swich in PPM3 (Newbie) <see.sig@rochester.rr.com>
Re: The Purpose of the Precious Swich in PPM3 (Newbie) <sisyphus1@nomail.afraid.org>
Re: Why my code doesn't look Perl-ish? <Fred@fred.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 6 Nov 2005 09:02:40 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: ActivePerl 5.8 build 508: some installation queries
Message-Id: <436d2c43$0$2117$afc38c87@news.optusnet.com.au>
"V S Rawat" <VSRawat@Invalid.none> wrote in message
news:xn0e9ds9w1u4hy000@xananews...
> Have installed it, and been working with it for last one week.
>
> Exploring the manuals, I noticed the following things:
>
> Giving "perl -V" on command prompt (capital V), shows some
> entries, out of which the following are peculiar:
>
> Linker and Libraries:
> ld='link', ldflags ='-nologo -nodefaultlib -release
> -libpath:"D:\p4\Apps\Gecko\MSI\data\ActivePerl\Perl\lib\CORE"
> -machine:x86'
> libpth=C:\PROGRA~1\MICROS~3\VC98\lib
>
That's a little strange. My ActiveState perl has the same (non-existent)
listing for libpth, but libpath has been overwritten to correctly report the
location of perl/lib/CORE on my box as "E:\Perl810\lib\CORE".
I don't think the incorrect 'libpath' will matter unless you start
compiling extensions (ie modules containing XS code) from source - and you
won't be doing that since you don't have a compiler.
And the incorrect 'libpth' won't matter at all - which is why they don't
bother overwriting it.
.
.
>
> Which env variables I need to set to optimize it when Perl is
> already running my programs.
>
The perl\bin folder is normally added to the path env variable - which has
already been done, as you've noted - and that's usually the only env
variable that gets set.
Cheers,
Rob
------------------------------
Date: Sat, 05 Nov 2005 23:29:52 GMT
From: Samwyse <samwyse@gmail.com>
Subject: Re: FAQ 4.41 How can I remove duplicate elements from a list or array?
Message-Id: <Qfbbf.13756$Zv5.11081@newssvr25.news.prodigy.net>
PerlFAQ Server wrote:
> 4.41: How can I remove duplicate elements from a list or array?
>
> (contributed by brian d foy)
>
> Use a hash. When you think the words "unique" or "duplicated", think
> "hash keys".
That reminds me, I have a task on my plate to take a sorted list and
return a sorted list with duplicates removed, i.e. to implement 'uniq'.
Before I start, does anyone have any ideas, or should I just go with
the FAQ and sort the keys afterwards.
------------------------------
Date: 06 Nov 2005 00:05:58 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: FAQ 4.41 How can I remove duplicate elements from a list or array?
Message-Id: <slrndmqi76.2l3.abigail@alexandra.abigail.nl>
Samwyse (samwyse@gmail.com) wrote on MMMMCDXLIX September MCMXCIII in
<URL:news:Qfbbf.13756$Zv5.11081@newssvr25.news.prodigy.net>:
^^ PerlFAQ Server wrote:
^^ > 4.41: How can I remove duplicate elements from a list or array?
^^ >
^^ > (contributed by brian d foy)
^^ >
^^ > Use a hash. When you think the words "unique" or "duplicated", think
^^ > "hash keys".
^^
^^ That reminds me, I have a task on my plate to take a sorted list and
^^ return a sorted list with duplicates removed, i.e. to implement 'uniq'.
^^ Before I start, does anyone have any ideas, or should I just go with
^^ the FAQ and sort the keys afterwards.
Huh? Does the PerlFAQ server serve different answers than are found in
man perlfaq4? That FAQ gives you several answers you can use if you don't
want to modify the order of your array - so no need to sort afterwards
after following the FAQ.
Abigail
--
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_=sub{print/::(.*)/};
$\=$/;q<Just another Perl Hacker>->();
------------------------------
Date: Sun, 06 Nov 2005 00:43:11 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FAQ 4.41 How can I remove duplicate elements from a list or array?
Message-Id: <Xns9705C89B01286asu1cornelledu@127.0.0.1>
Abigail <abigail@abigail.nl> wrote in
news:slrndmqi76.2l3.abigail@alexandra.abigail.nl:
> Samwyse (samwyse@gmail.com) wrote on MMMMCDXLIX September MCMXCIII in
> <URL:news:Qfbbf.13756$Zv5.11081@newssvr25.news.prodigy.net>:
> ^^ PerlFAQ Server wrote:
> ^^ > 4.41: How can I remove duplicate elements from a list or array?
> ^^ >
> ^^ > (contributed by brian d foy)
> ^^ >
> ^^ > Use a hash. When you think the words "unique" or
> ^^ > "duplicated", think "hash keys".
> ^^
> ^^ That reminds me, I have a task on my plate to take a sorted list
> ^^ return a sorted list with duplicates removed, i.e. to implement
> ^^ 'uniq'. Before I start, does anyone have any ideas, or
> ^^ should I just go with the FAQ and sort the keys afterwards.
>
> Huh? Does the PerlFAQ server serve different answers than are found in
> man perlfaq4? That FAQ gives you several answers you can use if you
> don't want to modify the order of your array - so no need to sort
> afterwards after following the FAQ.
<quotation>
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.
</quotation>
In this case, the modified version seems to omit various bits of useful
information. brian, I can see what you tried to do with the exposition,
but I am not sure the additional clarity is worth omitting case (a) in
the original answer.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sat, 05 Nov 2005 19:05:20 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to get html help of ActivePerl
Message-Id: <Xns97058F532ADBAasu1cornelledu@127.0.0.1>
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in
news:Fs6bf.19938$LF3.1078879@news20.bellglobal.com:
>
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns97048FB4B3B41asu1cornelledu@127.0.0.1...
>> "V S Rawat" <VSRawat@Invalid.none> wrote in news:xn0e9csox1kgbf001
>> @xananews:
>>
>>> It seems that ActivePerl does not have that feature.
>>
>> Start -> All Programs -> ActivePerl 5.8.7 Build 813 -> Documentation
>>
>
> Their new documentation interface is crap. It looks nice, and renders
> the documentation for the core modules, but as soon as you start
> adding new modules using ppm you get blank pages when you click on the
> new menu links. Another brilliant creation from the people at AS...
For some reason, I have not had that experience, even when looking at
the docs using the top-level AS documentation frame.
Normally, however, I just do CTRL-T in Firefox, then type
c:\opt\perl\html\site\lib\class\std.html in the address bar.
Somehow, that's faster than expanding menus, scrolling, etc.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sat, 5 Nov 2005 14:17:22 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: How to get html help of ActivePerl
Message-Id: <5z7bf.20339$LF3.1095034@news20.bellglobal.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns97058F532ADBAasu1cornelledu@127.0.0.1...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in
> news:Fs6bf.19938$LF3.1078879@news20.bellglobal.com:
>
>>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
>> news:Xns97048FB4B3B41asu1cornelledu@127.0.0.1...
>>> "V S Rawat" <VSRawat@Invalid.none> wrote in news:xn0e9csox1kgbf001
>>> @xananews:
>>>
>>>> It seems that ActivePerl does not have that feature.
>>>
>>> Start -> All Programs -> ActivePerl 5.8.7 Build 813 -> Documentation
>>>
>>
>> Their new documentation interface is crap. It looks nice, and renders
>> the documentation for the core modules, but as soon as you start
>> adding new modules using ppm you get blank pages when you click on the
>> new menu links. Another brilliant creation from the people at AS...
>
> For some reason, I have not had that experience, even when looking at
> the docs using the top-level AS documentation frame.
>
> Normally, however, I just do CTRL-T in Firefox, then type
> c:\opt\perl\html\site\lib\class\std.html in the address bar.
>
> Somehow, that's faster than expanding menus, scrolling, etc.
>
You're right. I have IE set as the default browser on my home computer so it
always opened the docs. I switched to Firefox and the problem is gone. Must
be a javascript bug...
Matt
------------------------------
Date: Sat, 05 Nov 2005 23:21:39 GMT
From: Samwyse <samwyse@gmail.com>
Subject: Re: How to get html help of ActivePerl
Message-Id: <78bbf.13754$Zv5.4522@newssvr25.news.prodigy.net>
A. Sinan Unur wrote:
> Normally, however, I just do CTRL-T in Firefox, then type
> c:\opt\perl\html\site\lib\class\std.html in the address bar.
I usually do CTRL-T in Firefox, then type the name of the class into the
search bar. After that, I usually have the documentation that I need,
regardless of how I installed, or even whether I've installed the module.
------------------------------
Date: Sun, 06 Nov 2005 00:06:24 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to get html help of ActivePerl
Message-Id: <Xns9705C25E13A22asu1cornelledu@127.0.0.1>
Samwyse <samwyse@gmail.com> wrote in
news:78bbf.13754$Zv5.4522@newssvr25.news.prodigy.net:
> A. Sinan Unur wrote:
>> Normally, however, I just do CTRL-T in Firefox, then type
>> c:\opt\perl\html\site\lib\class\std.html in the address bar.
>
> I usually do CTRL-T in Firefox, then type the name of the class into
> the search bar. After that, I usually have the documentation that I
> need, regardless of how I installed, or even whether I've installed
> the module.
There are several drawbacks to doing that:
1. Doesn't work if you don't have network connectivity
2. The docs you get may not match the version of the module
you have installed.
3. You are creating unnecessary hits to CPAN and other sites.
4. There is really no guarantee that Google's "I'm Feeling Lucky"
search will return the CPAN documentation.
If you want to search CPAN from the address bar, add a bookmark under
"Quick Searches":
Name: CPAN
Location: http://search.cpan.org/search?query=%s&mode=all
Keyword: cpan
Now, you can type
cpan class-dbi
in the address bar, you'll get seach results from CPAN.
I also find a Googlized version of this handy:
Name: G-CPAN
Location: http://www.google.com/search?as_epq=%s&as_sitesearch=search.cpan.org
Keyword: gcpan
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Sun, 06 Nov 2005 03:27:26 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: The Purpose of the Precious Swich in PPM3 (Newbie)
Message-Id: <yKebf.136649$7b6.122715@twister.nyroc.rr.com>
Veli-Pekka Tätilä wrote:
> Sisyphus wrote:
>
>>"Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi> wrote in message
>>
>>> -precious
>>> Allows upgrading of "precious" packages
>>
>>This was bound to happen when they let Joseph Heller start writing the
>>docs :-)
>
...
Well, I played around a bit, and the only "precious" package in
my copy of Perl was "libwww-perl". It wouldn't upgrade without
using the -precious switch.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sun, 6 Nov 2005 14:50:47 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: The Purpose of the Precious Swich in PPM3 (Newbie)
Message-Id: <436d7dde$0$25852$afc38c87@news.optusnet.com.au>
"Bob Walton" <see.sig@rochester.rr.com> wrote in message
.
.
> ...
> Well, I played around a bit, and the only "precious" package in
> my copy of Perl was "libwww-perl". It wouldn't upgrade without
> using the -precious switch.
Not sure, but I *think* there are some modules in libwww-perl that ppm
actually uses. Could it be that "precious" simply means "used by ppm" ?
Could it also be that without the "-precious" switch, the upgrade won't take
place because the "precious" module is in use (ie the "-precious" switch
somehow frees it up for upgrade) ?
Cheers,
Rob
------------------------------
Date: Sat, 05 Nov 2005 18:44:00 -0600
From: "Fred@fred.net" <Fred@fred.net>
Subject: Re: Why my code doesn't look Perl-ish?
Message-Id: <54kqm1lbd8hv3v5kqs7uc3rfsag2o6ik1f@4ax.com>
On Fri, 04 Nov 2005 23:35:32 -0800, robic0@yahoo.com wrote:
>On Fri, 04 Nov 2005 23:09:06 -0800, robic0@yahoo.com wrote:
>
>>On 4 Nov 2005 19:57:36 +0100, "V S Rawat" <VSRawat@Invalid.none>
>>wrote:
>>
>>>
>>>I have developed a program that reads one string having several
>>>codes in octal, decimal and/or hex; and/or has the characters.
>>>
>>>say, input: "ab\o081xy\d66z\\x\x81\aqwer";
>>>
>>>it interprets above as "ab (\o081) xy (\d66) z (\\) x (\x81)
>>>(\a) qwer";
>>>
>>>then, it converts the o, d, h codes to chars, and returns the
>>>entire string.
>>>
>>>\o, \d and \x can be followed by any no. of qualifying
>>>digits/chars for that coding. \ bypasses the next char, and the
>>>next char could be \ itself.
>>>
>>>it is working. The main module is the following:
>>>========START
>>>sub get_chrs {
>>> $TmpElementIn = shift(@_); # input string passed on to sub
>>> $TmpElementOut = ""; # string to go back to the caller
>>> $TmpIndexMax = length($TmpElementIn);
>>> $TmpIndexCurr = 0;
>>> $TmpIndexNext = 0;
>>> while ( $TmpIndexCurr < $TmpIndexMax ) {
>>> $TmpIndexNext = index( $TmpElementIn, "\\",
>>>$TmpIndexCurr);
>>> if ( $TmpIndexNext < $TmpIndexCurr ) { # not found
>>> $TmpElementOut =
>>>$TmpElementOut.substr($TmpElementIn, $TmpIndexCurr);
>> ^^^^^^^
>>Funny, this is a cat, but almost looks like a C++ like
>>member function for the "scalar" class.
>>Maybe $TmpElementOut is just a CString.
>>
>>In my opinion, Perl is NOT good for stream parsing of
>>strings because the only powerful tool in Perl for that
>>is Regular Expressions (filters/pattern matching).
>>Though with RE's you do have mechanism's of
>>of capturing the non-matching in-stream characters,
>>but it usually is, if you have multiple paterns,
>>very slow and itterative as opposed to a very robust
>>C++ class like CString. You however, are doing
>>stream parsing and not pattern matching. And,
>>given you are keying on a single escape character
>>(although it could be others combined, as well)
>>I believe your method is "better" than the regex
>>suggested by others. The reason being that your
>>methid is infinetly expandable which would leave
>>regex methods far behind when it comes to stream
>>parsing.
>>
>>Well done!
>Just want to add that sometimes in Perl it would
>be nice to be able to index and adress, ie:
>change and modify a single character in a string,
>known only by its position in the array of
>characters. Or embed a string in a string, or
>delete the same. To "index" a character in
>would be heaven.
<snip>
>Maybe this can be done without
>having to turn a string into an array of characters
>then back into a string. I haven't seen it.
</snip>
Aren't we talking about the same beast, but different ends? Split your
string iteratively and use it. Dosen't matter what "form" it takes, if
you want an index into a set of strings use a hash. And for what it's
worth, a string is an array of characters.
Fred
>It would be nice to have the power to index a
>string even if Perl doesen't know pointers.
>Makes you wonder if "substr" is an intrinsic.
------------------------------
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 8635
***************************************