Re: Perl For Amateur Computer Programmers
From: Michele Dondi (bik.mido_at_tiscalinet.it)
Date: 02/03/04
- Next message: Michele Dondi: "Re: interpreting script"
- Previous message: R. Cheung: "Embedded Perl sprintf (symbol?) problem."
- Maybe in reply to: David K. Wall: "Re: Perl For Amateur Computer Programmers"
- Next in thread: Tassilo v. Parseval: "Re: Perl For Amateur Computer Programmers"
- Reply: Tassilo v. Parseval: "Re: Perl For Amateur Computer Programmers"
- Reply: Ben Morrow: "Re: Perl For Amateur Computer Programmers"
- Reply: edgrsprj: "Re: Perl For Amateur Computer Programmers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 03 Feb 2004 11:28:32 +0100
On Sat, 31 Jan 2004 13:45:58 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:
>As I stated in some recent posts, I have been looking for a programming
>language which scientists and other people around the world who are not
>professional computer programmers could use with the same ease as Basic.
[snip]
>Perl's structure which I myself do not yet fully understand. So what I have
>been doing while I have been learning how to use it during the past few
>weeks is prepare a Web page which briefly outlines some of its basic
>commands etc. People who can already write simple programs in other
>languages can use those commands to almost immediately begin creating and
>running simple Perl programs.
So, as another poster pointed out, that is fundamentally a journal.
But it aims at being just at the same time a mixture of a tutorial and
a cookbook.
Thus far, fine! In the sense that I can imagine a document that is a
journal *and* a tutorial *and* a cookbook in consistent way. But this
is not the case with yours.
For example you may have a cookbook that behaves like a tutorial by
introducing each example gradually from the very "kernel" and adding
more and more details, and having examples ordered increasingly by
complexity (which is often the case, anyway). And then you may have
clearly marked journal-like "sections" in which you comment the
existing material with your new discoverings. That *could* make sense
(if done properly!), but your attempt IMO plainly doesn't.
>The URL for that Web page is:
>
>Perl For Amateur Computer Programmers
>http://www.freewebz.com/eq-forecasting/Perl.html
Since I think that your efforts are quite laudable, I'll comment some
portions of your page, trying to avoid as much as possible
overlappings with other posters cmts, in the hope that this will serve
to HELP YOU directing your efforts in more productive directions.
| Perl - Practical Extraction and Report Language
No! Quoting from perldoc -q 'difference between "perl" and "perl"':
while "awk and Perl" and "Python and perl" do not. But never write
"PERL", because perl is not an acronym, apocryphal folklore and
post-facto expansions notwithstanding.
| Perl computer language but who are not professional computer programmers. I am planning to gradually add information to
| this Web page as I myself learn how to use Perl.
You're implicitly assuming that your learning process will be purely
incremental, i.e. that learning "how to use Perl" will be a matter of
learning "new stuff": this is plainly wrong, and it would be wrong for
virutallty any kind of learning process. As a scientist, as you claim
to be, you should know that learning always implies a pars denstruens
along with a pars construens...
In this particular case, if you'll learn some more of Perl, you will
soon realize that many of the things you wrote in the first place were
simply wrong even if you will be able to understand why they used to
seem right. So maybe you'll update them, but in the meanwhile the
document will have been available for public reading. Can you
understand the possible issues with this approach?
| A version of Perl called ActivePerl can be downloaded from the following Web site for free and then installed. The
| Windows 5.8.2 MSI program which I myself downloaded was about 12 million bytes in size (12 Meg).
A Megabyte is not a *million* bytes. This mathematically boils down to
the fact that the equation 5^n=2^m doesn't have a solution in integers
(>0) and that computers tend to privilege powers of two. But n=3, m=7
is quite a good approximation and a "better" one , for a precise
definition of "better", involves considerably larger numbers.
Also, taking into account that you're appealing to "scientists", it
seems strange that you document is so much Windows-centric, since
scientists are often used to and working on other OSen.
More precisely, there's something strange that your "tutorial" is so
OS-specific whereas the project would probably benefit from being
OS-independent and, as a side note, probably benefit from being run on
a more performant platform. (No Holy wars, please!)
| One of the easiest ways to get information regarding individual Perl commands appears to be to have Windows run a
| search of the c:\Perl\html\lib\pod directory for references to the desired command.
Huh?!? It may be just MHO, but Windows search is crappy, and why using
a file search anyway, when you have a privileged UI to the
documentation through perldoc?
perldoc perldoc
perldoc perl
And since you're so "Windows-specific", why not using the HTML version
of the documentation kindly provided to you with no efforts by AS?
Also, as a side note, you seem to use the noun "command" in a naive
and not well defined way.
| Creating And Editing Perl Programs
| c:\program.pl
| Perl programs are written using English text. And so any text editing program such as DOS Edit, Windows Notepad, Wordpad,
^^^^^^^
So I suppose that you use to the grocery and say
@ARGV=grep -e, @ARGV;
don't you? Also,
Lingua::Romana::Perligata
;-)
| and Word, or WordPerfect can be used to create and edit them.
While one may well use a wordprocessor as a text editor (being
careful!), it wouldn't be the best tool in any case. Worth mentioning
it! At least, taking into account what you wrote, I think it is worth
mentioning it to *you* and consequently it should be worth for you to
mention it to *your expected audience*.
| Programs should be saved with the ".pl" extension, for
^^^^^^
it is *customary* to save programs with the .pl extension. Under
Windows there *can* be some advantages saving with the .pl extension.
Period.
| Perl normally ignores lines which begin with the pound sign #. Comment lines do not need to end with a semicolon.
^^^^^
print; # edgrsprj thinks this is *not* a comment!
OTOH
$_='';
s#
# edgrsprj thinks this *is* a comment!#x; print;
| If \n is contained within single quotation marks ‘\n’ then when it is used with a print command it will simply print as \n
"it will be printed literally"
| If it is used within double quotation marks “\n” then it becomes something called an Escape Sequence command modifier which
^^^^^^^^^^^^^^^
It is *by no means* an escape sequence and there is not such a thing
called "Escape Sequence command modifier".
| print 'text message','\n';
| print 'text message\n';
| print 'text message',"\n";
| print "text message","\n";
| print "text message\n";
| The first two commands will cause text message\n to be printed when the Perl program has finished with its other operations
| such as doing calculations. The third, fourth, and fifth commands will cause text message to be immediately printed.
| will not appear.
Believe me, this is pure *crap*. Please do a favour yourself and read
the documentation. At least about this!
| filenames and directories. The third command will also work. However I suspect that it is probably better not to use “/”
| with filenames and directories.
Your suspect is wrong. In fact it is "probably better" to use '/' as a
directory separator even on Windows.
| These are Perl command modifiers which do things such as affect printing etc. They have the form \text-string. Only a
| few are listed here.
Ditto as above. Pleeease!!!
No, I don't have the time and the forces to go on... I give up!
Please, if you really don't want to give up with this thing yourself,
at least consider "trying it later". I *assure* you that both you and
your intended audience will greatly benefit from such a choice...
Michele
-- # This prints: Just another Perl hacker, seek DATA,15,0 and print q... <DATA>; __END__
- Next message: Michele Dondi: "Re: interpreting script"
- Previous message: R. Cheung: "Embedded Perl sprintf (symbol?) problem."
- Maybe in reply to: David K. Wall: "Re: Perl For Amateur Computer Programmers"
- Next in thread: Tassilo v. Parseval: "Re: Perl For Amateur Computer Programmers"
- Reply: Tassilo v. Parseval: "Re: Perl For Amateur Computer Programmers"
- Reply: Ben Morrow: "Re: Perl For Amateur Computer Programmers"
- Reply: edgrsprj: "Re: Perl For Amateur Computer Programmers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|