| Zoffix | The 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. |
| encryptio | deparse: 1 and 1 or 1 |
| buubot | 1; |
| encryptio | deparse: $a and $b or $c |
| buubot | (($a and $b) or $c); |
| whoever | deparse: 1&2|4&8^7 |
| buubot | 7; |
| receptor | i have declared constants at the beginning, but then i get Bareword "SOMETHING" not allowed while "strict subs" in use what's that? |
| anno | receptor: missing quotes, usually |
| receptor | or better, how do i use those constants properly inside a package's sub |
| Ast | use constant is bad practice |
| receptor | why bad? |
| Ast | try 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 |
| receptor | actually i was looking for some substitute of c'ish #define |
| Ast | just say INIT { $SOMETHING = 'NOTHING'; 1; } much more readable set the "constatnts in the INIT (or BEGIN) clause) |
| receptor | define SOMETHING = "foo" is the most readable for me... |
| Ast | excuse my bad typing |
| receptor | what do you use daily? instead of define? |
| Ast | INIT { $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 |
| action | anno uses the occasional constant |
| anno | uses the occasional constant |
| receptor | anno: if not 'use vars' then what? |
| anno | our() |
| Ast | Botje: 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 |
| receptor | INIT { $pi = 3.141596; } - Global symbol $pi requires explicit package name |
| buu | Ok what the fuck Ast: No it doesn't =[ |
| Botje_ | Math is hard! |
| buu | Yeah. |
| askie_ | 1 + 1 = 3 |