The other day in a class I was teaching Perl for beginners,
I was showing how to copy a file using
File::Copy.
At one point one of the students asked me (and actually this happens
in every class) how could he find out the answer to this
and similar questions without my help ?
I pointed to various resources, still they seemed not to be satisfied
with the answer. So I asked on the
Perl Trainers mailing list what others
tell their students and asked a similar question on a
beginner mailing list.
Here are the pointers I collected so far in two groups but in no particular order within
the groups:
Local resources:
- Serach the FAQ that comes with Perl: perldoc -q "SOME QUESTION"
Specifically this did not have anything about on how to copy a file. While the FAQ is very good it is also constrained by the time of the good people who maintain it
- Search in perldoc perlfunc
obviously this did not have anything about file copy either and in general if there is no such function in Perl, then this is not useful
- ActivePerl users (at least on Windows) have
HTML version of the documentation
- In his post Tad McClellan gave a nice step-by-step approach to solve the problem
On-line resources:
Still, I'd be interested in other ways, monks might use:
So
When you have a question such as "how to copy a file", what do you do to find a solutions ?
Do you prefer to use local resources or on-line resources ?
If you are coming from another programming languages, how would you look
for an answer in that language ?
Looking back to my original question, interestingly I have not even thought about
International Perl Resources, but that's another issue that might be addressed here.
Re: Resources to get help in Perl
by erix (Prior) on Jan 04, 2005 at 17:26 UTC
|
I like the perldocs at perldoc.perl.org. The download contains not only html but
also PDFs (nice for printing).
Google-search of http://perlmonks.thepen.com may be worth pointing out, as it is a lot faster/easier than the perlmonks.org
on-site searching facilities, and does word search (not substring search).
See also Where and how to start learning Perl, by woolfy. (part of perlmonks.org, of course)
UPDATE: http://perldoc.perldrunks.org/ is now perldoc.per.org
| [reply] |
•Re: Resources to get help in Perl
by merlyn (Sage) on Jan 04, 2005 at 16:56 UTC
|
Google my site. With over 200 magazine columns online, it's hard to find a miss. And if you find that I've not talked about something, email me with that, so I can write about it in the future (credit given where due).
| [reply] |
|
| [reply] |
Re: Resources to get help in Perl
by Aragorn (Curate) on Jan 04, 2005 at 18:50 UTC
|
What about books? Looking at the index of Learning Perl, (files entry) I see a reference to File::Copy, in an appendix with some other important modules.
And the Perl Cookbook? Recipe 9.3: Copying or Moving a File.
Searching for things requires a bit of common sense and some imagination. If an online search doesn't yield useful information, ask yourself: "How can I ask this question in another way?". With books, learning to use the index is very important.
I try to use local resources first (Programming Perl and the Cookbook are always within reach) and failing that, I use Google and CPAN. Most of the time that answers my needs.
Arjen | [reply] |
Re: Resources to get help in Perl
by talexb (Chancellor) on Jan 04, 2005 at 17:50 UTC
|
When you have a question such as "how to copy a file", what do you do to find a solutions ?
There's a Perl question and a meta-question being posed here. The question is about copying a file. The meta-question is how do you find out about stuff.
To assist the searcher, I'd suggest looking for information that answers these questions, in the following order:
- Can Perl do that directly (e.g. grep, file exists test (-e))?
- Is there a Perl module to do that (e.g. Net::Ping, CGI and of course File::Copy)?
- Must we shell out and run a command (e.g. installation specific commands, launching applications that communicate by pipe, commands not yet wrapped by a Perl module available on CPAN)?
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
| [reply] |
Re: Resources to get help in Perl
by sth (Priest) on Jan 04, 2005 at 18:33 UTC
|
Besides the valuable resources listed above, I always recommend that new users purchase the Perl CookBook.
| [reply] |
Re: Resources to get help in Perl
by kutsu (Priest) on Jan 04, 2005 at 22:24 UTC
|
You might look at woofly's Tutorial (Where and how to start learning Perl). I've used his post, and the replies to it, a lot when I was stuck on a problem and needed to find an answer.
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce
| [reply] |
Re: Resources to get help in Perl
by qq (Hermit) on Jan 05, 2005 at 12:08 UTC
|
I used to give this as an interview question for perl programmer candidates: when you don't know the answer, or want to research a new problem, where do you look?.
Most people had pretty deficient answers: google usually started the list, then their favourite book (which was often not the Camel or Llama). Most stopped there.
I think its an excellent idea to teach these resources as an explicit part of training. Teach a man to fish...
| [reply] |
Re: Resources to get help in Perl
by Joost (Canon) on Jan 05, 2005 at 12:47 UTC
|
In addition to perlfunc, I would also suggest looking at perlmodlib and/or perltoc if you're searching for some built-in functionality.
| [reply] |
Re: Resources to get help in Perl
by martinvi (Monk) on Jan 06, 2005 at 12:50 UTC
|
I take notes.
Ok, that's not really an existing resource, but a very important one. Every time, I stumble on something interesting, I write down the whole bibliographic declaration and some lines of a summary. At home, I put these notes in some kind of "information retrival system", re-read the source of said information and add some keywords and ideas to the notes.
Obviously, those notes are "wrong", since they reflect my own understanding at any given point in time, including my ignorance and misinterpretation. Also obviously, the notes are invaluable, since they reflect my own understanding at any given point in time. Of course, the notes need some time for (re-)evaluation. I need to know, if I really understood, if I've got some ideas -- preferably with (working (production grade)) code, or if the note just sound interesting, but I didn't have a clue about the meaning.
I recommend that somewhat school-like system. After some time, one can build his/her own resource-repository, which follows ones own habit of information retriveal and processing (also called learning ;-)
| [reply] |
|
I take notes.
...and then you can keep all this information in an on-line repository that might even allow other people to comment on your views. They might even evaluate each others comments. hmmm, good idea :)
| [reply] |
|
|