Earlier quoted context omitted.
Ruby even uses some predefined globals (eg $_) that are pretty much straight out of Perl. http://www.tutorialspoint.com/ruby/ruby_predefined_variables...
Ruby even uses some predefined globals (eg $_) that are pretty much straight out of Perl. They exist, and while I'm a fan of $: over $LOAD_PATH I don't think I've even seen $_ used in the wild.
Why Perl?
61–70 of 118 posts
Re: Why Perl?
#62This is my view on Perl after coding occasionally with it for 2-3 years. For the last 6+ months i've been coding Perl 8 hours per day. In general i'd consider myself at least average in those languages (meaning this list includes my favorite language(s) and ones that i came across for projects and never looked back): C, C++, Java, Javascript, Python, Groovy, Visual Basic, C#, PHP. To be honest i don't agree at all (a…
> i can't say i love the language at all
That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's.
>> often can find the core developers in charge of some code
> i browsed a lot through CPAN and a huge part of modules hasn't been touched for years
What you said has nothing to do with what you quoted. CPAN allows you to email those authors and the vast majority will reply happily. And even in cases where they don't, it's easy to go on irc.perl.org and ask around in #perl.
> the IRC channels i know are more idle then other languages
You're not in the right channels. Try irc.perl.org or #perl on freenode.
> it's really untrue to say "there is nothing like it"
It is perfectly true. See this post for elaboration: http://hackerne.ws/item?id=3238662
> often enough i think "mhh, should i even use this module? Nobody seems to care about this anymore"
Did you try asking around? Look for alternatives? Often that is because the remaining bugs are no dealbreakers (license nitpicks anyone?) or the modules have been determined to be crap (XML::Simple).
> But it tries to solve a problem that shouldn't be there in the first place.
I fully agree, but quite frankly, if you view this as a downside of Perl then you're just plain being short-sighted. The problem was created over a decade ago, at the conception of Perl 5; yet it is comfortably fixable without even changing core. And additionally, there is active work on fixing this issue in core:
https://github.com/stevan/p5-mop
> Want to have exceptions in Perl? Turns out the language doesn't have them.
Valid complaint. Exception::Class is a good tool for this, but i'd also like to have them in core. So far there has been no concensus on how to do it properly though without breaking backwards compatibility.
> The number one google hit
Google's search results for Perl are terrible and do not reflect the state of the community. Try searching for exception on CPAN itself.
> Perl thinks it's ok when you read an uninitialized variable. Want the script to terminate when this happens?
`use warnings FATAL => 'all';`
> Want to know if an element is in an array?
`my @hits = grep { $_ eq 'dogfood' } @array;`
Alternatively:
`use List::Util 'first'; my $has_dogfood = first { $_ eq 'dogfood' } @array;`
And this is in core.
> Unicode Support is horrible
I'll have to post this twice because you're so wrong:
http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/ms...
> My fun fact on Perl:
{{citation}}
> When your script/tool exceeds 100 lines of code, don't use Perl! Atleast not if there is the remote possibility of another human being having to understand or maintain it. Please!
Well how nice to show at the end at least that you're a troll.
Re: Why Perl?
#63Earlier quoted context omitted.
Honestly, the only point there that applies to any language is the "freedom" one. The rest are, with varying margins, real differentiators. Especially the CPAN ecosystem one. No other language has that.
Having worked on real-world projects in Perl, Python and Ruby, I can tell you that CPAN is not a differentiator. It doesn't matter if there are gazillions of packages to choose from. What matters is if I can find the packages I need to do the job. I remember working on a Perl project and being mocked by a Python guy because I had to implement a library that was already available for Python. On the other hand, I could…
Re: Why Perl?
#64A few years ago I did a lot of Perl work. Since I do interactive multimedia, I wanted to try my hand at game programming (Frozen Bubble is written in Perl, it couldn't be that hard, right?). At the time, however, the only graphics libraries were extremely limited, which forced me to work in different languages. Recently, a new awesome SDL library has been created: http://sdl.perl.org/ that actually supports drawing l…
Perl isn't easy to learn because it's difficult to become familiar with it. However, I found it enjoyable to work with. It's certainly a little quirky but for a dynamic language it is also quite malleable. My example is Moose: Perl didn't ship with an OO system but is flexible enough that Perl6's object model could be back ported. Don't like Moose? There are others. Or you could just use straight blessed hashes (which Python, Ruby, and others just put syntactic sugar around).
For a dynamic language it's pretty nice. But I don't think it's going to be winning many converts these days. The tower of babel had fallen long ago and people are starting to pick up the pieces again. Languages that stray too far from the squishy middle of collective wisdom, I fear, are likely to relegate themselves to history.
That being said, Perl does have an excellent community. And I really like reading Perl books. They're really fun where too many are either dry or over-compensating in quirkiness. Perhaps its those unixy origins that still pull me to it.
Re: Why Perl?
#65$str =~ s/([a-z])/$myFunc->($1)/ge;
Re: Why Perl?
#66This is my view on Perl after coding occasionally with it for 2-3 years. For the last 6+ months i've been coding Perl 8 hours per day. In general i'd consider myself at least average in those languages (meaning this list includes my favorite language(s) and ones that i came across for projects and never looked back): C, C++, Java, Javascript, Python, Groovy, Visual Basic, C#, PHP. To be honest i don't agree at all (a…
Perl has more extensive Unicode support than Javascript, PHP, Go, Ruby, Python, or Java. That alone disqualifies it from being "horrible". See http://98.245.80.27/tcpc/OSCON2011/gbu.pdf
> Want to have exceptions in Perl? Turns out the language doesn't have them.. There are modules.. all of them do some black magic trying to emulate this. The number one google hit (Error.pm) even states "Using the "Error" module is no longer recommended due to the black-magical nature of its syntactic sugar, which often tends to break.". And this is not some fancy 2011 language feature, it still isn't built in!
Exceptions are built in:
eval {
....code...
die("foo"); # throw exception
}
if ( $@ ) {
....this is exception handler...
}
The modules of which you speak aren't there to try to add exception handling. What they are trying to do is make it look like the exception handling from other languages (e.g., adding new keywords, changing the way scoping works, and such to match some other language).> Want to know if an element is in an array? There are some hideous for loops you could do, but nothing like "if X in Y".. best thing: Most recommended way to do this is to convert your array to a hash/dictionary and check for the key.. that's basic array handling.
Yes, Perl assumes that you did not sleep through "Introduction to Data Structures". If the operation of "find out of collection X contains element Y" is one that you need to do often and/or need to be more efficient than linear search, you should not be using an array.
Re: Why Perl?
#67Anyone using Perl 6? What is your experience? Is it mature enough for serious use or should we stay with Perl 5? This article http://perlgeek.de/en/article/5-to-6 shows a glimps of the features of Perl 6.
Stay with Perl 5.
Re: Why Perl?
#68Perl is my first choice go-to language, but I'm not finding the CPAN advantage as big as it used to be. Increasingly I'm having to use languages I don't prefer (not out of any hostility, just not as comfortable in them) because they have libraries that CPAN either doesn't include, or doesn't include with the same polish/functionality. For example, there doesn't seem to be anything in the Perl world as good as the Pyt…
I haven't found anything that makes GIS easy.
Re: Why Perl?
#69Earlier quoted context omitted.
This is the language that doesn't have proper function arguments, exceptions, objects, etc, and you're calling OTHER languages a subset? Sorry, I just don't see it. What exactly is so awesome in Perl that isn't easily done in Python/Ruby/Scala/D/Haskell?
> proper function arguments my ($a, $b, $c) = @_; # this works Or I can do things like my ($first, @rest) = @_; giving me features which require all manner of annoying syntax in Python. > exceptions http://search.cpan.org/~nilsonsfj/Error-TryCatch-0.07/lib/Er... or just eval and see what the output is. > objects Edit: I was being an asshole Perl has a decent object system out of the box and Moose for those times when…
def foo(first, *rest):
vs sub foo{
my ($first, @rest) = @_;
?Re: Why Perl?
#70The great downfall of Perl is that it's slow: http://shootout.alioth.debian.org/u64/which-programming-lang... 60X slower than C. 30X slower than Java If sed/awk/grep/sort/tr is not up the task, sure, try Perl for those one offs. For serious computation? Fuggedit.
> The great downfall of Perl is that it's slow: What about Perl6 and LLVM? My personal experience with Perl5: - It has incomparable expressiveness. Only APL is more expressive. But more expressiveness makes source code less readable. - Perl's regexp engine is the best - no doubt about it. - I would never use Perl for big projects. Its odd syntax ($, sometimes %,... before variable names etc.) is terrible for long ter…
No Perl 6 implementation is mature enough to use for practical purposes.
LLVM probably won't help Perl 5, because Perl 5 lacks sufficient type information, and because LLVM's design really seems to want static languages. See also the JVM and the CLR.
Its odd syntax ... is terrible for long term maintainability.
I would never attempt to maintain code written in a language I don't know.