Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The thing is, you can write Perl in a very C-like manner. (Some people like to play the sport where you write programs which will compile as both valid C and valid Perl!) Writing Perl that way will probably not take you long to pick up...
But on the other hand, this function might look more foreign to you, but if you had experience writing Haskell or Miranda would seem perfectly obvious:
A seasoned Perl programmer will probably have discovered that the following knocks the socks off both of the above performance-wise...
But once you'd gained familiarity with the core libraries and with CPAN, you'd realise that List::Util (from which we borrowed the reduce keyword earlier) has a sum function available, and it runs about 40 times faster that the first example given above. :-) So you'd just borrow that...
So in answer to your question, it might take you a couple of days to start writing C-like code in Perl, but as with any mature programming language, familiarity with the important libraries, and a feel for writing elegant and efficient code take many years to develop.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In reply to Re: Whats the average time taken to learn Perl?
by tobyink
|
|