LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-20-2018, 04:43 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344

Quote:
Originally Posted by L4Z3R View Post
BTW, which is easier to learn perl or python?
Yes, we have perl 5 and perl 6 and python 2 and python 3. If you want to use the full power of these languages you need to learn a lot. Not only about regexp, but other constructs, language elements too.
Theoretically one of them is enough, because you can do anything you want (yes, with anyone of them), but they are quite different. If you are interested you can try both (perl and python).
 
Old 01-20-2018, 08:28 AM   #17
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by Turbocapitalist View Post
I also suspect, but don't fully have the skill to assess, that perl has been put together better from a CS standpoint.
I've started using perl recently for a small project at work; one thing I keep banging into is the refs vs value thing. IMO, this is pretty big wart in the data model. That plus the auto-conversion to string all over the place gives the feeling it's not well put together at all.

Python avoids those problems, but it misses a variable declaration syntax (you have to use assignment instead) which results in some weirdness around scoping of variables. I think a newbie is less likely to run into that than the the perl problems though.
 
Old 01-20-2018, 08:59 AM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
Quote:
Originally Posted by ntubski View Post
I've started using perl recently for a small project at work; one thing I keep banging into is the refs vs value thing. IMO, this is pretty big wart in the data model. That plus the auto-conversion to string all over the place gives the feeling it's not well put together at all.

Python avoids those problems, but it misses a variable declaration syntax (you have to use assignment instead) which results in some weirdness around scoping of variables. I think a newbie is less likely to run into that than the the perl problems though.
Both (perl and python) are relatively complex and you will not be able to write good code without understanding how it works. perl is coming from the c/awk/shell world, so you will better understand if you knew c already (for example). Python will have definitely different issues, but again if you want to make really efficient code you need to know all of their whims.

probably you need to check a book like perl best practices: http://shop.oreilly.com/product/9780596001735.do (or something similar).
perl tutorials: https://learn.perl.org/tutorials/ (this is free)

or for python: https://www.learnpython.org/
 
Old 01-20-2018, 03:04 PM   #19
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by ntubski View Post
I've started using perl recently for a small project at work; one thing I keep banging into is the refs vs value thing. IMO, this is pretty big wart in the data model. That plus the auto-conversion to string all over the place gives the feeling it's not well put together at all.
When in doubt use Data::Dumper module

Last edited by keefaz; 01-20-2018 at 03:07 PM. Reason: Disable smilies in text
 
Old 01-21-2018, 10:45 PM   #20
L4Z3R
Member
 
Registered: Jan 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
I think I will concentrate on learning more about regex. I was watching some tutorials on perl and python and as always the basics are easy but it gets more complex as you progress into the lessons.

Thanks everyone
 
Old 01-22-2018, 01:00 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,033

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
a good help to check regexp: https://regex101.com/
 
1 members found this post helpful.
Old 01-22-2018, 01:51 AM   #22
L4Z3R
Member
 
Registered: Jan 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
a good help to check regexp: https://regex101.com/
Thanks pan64. I just bookmarked it.
 
  


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] Remove numbers, spaces, line breaks & paragraphs from .txt on CLI rokyo Linux - Newbie 3 08-14-2017 09:20 AM
[SOLVED] append lines to specific line numbers socalheel Programming 1 07-07-2014 05:01 PM
[SOLVED] remove similar (not identical) lines of text steve51184 Linux - Software 5 04-24-2012 11:45 PM
Using diff to compare file with common lines, but at different line numbers jimieee Linux - Newbie 3 05-10-2004 07:26 AM
remove identical lines in a file benjithegreat98 Linux - General 4 04-24-2004 06:12 AM

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

All times are GMT -5. The time now is 03:05 PM.

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