#perl - Wed 4 Apr 2007 between 07:52 and 08:10

NY Lost Funds



ZoffixThe bits represent certain data that one of the clients has. 1 == have, 0 == don't have. Other client will later ask "do you have a piece with index $index" and I will need to look up if I do or not.,
Yeah, I see that I need only one hash.. that's true.
encryptiodeparse: 1 and 1 or 1
buubot1;
encryptiodeparse: $a and $b or $c
buubot(($a and $b) or $c);
whoeverdeparse: 1&2|4&8^7
buubot7;
receptori have declared constants at the beginning, but then i get Bareword "SOMETHING" not allowed while "strict subs" in use
what's that?
annoreceptor: missing quotes, usually
receptoror better, how do i use those constants properly inside a package's sub
Astuse constant is bad practice
receptorwhy bad?
Asttry SOMETHING{}
In Damians Book it is one of the first non-nos mentioned "Best Practices"
it's becaise you don't know if its a method, a scalar, an array, a hash
receptoractually i was looking for some substitute of c'ish #define
Astjust say INIT { $SOMETHING = 'NOTHING'; 1; }
much more readable
set the "constatnts in the INIT (or BEGIN) clause)
receptordefine SOMETHING = "foo" is the most readable for me...
Astexcuse my bad typing
receptorwhat do you use daily?
instead of define?
AstINIT { $pi = 3.141596; }
and use vars qw($pi) tomark it as global
Botje_Ast: damian's word is not scripture.
anno...and "use vars" is on the verge of being deprecated
actionanno uses the occasional constant
annouses the occasional constant
receptoranno: if not 'use vars' then what?
annoour()
AstBotje: of course not, but I must say I like most of his best practices
the book makes you think about code, maybe it will take some of the air out of the "line noise" myth Perl has too
receptorINIT { $pi = 3.141596; } - Global symbol $pi requires explicit package name
buuOk what the fuck
Ast: No it doesn't =[
Botje_Math is hard!
buuYeah.
askie_1 + 1 = 3

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 

IrcArchive

NY Lost Funds