ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I will start by saying I am a self taught bash/ksh shell programmer. I dont always remember the good stuff but I get there in the end and the scripts I write work. No matter how lengthy some are.
But..
I have been told if you know your way around shell programming Perl should be the next step and more beneficial. I have now taken the challenge and what a challenge it is too. I cant get my head around it.
Most formats of loops and tests are similar but then its the modules and the variable derfinitions and then how they are all set out too. ARRGGHH!
Somebody please help and tell me im not the only one having issues here?
I am learning from a SAMS 24hr book which seems to have it all in there but its like reading the bible.. in one ear and out the other!
Cheers for any suggestions you clever people may have
X in 24 Hrs books are not highly thought of, from what I've read/heard.
I recommend the Llama book (Learning Perl from O'Reilly). Very good.
Then, you need this http://perldoc.perl.org/, especially see the left-hand menus eg tutorials.
This site defines/describes the language with examples (lots!).
Also, http://www.perlmonks.org/?node=Tutorials.
Good luck.
...
but then its the modules and the variable derfinitions and then how they are all set out too. ARRGGHH!
...
My standard question for such claims: what is the very first thing you do not understand ?
I suppose you read some documentation, so publish here the first sentence you do not understand and explain what exactly in it you do not understand.
Perl has many features and implements many concepts with which programmers in other languages might not be familiar, for example, a number of scoping paradigms.
So, again, ask particular questions, not just say "ARRGGHH".
I can say the same thing about Python or Ruby, but not because it's true, but rather in an attempt to hide my laziness to learn the languages.
I agree in spirit, but to be fair Perl's syntax is far more varied than Python's. I think that's by design, and it's one reason why Python appeals to some folks and not to others.
I agree in spirit, but to be fair Perl's syntax is far more varied than Python's. I think that's by design, and it's one reason why Python appeals to some folks and not to others.
The OP said he/she could cope with loops, but not variables and modules.
Since the OP comes from bash/ksh, it's expected, but partially - both shells at least have the '$' sign.
Firstly I am the fault of most of my comments. I have been stuck in shell scripting for so many years and so many different jobs that Perl or Python etc have never been on my radar to learn. Also being stuck in this frame of mind I have become lazy in learning new things.
So I praise myself now for kicking my own ass to start new things. Its just the matter of sticking with it until it sinks in.
Secondly, I would say from my previous experiences is that.. if you dont use it regularly enough you will forget it. So do some over and over and all the time until you can do it with your eyes closed.
It made me learn my tables at school (2x1, 4x5) and I still can religously blurt them out (but I do tend to stand up at my desk with my hands behind my back saying them.. I need to get out that habit hehe!)
Anyway I have trashed the "learn in 24hrs" books. Started with the sites above and found a few more that go by "lesson 1, lesson 2.." and so on.
Wish me luck and thank you all for your help. I am sure I will be posting lots of weird and wonderful questions in the near future to you guru's!
Before learning perl I was doing most of the stuff with Shell Scripting
As i started getting familiar with Perl I started forgetting Shell Scripts. Now its difficult for me to write simple shell script, i have to google out for help. Even its a 3 line script I opt for Perl, and I can accomplish anything in Perl which is somewhat not possible with Shell Scripting due to its limitation.
Now I have a requirement to learn Java these days, oh man don't tell me its sucks big time.
I remember funny thing in Java, I made change in code and saved it and ran the program, which was throwing same output. Again I googled out, search few notes then later about 1 hr when I realize that I didn't compiled the new code
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.