lainchan / λ

Perl5 General

if · 2017-11-24 07:51
This is the Perl5 General, ask any and all Perl5 questions here suprised there isn't one already >Docs are your friend: man perldoc OR http://perldoc.perl.org >Read the FAQ first: https://learn.perl.org/faq/ >To foster your discussion: Do you prefer using english like statements in your scripts? What do you like about Perl? How have you been using Perl? Is Perl your main programming language and do you use it in your job? What is your favorite Perl script? Is Perl superior to any other language if so in what way? Do you use the online version of perldocs or the offline one and why? What do you think about Perl6? What editor do you use while programming in Perl? Challenge: Try to rewrite one of your scripts to make it as short as possible omitting ()'s, using english like syntax...
SHODAN · 2017-12-11 19:44
>>5232 >suprised there isn't one already You shouldn't be, perl has fallen out of fashion and for most people it's just "hur line noise", regrettably. That said I prefer it over python/ruby/js and use it as my goto scripting language.
Von Neumann · 2017-12-11 20:20
>>5232 >What do you like about Perl? It's great for text-processing. First-class regexes and no-overhead variable interpolation make for short scripts that are fairly readable and do the right thing. >Do you use the online version of perldocs or the offline one and why? A little bit of both. I still have a hard time navigating perldoc, so if I really need to dig in to the docs I'll definitely prefer the website. >>5583 Perl was my go-to scripting language for a while, until I learned Ruby. What advantages do you see in Perl over the other popular interpreted dynamic langs?
Technician · 2017-12-11 20:54
>>5585 >What advantages do you see in Perl over the other popular interpreted dynamic langs? Well for one, most popular scripting languages are focused on a signle domain(i.e. ruby and js on the web) and the community/libraries for everything else is lacking. The one exception is python, which is pretty powerfull and versatile. Ive used python quite a bit as well and when it comes to choosing between it and perl, its mostly subjective reasons which i can further explain if you're interested. That said, some objective advantages perl has: CPAN TIMTOWTDI fluid syntax perldoc and POD robust/trustworthy due to its age widely used although not advertised larry is a cool guy, in a weird way
Erik Johansson · 2017-12-11 21:29
>>5585 Also some tips for perldoc: >perldoc -f "function_name" (searches perlfunc) >perldoc -q "question" (searches in FAQ) >perldoc "Mode::Name" (see doc for module) These are the basic and what you will mostly need aside from perldoc perl or perldoc "section"
藤原純一 · 2017-12-12 12:10
>Do you prefer using english like statements in your scripts? Nah, just normal code. >What do you like about Perl? It's flexible. The ways classes and objects are built are very bare bones and extendable and it's a principle the goes throughout the language. I can add new syntax etc with just one use and it allows basically everything (roles, aspects etc) out the box. >How have you been using Perl? More than 10 years >Is Perl your main programming language and do you use it in your job? I don't really have a main language but I think I do more perl than anything else. It's just usually the easiest choice for me. >What is your favorite Perl script? Acme::Eyedrops >Is Perl superior to any other language if so in what way? It is superior to python because it has {}. I just don't really like the whitespace matters stuff. All languages embody the Tao though (but don't use COBOL if you can avoid it). >Do you use the online version of perldocs or the offline one and why? Online usually though that's mostly because I'll get there from a web search. >What do you think about Perl6? Nice spec. Parrot was ambitious but they didn't really pull it off. When there's a fast implementation I might switch. >What editor do you use while programming in Perl? Vim or geany depending.
Ein · 2017-12-15 22:32
>>5587 >its mostly subjective reasons which i can further explain if you're interested I certainly am! >That said, some objective advantages I would argue that some of these are rather subjective: >CPAN CPAN is the grand daddy of library repositories, but to me it seems to be falling behind in terms of content and ease of use. Does there exist a reliable, easy-to-use local dependency manager for Perl projects? Actually curious because while Python's virtualenvs and npm's node_modules work great and were very intuitive to me, I had trouble understanding the correct way of setting up a Makefile.PL. Any good solutions for this problem these days? >TIMTOWTD This is a double edged sword, hence why I think this is subjective rather than objective. If you become familiar with PEP8, every part of every mature Python code base should be readable to you, and when starting a larger project yourself, you won't need to waste any time setting out style guidelines. With that beeing said, TIMTOWTDI definitely makes programming in Perl subjectively fun. >fluid syntax Not exactly sure what you mean, but this also sounds more subj- than objective. >perldoc and POD perldoc is definitely great. Unfortunately POD isn't used widely enough outside of Perl, so I haven't really had a good enough to reason to invest the time in getting a good grasp of it. And now that I'm done playing the devil's advocate, here's an awesome Perl talk that shows a real epitomy of TIMTOWTDI: https://www.youtube.com/watch?v=ob6YHpcXmTg.
Lady 3Jane.. · 2017-12-29 01:09
>>5695 Re-reading the points you mention I will admit you are right about my opinion spilling into them. That said let me address some of them: >CPAN You are right that CPAN might not be superior to solutions of other languages(I can't say for sure), but it still stands as an advantage for perl. About your question I might not be able to help you much, but if I understood correctly, you can take a look at cpanm, perlbrew or the various virtualenv modules. >fluid syntax What I meant here, was that perls versatility allows for code to be structured naturally in order to be understood more fluidly/better. For example: open my $in, "<", $file or die This seems, at least to me, very intuitive and allows the programmer to bring the main focus to the front. On the rest I agree with you. >its mostly subjective reasons which i can further explain if you're interested For starters I like that more often than not function is preferred over form and that the perl community still seems to align with hacker culture. Also I like that the syntax is terse and unixy, which allows me to easily replace shell scripts with perl scripts. TIMTWTDI, which as you mentioned above, makes programming perl fun and learning new ways to do things you already knew how to do is always fun. Mostly little things that you can live without but are nice to have