| BinGOs | http://perldoc.perl.org/ |
| gr00ber | cuz' i figure removing an item from an array while traversing it might not be a good thing |
| BinGOs | @ignorelist = grep { # $_ doesn't match criteria here } @ignorelist; |
| Ani-_ | But BinGOs, that's a syntax error! :) |
| gr00ber | hm |
| BinGOs | it was an illustrative example |
| JBond2 | is that a way to write a regular expression do: replace each occurrence of & to & unless amp; or lt; or gt; is following that &. |
| gr00ber | i'm amped! |
| BinGOs | right. These lawns will not mow themselves unfortunately. |
| action | BinGOs & |
| BinGOs | & |
| Jmax | JBond2: HTML::Entities |
| gr00ber | is there an equivalent to str.trim() ? i.e remove whitespaces (including \n) before and after the string? |
| preaction | $str =~ s/^\s+|\s+$//g; |
| gr00ber | preaction, thanks. Maybe there's a better way to read lines into an array though (I used @array = <INPUT>, but then each string has a trailing newline) |
| preaction | perldoc -f chomp |
| cyrillic | wow, i just learned about the spaceship operator. that's definitely going into every script i write |
| dazjorz | <=> right? |
| action | dazjorz can't really remember what it's for |
| dazjorz | can't really remember what it's for |
| preaction | sorting, returns 1, 0, or -1 based on comparing the two operands |
| rindolf | dazjorz: it gives -1 on < 0 on == and 1 on > |
| devdas | sorting |
| dazjorz | Ah, right |
| devdas | what they said |
| dazjorz | I see |
| BayRoot | gr00ber: do you have to store in an array? why not just concatinate into a var? |
| rindolf | devdas: are you an op? |
| devdas | no |
| gr00ber | BayRoot, yes, there file has a list of settings |
| rindolf | devdas: I see. |
| gr00ber | and I would like to traverse it as an array one setting per line |
| BayRoot | chomp is probably the most efficient |
| tybalt89 | chomp(@array = <INPUT>); |
| gr00ber | excellent last question for now: do i use regex substition to uppercase a string, or is there a function? |
| SubStack | uc |
| gr00ber | ah |
| SubStack | similarly, there's lc |
| gr00ber | i see, thanks |