LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-21-2009, 06:54 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Rep: Reputation: 36
Am I having a PERL mental block???


Hey all..

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
 
Old 05-21-2009, 07:09 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
Old 05-21-2009, 08:12 AM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by fusion1275 View Post
I have been told if you know your way around shell programming Perl should be the next step and more beneficial.
See here
 
Old 05-21-2009, 11:10 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by fusion1275 View Post
...
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".
 
Old 05-21-2009, 12:07 PM   #5
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
The problem with Perl it's hard to remember all syntax technicalities.
 
Old 05-21-2009, 04:39 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Alien_Hominid View Post
The problem with Perl it's hard to remember all syntax technicalities.
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.
 
Old 05-21-2009, 06:18 PM   #7
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
Quote:
Originally Posted by Sergei Steshenko View Post
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.
 
Old 05-21-2009, 06:38 PM   #8
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Telemachos View Post
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.


But, anyway, syntaxes can be learned.
 
Old 05-21-2009, 07:29 PM   #9
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by Sergei Steshenko View Post
I can say the same thing about Python
if its about syntax technicalities, Python syntax is more readable than Perl's. Period.
 
Old 05-22-2009, 12:54 AM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ghostdog74 View Post
if its about syntax technicalities, Python syntax is more readable than Perl's. Period.
Never laughed that much - especially seeing programs written by bad programmers.
 
Old 05-22-2009, 05:54 AM   #11
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Original Poster
Rep: Reputation: 36
I think you are ALL correct in your statements...

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!

So hope to speak to you all soon.
 
Old 05-22-2009, 06:12 AM   #12
abs_77
LQ Newbie
 
Registered: Feb 2007
Location: India, Bombay
Distribution: Linux & BSD
Posts: 23

Rep: Reputation: 15
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

Last edited by abs_77; 05-22-2009 at 06:45 AM.
 
Old 05-22-2009, 02:51 PM   #13
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by fusion1275 View Post
...
I am sure I will be posting lots of weird and wonderful questions in the near future to you guru's!

So hope to speak to you all soon.
In the culture I come from they say that properly/correctly asked question is half or more the answer.

So, ask your question properly, and you'll get knowledge - maybe even ahead of answers from other people.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mental blip causes deletion of /var esteeven Linux - General 5 01-04-2023 05:58 AM
LXer: Has Microsoft gone mental? LXer Syndicated Linux News 11 05-10-2009 10:42 AM
Driving me mental!!!!!! STATIC ROUTES hvc123 Linux - Networking 6 01-15-2009 02:20 PM
Complete Mental Block on MySQL and PHP Pirate96 Programming 5 05-18-2007 01:33 PM
Going mental here!!! n00dles Linux - General 2 10-18-2002 12:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration