#perl - Wed 2 May 2007 between 15:19 and 15:44



BinGOshttp://perldoc.perl.org/
gr00bercuz' 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! :)
gr00berhm
BinGOsit was an illustrative example
JBond2is that a way to write a regular expression do: replace each occurrence of & to & unless amp; or lt; or gt; is following that &.
gr00beri'm amped!
BinGOsright. These lawns will not mow themselves unfortunately.
actionBinGOs &
BinGOs&
JmaxJBond2: HTML::Entities
gr00beris there an equivalent to str.trim() ?
i.e remove whitespaces (including \n) before and after the string?
preaction$str =~ s/^\s+|\s+$//g;
gr00berpreaction, 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)
preactionperldoc -f chomp
cyrillicwow, i just learned about the spaceship operator. that's definitely going into every script i write
dazjorz<=> right?
actiondazjorz can't really remember what it's for
dazjorzcan't really remember what it's for
preactionsorting, returns 1, 0, or -1 based on comparing the two operands
rindolfdazjorz: it gives -1 on < 0 on == and 1 on >
devdassorting
dazjorzAh, right
devdaswhat they said
dazjorzI see
BayRootgr00ber: do you have to store in an array? why not just concatinate into a var?
rindolfdevdas: are you an op?
devdasno
gr00berBayRoot, yes, there file has a list of settings
rindolfdevdas: I see.
gr00berand I would like to traverse it as an array
one setting per line
BayRootchomp is probably the most efficient
tybalt89chomp(@array = <INPUT>);
gr00berexcellent
last question for now: do i use regex substition to uppercase a string, or is there a function?
SubStackuc
gr00berah
SubStacksimilarly, there's lc
gr00beri see, thanks

Page: 3 10 17 24 31 38 45 52 59 66 

IrcArchive