peterchan75
Supremacy Member
- Joined
- Apr 26, 2003
- Messages
- 6,756
- Reaction score
- 533
Talking about perl. Its http get is simple and fast.
Having meddled with Perl for a little over a month, I can see why the language isn't beginner friendly. Those magic variables and operators like the diamond operator - which does a job that require probably more than 10 lines of code in python - might look like gibberish to the "untrained" eye. Coupled with the weakly typed nature of the language and the TIMTOWTDI philosophy, it's too easy to end up with unmaintainable code.
Perl's regex support is beyond awesome tho but I'm having a love hate relationship with the language due to its level of implicitness and its quirky OO support…I do find myself using it more often in place of awk and sed, and at times when I need to whip up sometime quick and dirty.
STR=`cat | perl -ne 's/[\r\n]+/\n/g;print'`
That being said, what do you think of Perl 6? I took a quick look and it seems like 6 and 5 are two different languages, with 6 moving towards being more explicit. Have you "migrated" to 6 yet?
Having meddled with Perl for a little over a month, I can see why the language isn't beginner friendly. Those magic variables and operators like the diamond operator - which does a job that require probably more than 10 lines of code in python - might look like gibberish to the "untrained" eye. Coupled with the weakly typed nature of the language and the TIMTOWTDI philosophy, it's too easy to end up with unmaintainable code.
Perl's regex support is beyond awesome tho but I'm having a love hate relationship with the language due to its level of implicitness and its quirky OO support…I do find myself using it more often in place of awk and sed, and at times when I need to whip up sometime quick and dirty.
That being said, what do you think of Perl 6? I took a quick look and it seems like 6 and 5 are two different languages, with 6 moving towards being more explicit. Have you "migrated" to 6 yet?
@Pickle, you really have a very "interesting" fan, don't you ?![]()
That is quite true for the expressiveness of Perl does allows for developers to be wilful and end up with codes that takes another Master of Perl to interpret. However I think it is too much a fallacy to infer that a badly written Python or Java code will makes things a lot easier. I have seen really badly written Java codes and it can be so vague to the extend it takes hours or even days to really understand the concept behind those codes. No comments or useless comments.
So you see, I would say which ever programming language you work with, it can look beautiful and be expressive in times of need and yet achieve very maintainable codes. It's all in the decision of the programmer. It's all in the attitude and the mindset of the programmer. It's never the fault of the tool when things doesn't work, it's just a user whom doesn't use the tool the right way.
Definitely when it comes to consistency across different variables of *nix, perl makes one of the best choice. I do find at times, I just intermix perl into a bash script as such
Code:STR=`cat | perl -ne 's/[\r\n]+/\n/g;print'`
even awk and sed have different variants across *nix and can make certain codes not portable. Like "awk" has nawk, mawk, gawk etc..
Yes Perl 6 is non-portable upgrade from Perl 5. There are just too much fundamental changes to Perl 6 which will break a lot of Perl 5 codes having there must be a lot of ancient codes which are sloppily written. I will think Perl 5 to 6 is not going to be a migration, but rather co-existent. There will be a long time where Perl 5 will still continue to exist to support existing codes, and Perl6 will be for those whom are interested for a new perl project or ready for a full fledge conversion. You know, most of those that uses Perl, I suspect most highly believe in "if it ain't broke don't fix it", so I'm skeptical of the pick up of Perl 6 will be as vibrant as Javascript or any other modern web based programming languages choices. Moreoever, much of what is today in CPAN are still Perl5. I'm not sure how many of the packages there now are still under maintenance, so it's hard to tell for the progress of Perl 6.
I am also just learning about Perl 6, too much of other things to follow and since I predicted Perl6 pick up is going to take some time, it's not much of an urgency for me yet![]()
Question: Is the 'cat' in the command substitution "redundant" in the above code?
STR=`echo $STR | perl -ne 's/[\r\n]+/\n/g;print'`
Yup, you're right. Perl is a beautiful language, but considering how this is my first brush with a weakly-typed, dynamic language, it's like walking on lane full of potholes. Sure needs some time getting used to
Question: Is the 'cat' in the command substitution "redundant" in the above code?
Definitely…it's been 15 years since it's initial development, I'm rather skeptical of the uptake rate. It's like Python 2 vs 3; objective-c vs swift. Older and stable releases will most likely stick around for a long time.
TIOBE Index for December 2015
December Headline: Java's popularity is going through the roof
There is hardly any doubt about it, Java will become TIOBE's programming language of the year 2015. The steep fall of Objective-C of almost 8% this year seems to be completely absorbed by the most popular language at the moment. More about Java next month. Another interesting move concerns the rise of Python. It is currently at its all time high position. It is easy to learn, available everywhere and embraced by industry. Python is the current standard in scripting.
I think not many people know how to create powerful queries with SQL. Their knowledge is limited to simple query.
Swift is the language of the future. !

Unless apple abandons that like they did obj c as well![]()
anyone can help ? where to find software programmer in Unix and Linux and Windows ?
thx