--- Tom Yarrish <[EMAIL PROTECTED]> wrote:
> Hey all,
> Been reading the list for a little while, and had sort of a
> philosophy question for the group. I've been trying to learn Perl
> for some time (in fact, my company has offered to pay for me to take
> a Sun course on it).
> In the mean time I've been reading through the standard Perl books
> (Learning Perl and Programming Perl for starters), and trying to get
> an understanding.
> I'm starting to get the gist of the language (understanding how
> arrays work, functions, regex, etc), but my problem is how to "think"
> in a programming style. By that I mean how do I approach a possible
> perl program (like I want to do A, how do I go about doing it). What
> have people done/read/whatever to "think" in a perl state of mind.
> As I said, I've been trying for some time to learn Perl, but it seems
> like this is a hump I can't figure out how to get over.
Try perldoc perlstyle for a starter. It suggests coding style, and
recommends that you not get hung up about it. That's Perl.
Understand TMTOWTDI, the Perl Motto:
There's More Than One Way To Do It.
Write a sample program, and then read all the relevant perldocs
thinking about that program. Did you use for(;;) {} in it? (HISS!!!!!)
Use foreach when you can, and understand what it's doing. It's faster,
more efficient, easier; it requires less work from you, fewer
variables. Yes, there are times for the C-style syntax, but they are
rare.
Read anything by Larry Wall, Perl's Author, such as stuff on
www.perl.com; get a feel for the way the language uses context. For
example, read perldoc perlfunc and look at what functions return in a
scalar context as opposed to a list context. It's a DWIMmy language --
DWIM being an acronym for "Do What I Mean", which Perl sometimes does
even when you don't know why, lol....
And read this list, to see how other people do the same thing
twenty-odd different ways. =o)
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/