Re: my in the perl syntax

From: R. Joseph Newton (rjnewton_at_efn.org)
Date: 02/08/04


Date: Sat, 07 Feb 2004 19:49:44 -0800
To: Harshal Borade <harshal_b02@yahoo.co.in>

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
manageable chunks?

As you work with these concepts, we will be happy to point you along the
way.

>
> 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.

Joseph



Relevant Pages

  • Re: PERL+CGI+PLUG-IN architecture
    ... > Colombo wrote: ... >> I'm looking for any information about writing ... I'm looking for mechanism in perl to load and use new ... perldoc -f require ...
    (comp.lang.perl.misc)
  • Re: Net::DNS
    ... function because you still use $rr within the foreach, ... > So I can find the all these object methods in the perl docs listed below? ... > the return value of 'grep'. ... > perldoc perlboot ...
    (perl.beginners)
  • Re: Posting Guidelines changes (was Re: variable interpolation of refs to anonymous subroutines)
    ... Experts at Perl or experts at posting to newsgroups? ... use warnings; # see perldoc warnings ...
    (comp.lang.perl.misc)
  • Re: Multitasking
    ... Just a comment for the archives, and to any other beginner to the Perl ... When you look at the perldoc for select, perldoc -f select, you ... select FILEHANDLE ... I just meant avoid using the "Low-level socket functions" ...
    (perl.beginners)
  • Re: Some Advice.
    ... Practice, practice. ... really need that much math to learn to program. ... > for an algorithm but writing a program is more like writing a good paper ... No comment, I don't know Perl. ...
    (alt.comp.lang.learn.c-cpp)