[perl-python] 20050113 looking up syntax

X

Xah Lee

while programing in Python, one can lookup syntax or info for keywords
or modules within Python.

In the command line, type

python

to get into the python interactive program. then type
help()
From there one can type any keyword or module name to find out the
syntax or info. Everything is self-contained and self-explanatory.

to exit help, type control-d.

if you haven't tried already, you can type 1+1 while running python.
The result will be displayed interactively. So in this way, Python can
be used as a calculator.

---------------------

for perl syntax lookup, use perldoc in the command line. For example:
perldoc perl

use 'perldoc -f functionName' for specific function. example:
perldoc -f qq

note that keywords cannot be looked up with -f. For basic keywords like

if, while..., use
perldoc perlop

Master 'perldoc perl' as a way to get familiar of what info are
available and what subroutine or aspect of perl is in what section of
the documentation associated with what documentation name abbreviation.

Master 'perldoc perldoc' to know all its power of options and
flexibility. If you use emacs, in particular you want to add the -t
option. Master the unix text editor vi to learn the navigation system
of perldoc. The basics are: control-f for page down, control-v for page

up, q for exit. Also, one may wish to peruse 'perldoc perlfaq' to
acquaint yourself about the preamble of nine volumes of perl's FAQ.

---------------------------

Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to (e-mail address removed)
if you are reading it on a web page, program examples may not run
because they've been changed by yahoo.com or google.com.
Xah
(e-mail address removed)
http://xahlee.org/PageTwo_dir/more.html
 
P

Peter Hansen

Xah Lee wrote:
[snip]
Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to (e-mail address removed)

So why duplicate the posts by posting them to the newsgroups?
Now that you've advertised the mailing list (and thank you,
I'll be sure to hurry off now and subscribe) there's no longer
any reason to post to the newsgroups, is there? Please?

-Peter
 
J

Jürgen Exner

Wrong. That command will give you a high-level overview of Perl but tell you
nothing about the syntax.
To lookup the Perl syntax you would have to use

perldoc perlsyn
use 'perldoc -f functionName' for specific function. example:
perldoc -f qq

BS. That will tell you what a function does, it doesn't tell you anything at
all about the syntax of Perl.
BTW: Why on earth are you using qq() as an example? That doc page just
points you to 'perldoc perlop'.
note that keywords cannot be looked up with -f. For basic keywords
like

if, while..., use
perldoc perlop

BS. What gave you the idea that keywords were operators? Of course keywords
can be found where they belong, in the syntax definition of the language,
but not in the operator section of the documentation.

Why don't you just stop posting this nonsense?

jue
 
I

Istvan Albert

Jürgen Exner said:
Why don't you just stop posting this nonsense?

He will, fairly soon. I'm suspecting that the original
intent behind these posts was to stir up a perl vs python
flamewar. That is unlikely to materialize since the
poster does not seem to understand neither of these
languages.

I.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top