Live data from Hacker News

The Perl Jam: Exploiting a 20 Year-old Vulnerability [pdf]

events.ccc.de

41–44 of 44 posts

Re: The Perl Jam: Exploiting a 20 Year-old Vulnerability [pdf]

#41
post #29

Hi guys, Netanel Rubin here. First of, I'm not a Pythonist. Python has nothing to do with the faults of Perl - Perl does. Perl was a great language back at the 90's and early 2000 - it doesn't now. That is mainly because of the 'write-only' code style and many not-that-intuitive behaviors other languages practice better. It is true that my talk was based on bad programming practices, but that's the practices actually…

Excellent, you're here so i (we) can address a couple of the points in your talk. 1) DBI is not a core module, nor to my knowledge has it ever been. 2) I'm the current maintainer of CGI.pm - i am not the author. This is an important point because the module is 20 years old, and like any software of significant size/age/importance it has been through several different hands (over 30 according to the git log, which onl…

> A couple of other examples of critical bugs that were revealed in 2014: shellshock and heartbleed. Should we dismiss bash, C, etc, as terrible languages because of these?

Yes.

Re: The Perl Jam: Exploiting a 20 Year-old Vulnerability [pdf]

#42
post #9
post #4

When he explains how Perl handles an array passed as an argument to a function: my @list = ('b', 'c'); test('a', @list, 'd'); Which ends up flatting the @list array into the argument list and printing 'a', 'b', 'c' , most Perl programmers defend the language saying that the author just doesn't understand Perl, and that's how things are done in the language since forever. The response is basically a RTFM. If you reall…

As an ex Perl guy (well I still use it sometimes), I find append and extend an endless source of confusion in Python. Especially as strings do the opposite of what I expect, and get treated as character arrays with extend (or was it append). I like the way that in Perl you have to explicitly reference the array, as this leaves no ambiguity about what is happening. I guess its just what I am used to.

"As an ex Perl guy (well I still use it sometimes), I find append and extend an endless source of confusion in Python. Especially as strings do the opposite of what I expect, and get treated as character arrays with extend (or was it append)."

list.extend(data) works like "for item in data: list.append(item)"

strings (str) do not behave differently than a list or a set. Try .append() on a list or a set, you get the same behaviour.

Maybe your confusion comes from the fact that strings are immutable in Python, and a list is not a string.

You may like bytearray() in Python 2 (bytearray.append raises an error if you pass a string longer than 1 character), but there is not mutable type for Unicode strings.

Re: The Perl Jam: Exploiting a 20 Year-old Vulnerability [pdf]

#43
post #42
post #9

Earlier quoted context omitted.

As an ex Perl guy (well I still use it sometimes), I find append and extend an endless source of confusion in Python. Especially as strings do the opposite of what I expect, and get treated as character arrays with extend (or was it append). I like the way that in Perl you have to explicitly reference the array, as this leaves no ambiguity about what is happening. I guess its just what I am used to.

"As an ex Perl guy (well I still use it sometimes), I find append and extend an endless source of confusion in Python. Especially as strings do the opposite of what I expect, and get treated as character arrays with extend (or was it append)." list.extend(data) works like "for item in data: list.append(item)" strings (str) do not behave differently than a list or a set. Try .append() on a list or a set, you get the s…

Yes but I would expect my strings to behave as a scalar variable, not a list or set.

I prefer the Perl way of having one function push, and specifically referencing the list if you want it stored that way. That has caused me far less confusion in Perl than the Python way of doing things.

Re: The Perl Jam: Exploiting a 20 Year-old Vulnerability [pdf]

#44
post #40
post #28

Earlier quoted context omitted.

> list expansion behavior in function calls is a problem most programmers weren't aware of. Actually, what lists do in list context is one thing every Perl programmer knows. You cannot go too far without it in Perl.

Most Python programmers switching to Perl an assuming it works the same way is probably true though :P

Rather than switching to perl, most python programmers i know always badmouthing perl
Post reply on HN