[25046] in Perl-Users-Digest
Perl-Users Digest, Issue: 7296 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 24 18:05:47 2004
Date: Sun, 24 Oct 2004 15:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 24 Oct 2004 Volume: 10 Number: 7296
Today's topics:
Re: Any good Net::Jabber examples? <njc@wolfgang.uucp>
Re: arrays of arrays question <nospam@nospam.com>
Re: arrays of arrays question <usa1@llenroc.ude.invalid>
Re: arrays of arrays question <nospam@nospam.com>
Re: arrays of arrays question <usa1@llenroc.ude.invalid>
Re: arrays of arrays question <nospam@nospam.com>
Re: arrays of arrays question <spamtrap@dot-app.org>
Re: arrays of arrays question <matthew.garrish@sympatico.ca>
Re: arrays of arrays question <matthew.garrish@sympatico.ca>
Re: arrays of arrays question <nospam@nospam.com>
Copy modules to another identical installation? <none@none.com>
Re: Copy modules to another identical installation? <nobull@mail.com>
Re: copying files (wana)
Re: copying files <usa1@llenroc.ude.invalid>
Re: copying files <usenet@morrow.me.uk>
Re: copying files <usa1@llenroc.ude.invalid>
FAQ 4.43: How do I compute the difference of two arrays <comdog@panix.com>
FAQ 4.56: What happens if I add or remove keys from a h <comdog@panix.com>
foreach vs. for <nospam@nospam.com>
Re: foreach vs. for <usa1@llenroc.ude.invalid>
Re: foreach vs. for <postmaster@castleamber.com>
Re: foreach vs. for <nospam@nospam.com>
Re: foreach vs. for <spamtrap@dot-app.org>
Re: foreach vs. for <spamtrap@dot-app.org>
Re: Is there any way to call a function w/in an RE <nobull@mail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 24 Oct 2004 15:56:32 -0500
From: Neil Cherry <njc@wolfgang.uucp>
Subject: Re: Any good Net::Jabber examples?
Message-Id: <slrncno5o0.6bf.njc@wolfgang.uucp>
On Fri, 22 Oct 2004 17:57:08 -0500, Neil Cherry wrote:
> I'm having quite a bit of trouble with Net::Jabber. I've seen some
> examples and I have used them but now I wish to turn on debugging and
> can't quite find a good example. Any pointers?
>
> The reason I need the debugging is that a script that was working is
> suddenly getting:
>
> Error: Jabber Authorization failed: 406
>
> I suspect that I'm not doing something as opposed to doing something
> wrong.
>
> Thanks
>
I found what I was looking for:
http://www.cs.fiu.edu/~kmerr001/sJab/
this seems like a pretty good example of Jabber client code.
I also discovered why I was having trouble (the above 406). Turns out
that the example given for the initial code I used put the user name
and jabber domain as 1 parameter when it should have been just the
username (username instead of username@jabber.domain.xyz).
--
Linux Home Automation Neil Cherry ncherry@comcast.net
http://home.comcast.net/~ncherry/ (Text only)
http://hcs.sourceforge.net/ (HCS II)
http://linuxha.blogspot.com/ My HA Blog
------------------------------
Date: Sun, 24 Oct 2004 13:48:31 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: arrays of arrays question
Message-Id: <1098640155.622711@nntp.acecape.com>
> They only help if you read them. Look at the list of available docs with
> "perldoc perl". Look in the tutorials section near the top. What is the
> name of the third tutorial listed there?
>
> I've been very patient and tried to help you, but I'm reaching my limit.
> You need to start making *some* effort to help yourself.
you know "sherm", and i guess with a name like that i really should forgive
you for being a condesending ass....perhaps your parents should have looked
through the "names guaranteed to lose your lunch money with" faq? i have
been through them...but hopefully even an omnipitent god such as yourself
can recall that in learning any language, pointers is always the more
difficult. ah please forgive my incorrect terminology, i forgot i am in
perl world now. references! now, if you would like to discuss my problems
without that stick up your ass read on. other wise stop reading here.
i will describe how far i have taken it, right now am going by faq.perl.org
and in the chapters i have perused, could not find an example of my exact
dillema. i can successfully use pop and push with scalar, but it is using
them with arrays that i cannot make them work. but once i start popping
arrays unto arrays, it goes out of wack. assuming that arrays are naturally
references, then perhaps a reference to an array is a reference to a
reference?
i cannot get on to www.perldoc.com at this moment, not loading. if you know
of a mirror, i would take that. if you know of a better site than
faq.perl.org i will gladly listen.
promise to simply stop assuming that i have not tried, and i will promise to
not assume that you are simply an ass.
thanks
------------------------------
Date: 24 Oct 2004 18:05:00 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: arrays of arrays question
Message-Id: <Xns958C8F4369286asu1cornelledu@132.236.56.8>
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098640155.622711@nntp.acecape.com:
>> They only help if you read them. Look at the list of available docs
>> with "perldoc perl". Look in the tutorials section near the top. What
>> is the name of the third tutorial listed there?
[ rudeness snipped ]
> i cannot get on to www.perldoc.com at this moment, not loading. if
> you know of a mirror, i would take that.
All of the documentation that is available on the web sites you mention is
also available on your computer. That is what Sherm was referring to does
"perldoc perl"
look like a URL to you?
If you prefer, there is also documentation in HTML format which is
accessible through the ActiveState program group in the Windows Start Menu.
> promise to simply stop assuming that i have not tried,
I don't know which one is worse, that you are trying but unable to follow
even the most basic of suggestions or that you seem to simply want everyone
else to do your work.
Sinan
------------------------------
Date: Sun, 24 Oct 2004 14:39:23 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: arrays of arrays question
Message-Id: <1098643208.557416@nntp.acecape.com>
> "perldoc perl"
>
> look like a URL to you?
well, living off the web (especially www.perldoc.com this past week), and
not touching command line till yesterday, hopefully you can see how i
misread.
but thanks for pointing out my error
> I don't know which one is worse, that you are trying but unable to follow
> even the most basic of suggestions or that you seem to simply want
everyone
> else to do your work.
what's worse is your "assumptions". the root of all things gone bad...
not wanting to do the work would mean me coming here and saying, how do i
get an array of arrays.
from my original post you can see i typed out exactly what i was doing! put
your ego in having to be right about this aside and you shoudl see i have
done the work, have gone through two books, and have hit that "wall" we all
hit here and there. am sure you have yourself. in fact going by my last
post (list vs.arrays) you can see that is where my difficulty lies. in
arrays!
so again, please stop assuming i am not trying/working/reading here.
------------------------------
Date: 24 Oct 2004 19:33:23 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: arrays of arrays question
Message-Id: <Xns958C9E3FAB248asu1cornelledu@132.236.56.8>
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098643208.557416@nntp.acecape.com:
[ attributions snipped again ... stop doing that ]
>> does
>>
>> "perldoc perl"
>>
>> look like a URL to you?
>
> well, living off the web (especially www.perldoc.com this past week),
> and not touching command line till yesterday,
That is not our problem and does not excuse your responses.
> so again, please stop assuming i am not trying/working/reading here.
Clearly, you still have not read the posting guidelines. If you had, you
would have seen that the easiest way to get answers here is to follow a
finite number of steps.
Sinan.
------------------------------
Date: Sun, 24 Oct 2004 15:46:55 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: arrays of arrays question
Message-Id: <1098647261.889427@nntp.acecape.com>
> Clearly, you still have not read the posting guidelines. If you had, you
> would have seen that the easiest way to get answers here is to follow a
> finite number of steps.
i forogot to follow my own good advice, and stop reading your posts. why
would i think you would offer anything but condescending remarks...will
promise to keep my promise as of now.
------------------------------
Date: Sun, 24 Oct 2004 15:53:35 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: arrays of arrays question
Message-Id: <3aednQaVxpfcleHcRVn-2w@adelphia.com>
daniel kaplan wrote:
(venting deleted)
I'll be generous, and assume that the gratuitous insults were born of
frustration. Even so - I expect an apology. Frankly, I think you owe the
whole group an apology. You've been acting like a child, and a man your
age should know better.
> can recall that in learning any language, pointers is always the more
> difficult. ah please forgive my incorrect terminology, i forgot i am in
> perl world now. references!
Indeed, they are difficult - which is precisely why there are *multiple*
tutorials explaining them, included with Perl and sitting on your hard
drive right now, waiting for you to read them.
I'm told that ActiveState even provides nice HTML-formatted docs and a
link to them in your start menu. I don't have a Windows machine handy to
see what the menu item is named - but figuring that out ain't exactly
rocket surgery, now is it?
Or, open up a "DOS Box" and run "perldoc perl". Start reading from there
- and pay especially close attention to the tutorials. You'll even find
one specifically detailing how to use arrays of arrays.
And - don't forget that apology.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sun, 24 Oct 2004 15:48:59 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: arrays of arrays question
Message-Id: <FGTed.1529$Qs6.174281@news20.bellglobal.com>
"daniel kaplan" <nospam@nospam.com> wrote in message
news:1098640155.622711@nntp.acecape.com...
>> They only help if you read them. Look at the list of available docs with
>> "perldoc perl". Look in the tutorials section near the top. What is the
>> name of the third tutorial listed there?
>>
>> I've been very patient and tried to help you, but I'm reaching my limit.
>> You need to start making *some* effort to help yourself.
>
>
> you know "sherm", and i guess with a name like that i really should
> forgive
> you for being a condesending ass....perhaps your parents should have
> looked
> through the "names guaranteed to lose your lunch money with" faq?
>
Speaking of parents and asses, I suspect if you were in the Marines, Gunnery
Sergeant Hartman might have the following to say to you:
"It looks to me like the best part of you ran down the crack of your mama's
ass and wound up as a brown stain on the mattress!"
If nothing else, though, take these words to heart and start doing your own
homework:
"Because I am hard you will not like me. But the more you hate me the more
you will learn."
Matt
------------------------------
Date: Sun, 24 Oct 2004 16:07:33 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: arrays of arrays question
Message-Id: <3YTed.1679$Qs6.180467@news20.bellglobal.com>
"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:3aednQaVxpfcleHcRVn-2w@adelphia.com...
>
> I'm told that ActiveState even provides nice HTML-formatted docs and a
> link to them in your start menu. I don't have a Windows machine handy to
> see what the menu item is named - but figuring that out ain't exactly
> rocket surgery, now is it?
>
Brace yourself for this:
Start -- Programs -- ActiveState ActivePerl 5.8 -- Documentation
Matt
------------------------------
Date: Sun, 24 Oct 2004 16:24:23 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: arrays of arrays question
Message-Id: <1098649593.533902@nntp.acecape.com>
> And - don't forget that apology.
i'll tell you what sherm; read every thread and you'll see that there are a
few people, that see where i had my problems and showed me my errors.
besides, read my threads, and you'll know i have been reading and
exeprimenting, etc.
and then there's always a few of you that just have to be so condescending,
without so much as saying, hey fool, check your syntax, or the likes...
to those of you who have offered an actuall helping hand, instead of
speeches, when needed, you have my undying gratitude....you are what make
places like this a community, not a club...
and to those exceptional few of you just want to be some type of snob, if
you can't see that i only returned back the same attitude you gave to
me...then there is nothing i can say that will make you see differently
but therefor to all THIRD party readers, i need to learn to not strike back
at anonymous strikes from ....i will apologize for my half of answering back
when i should have ignored and just stopped things from growing...
------------------------------
Date: Sun, 24 Oct 2004 16:52:29 +0100
From: zaphod <none@none.com>
Subject: Copy modules to another identical installation?
Message-Id: <417bcfbe$0$33596$ed2619ec@ptn-nntp-reader02.plus.net>
I have 3 identical installations of Fedora 2 which have the default Perl
replaced with a source compilation. After building up an extensive module
collection on one of the machines I'd like to have the same collection
installed on the other 2. Can I simply copy the module collection over? What
else is involved?
zaphod
------------------------------
Date: Sun, 24 Oct 2004 18:42:19 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Copy modules to another identical installation?
Message-Id: <clgp95$hsp$1@sun3.bham.ac.uk>
zaphod wrote:
> I have 3 identical installations of Fedora 2 which have the default Perl
> replaced with a source compilation. After building up an extensive module
> collection on one of the machines I'd like to have the same collection
> installed on the other 2. Can I simply copy the module collection over?
Yes.
------------------------------
Date: 24 Oct 2004 08:43:12 -0700
From: ioneabu@yahoo.com (wana)
Subject: Re: copying files
Message-Id: <bf0b47ca.0410240743.5571a1df@posting.google.com>
yadurajj@yahoo.com (yaduraj) wrote in message news:<3668515b.0410240242.998b3ee@posting.google.com>...
> I have a simple question,pardon me..
>
> if I have to copy a file, I can use something like this:
>
> copy ("$DIR/test.c" ,"$INP_DIR/");
>
> this copies test.c from one location to another..but
> if i have to copy all the files with .c extension like, what is the
> method to this...
> can i not use *.c in some way..
> please help me on this..
>
> thanks in advance
maybe this would work:
system("mv $DIR/*.c $INP_DIR/");
I'm sure there is something in the File module that is better though.
By the way, 'Perl Cookbook' is awsome. I just bought it and it is an
incredible reference and would have saved me a lot of trouble if I had
bought it earlier.
wana
------------------------------
Date: 24 Oct 2004 16:30:10 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: copying files
Message-Id: <Xns958C7F2FC2660asu1cornelledu@132.236.56.8>
ioneabu@yahoo.com (wana) wrote in
news:bf0b47ca.0410240743.5571a1df@posting.google.com:
> yadurajj@yahoo.com (yaduraj) wrote in message
> news:<3668515b.0410240242.998b3ee@posting.google.com>...
>> I have a simple question,pardon me..
>>
>> if I have to copy a file, I can use something like this:
>>
>> copy ("$DIR/test.c" ,"$INP_DIR/");
>>
>> this copies test.c from one location to another..but
>> if i have to copy all the files with .c extension like, what is the
...
> maybe this would work:
>
> system("mv $DIR/*.c $INP_DIR/");
Ahem, the OP said copy, note move.
Sinan.
------------------------------
Date: Sun, 24 Oct 2004 17:12:36 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: copying files
Message-Id: <ks0t42-hm4.ln1@osiris.mauzo.dyndns.org>
Quoth "A. Sinan Unur" <usa1@llenroc.ude.invalid>:
>
> system('cp', "$source/*.c", $target) == 0
> or die "System failed: $?;
Err... this may work on Win32, but any system with C exec conventions
will require a shell to expand the wildcard.
system("cp $source/*.c $target") and die "cp failed: $?";
and pray $source doesn't need quoting...
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else ** ben@morrow.me.uk
------------------------------
Date: 24 Oct 2004 16:49:21 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: copying files
Message-Id: <Xns958C826FE4F67asu1cornelledu@132.236.56.8>
Ben Morrow <usenet@morrow.me.uk> wrote in news:ks0t42-
hm4.ln1@osiris.mauzo.dyndns.org:
>
> Quoth "A. Sinan Unur" <usa1@llenroc.ude.invalid>:
>>
>> system('cp', "$source/*.c", $target) == 0
>> or die "System failed: $?;
>
> Err... this may work on Win32, but any system with C exec conventions
> will require a shell to expand the wildcard.
You are right. I only tried it on Windows 98 with copy instead of cp. Since
copy is a built-in with command.com, it did not have a problem expanding
the wildcard. However, I just noticed another problem with it: Since I had
forgotten to create the target directory, it appended all the files (in
text mode) to create one file with the directory name I had in $target.
I think this justifies my preference for not shelling out for wholesale
file operations, but using File::Copy.
Sinan.
------------------------------
Date: Sun, 24 Oct 2004 16:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.43: How do I compute the difference of two arrays? How do I compute the intersection of two arrays?
Message-Id: <clgjnl$pld$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
4.43: How do I compute the difference of two arrays? How do I compute the intersection of two arrays?
Use a hash. Here's code to do both and more. It assumes that each
element is unique in a given array:
@union = @intersection = @difference = ();
%count = ();
foreach $element (@array1, @array2) { $count{$element}++ }
foreach $element (keys %count) {
push @union, $element;
push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
}
Note that this is the *symmetric difference*, that is, all elements in
either A or in B but not in both. Think of it as an xor operation.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Sun, 24 Oct 2004 22:03:00 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.56: What happens if I add or remove keys from a hash while iterating over it?
Message-Id: <clh8qk$3pb$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
4.56: What happens if I add or remove keys from a hash while iterating over it?
Don't do that. :-)
[lwall] In Perl 4, you were not allowed to modify a hash at all while
iterating over it. In Perl 5 you can delete from it, but you still can't
add to it, because that might cause a doubling of the hash table, in
which half the entries get copied up to the new top half of the table,
at which point you've totally bamboozled the iterator code. Even if the
table doesn't double, there's no telling whether your new entry will be
inserted before or after the current iterator position.
Either treasure up your changes and make them after the iterator
finishes or use keys to fetch all the old keys at once, and iterate over
the list of keys.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Sun, 24 Oct 2004 17:18:19 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: foreach vs. for
Message-Id: <1098652747.454270@nntp.acecape.com>
and yes i have looked in the dox, but it's more of a low-level question
am trying to find out if there is an essential difference between the way
the two run that you would chose one over the other. the best answer i have
found so far (book) was "foreach is longer to type".
anything else?
thanks ahead
------------------------------
Date: 24 Oct 2004 21:26:36 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: foreach vs. for
Message-Id: <Xns958CB17163D69asu1cornelledu@132.236.56.8>
"daniel kaplan" <nospam@nospam.com> wrote in
news:1098652747.454270@nntp.acecape.com:
> and yes i have looked in the dox, but it's more of a low-level
> question
>
> am trying to find out if there is an essential difference between the
> way the two run that you would chose one over the other. the best
> answer i have found so far (book) was "foreach is longer to type".
>
> anything else?
The first place to look is perldoc perlsyn. If you installed AS Perl in
C:\Perl on your computer, you can also find the same documentation in HTML
format:
file:///C:/Perl/html/lib/Pod/perlsyn.html#for_loops
As has been mentioned a few times, you can reach the table of contents for
the documentation installed on _your_ computer through the Windows Start
Menu.
Sinan.
------------------------------
Date: 24 Oct 2004 21:33:42 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: foreach vs. for
Message-Id: <Xns958CA879B126Bcastleamber@130.133.1.4>
daniel kaplan wrote:
> and yes i have looked in the dox, but it's more of a low-level
> question
>
>
> am trying to find out if there is an essential difference between the
> way the two run that you would chose one over the other. the best
> answer i have found so far (book) was "foreach is longer to type".
>
> anything else?
6 tacos and a manzanita
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Sun, 24 Oct 2004 17:46:21 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: foreach vs. for
Message-Id: <1098654429.750724@nntp.acecape.com>
> As has been mentioned a few times, you can reach the table of contents for
> the documentation installed on _your_ computer through the Windows Start
> Menu.
thank you for the direct link....
but with regards to finding the correct link (and yes, i skimmed right past
SYN looking for SYNTAX) , it isn't as easy to just get there....
so my first attempt lately has been to go to perldoc, thinking it would lead
me somewhere....but truth be told it did not....someone mentioned finding
the correct words in perldoc isn't so easy...and i tried every variation.
so now that you gave me the direct link i looked for "For Loops" using
perldoc....and still nothing. do i misunderstand "perldoc"'s use, or am i
using it incorrectly?
------------------------------
Date: Sun, 24 Oct 2004 18:00:38 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: foreach vs. for
Message-Id: <8oCdnS9o6caVu-HcRVn-qA@adelphia.com>
daniel kaplan wrote:
> someone mentioned finding
> the correct words in perldoc isn't so easy...and i tried every variation.
That would be me - but I think you misunderstood. Figuring out the right
keywords to use when searching FAQ questions with "perldoc -q" can be
difficult.
However, "perldoc perl" will give you a list of all the PODs on your
system, with a short description of each.
> perldoc....and still nothing. do i misunderstand "perldoc"'s use, or am i
> using it incorrectly?
Well, for details there's always "perldoc perldoc". :-)
Perldoc is primarily like a man page viewer for Perl. You "perldoc foo"
to view the page named foo, "perldoc -f foo" for a description of the
function foo(), or "perldoc Foo::Bar" for the docs on the Foo::Bar
module. Searching is limited to the FAQ pages with "perldoc -q
searchword" - go to <http://perldoc.com> if you need more extensive
searching than that.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sun, 24 Oct 2004 18:03:43 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: foreach vs. for
Message-Id: <Q7udnfCgcJBdu-HcRVn-hg@adelphia.com>
daniel kaplan wrote:
> am trying to find out if there is an essential difference between the way
> the two run that you would chose one over the other. the best answer i have
> found so far (book) was "foreach is longer to type".
It's primarily a matter of style. If you're coming to Perl from C, you
might be more comfortable, at least for now, with for.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sun, 24 Oct 2004 18:55:25 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Is there any way to call a function w/in an RE
Message-Id: <clgq1o$i9v$1@sun3.bham.ac.uk>
El Duce wrote:
> I would like to call a function w/in an RE. Say foo:
>
> $x =~ s/abc(.*)def/foo($1)/g;
The LHS of a s/// is a regex, the RHS (without a /e switch) is just a
double-quotish string.
The question "How do I expand function calls in a string?" is a FAQ.
However the /e switch makes the RHS of s/// be parsed as a plain Perl
expression.
Had you really wanted to call a function inside a regex there (which you
didn't but others finding this thread on a search engine might) you can
use the (?{}) or (??{}) syntax documented in 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 7296
***************************************