Bugzilla Talk:Languages: Difference between revisions

Jump to navigation Jump to search
Line 40: Line 40:
**** There is no reason for it not to work under mod_perl, that question makes me think you don't understand how mod_perl works - ajt
**** There is no reason for it not to work under mod_perl, that question makes me think you don't understand how mod_perl works - ajt
**** Private methods aren't really required in Perl very often at all.
**** Private methods aren't really required in Perl very often at all.
** qq[] is a string (as is qq{}, etc.), q[] is a string, though qw() is an array.
*** they each do different things, it's not rocket science - ajt
** &sub() is resolved at runtime but sub() is resolved at compile time, ''except'' for methods.
**** sorry, I don't see a problem here - Perl is dynamic - you can create methods and functions post compilation, how do you propose to resolve them at compile time without the Tardis?
** The conversions from one type to another can sometimes be horrendous to read. Eg: [keys %{ @{ $var } }].
***  ITYM [ keys %{@$var} ], compare that to dereferencing in C or C++.
** $$foo[1] and $foo->[1] mean the same thing.
*** so only use the latter, it's clearer
** That numbers are compared with "==" but strings are compared with "eq", even though in other places strings are interpreted as numbers if used numerically.
*** that's because humans use numbers as numbers sometimes and words at others - Perl reflects actual use, and this has never been a problem for me - it allows you to compare and sort correctly based on your needs/
** Figuring out what's $1, $2, $3, etc. from a regex result. And the fact that $1 and $2 don't get reset if there's no match.
*** Perl 5.10 will have named captures.
*** figuring out $1, etc is trivial
** That Perl errors are in $@ but system errors are in $!, and when to use which one.
*** $@ is set by eval, which is called by the developer, and used for capturing  or trapping fatal and other serious errors, $! is set by normal code, they do different things that's why they are different.
** That Perl doesn't really have a class system, it just has a package system with @ISA or "use base," "bless," and SUPER::.
*** FUD. It does have a class system, it's not pure, you don't like it, I do, I also like C++ class system, they are different, and that is good.
** That "my ($var) = @_" will get you the first item of the array, but "my $var = @_" will get you a number.
*** yes. learn about context. it's not rocket science - anybody finding this hard would have a terrible time with a strictly typed language.
** In array context, $cgi->param('value') returns an ''empty list'' if "value" wasn't passed to the CGI. It doesn't return undef. This is why we have "scalar $cgi->param()" all over the code.
*** Sorry, poor programming in your code not perl.


== On Python cons ==
== On Python cons ==
21

edits

Navigation menu