Re: my in the perl syntax
From: R. Joseph Newton (rjnewton_at_efn.org)
Date: Sat, 07 Feb 2004 19:49:44 -0800 To: Harshal Borade <firstname.lastname@example.org>
Harshal Borade wrote:
> I certainly appreciate the pain you have gone through
> in writing that mail, but I haven't understood about
> "perldoc -f my".
It is meant to be entered exactly as written on the command-line. It is the
same way we call Perl programs:
>perldoc -f my
is a call to the perldoc program or [in Windows, batch file/program]. This
program searches for information
relating to the keywords offered. Since the call in question used the -f
switch, it searches for information
about built-in Perl functions by the name "my". Then it displays the
information found in formatted text.
Use perldoc first to find out about perl keyword, functions, general
question, modules, etc.
> I went through a book , How to Perl
> 5, last night. And it says that every variable
> declared gets into main, a default package. To avoid
> the namespace pollution it says that, its a good way
> to hide names from collision.
> Tell me if I have misunderstood it.
There is no way to tell, really. It sounds like you are almost quoting the
text. Try restating this in your
own words. What you say here does seem to make sense, but what does it mean
to you? Can you
see the connection between scoping and the process of breaking programs into
As you work with these concepts, we will be happy to point you along the
> Well infact if u could send me a a small code which
> uses the perl -f doc
No. This is something you have to get in the habit of doing for yourself.
You should get used to
working at the command-line. It will be critical as you start writing and
testing your code.