#perl - Wed 9 May 2007 between 11:49 and 11:56



brianski:P
maukeno
brianski0 is for jerks :)
maukebrianski: reduce takes 3 arguments, conceptually
hareldvdSo is the constant SEEK_CUR available at all?
maukea folding function, a base value, and a list
hareldvd: did you read perldoc -f seek?
hareldvdmauke: Yep. I need an example cos I get errors.
maukeno, you need to understand the docs because you get errors
hareldvdmauke: I don't understand where the constant comes from.
jinkit appears out of thin air
maukeFor WHENCE you may use
the constants "SEEK_SET", "SEEK_CUR", and "SEEK_END" (start of the file, current position, end of the file) from the
Fcntl module.
hareldvdmauke: Sorry, I didn't find that.
mauke: A simple use?
mauke:(
brianskimauke, 3 arguments?
i see two - a function and an array?
actionCPAN upload: WebService-BuzzurlAPI-0.01 by HOLLY
CPANupload: WebService-BuzzurlAPI-0.01 by HOLLY
maukebrianski: no, you see N list elements
the first of which is a function and the second is the base value
brianskiperl pedantisms aside
maukethe remaining list elements form the virtual 3rd argument
sum(@x) = reduce {$a + $b} 0, @x; product(@x) = reduce {$a * $b} 1, @x;
brianskiuh sort of
oh
maukeconcat(@x) = reduce {$a . $b} "", @x;
brianskiyeah good call
hareldvdmauke: I did: use Fcntl; seek($XDM, -1 * $lineLen, SEEK_CUR); and got: Bareword "SEEK_CUR" not allowed while "strict subs" in use at kde_post_install line 83. Any idea?
brianskii thought you were talking about internal perl stuff
that said
maukehareldvd: yes. Fcntl doesn't export the SEEK_* constants by default
rindolfHi brianski
maukehareldvd: you need use Fcntl ":seek";
hareldvd: -1 * $lineLen better written as -$lineLen
anabaindoes this @array1 = {s///g} @array; make array1 with the substitutions performed on @array?
maukeanabain: no
anabainthen how?
hareldvdmauke: Yep Thanks.

Page: 5 12 19 26 33 40 47 54 61 68 75 82 89 96 103 

IrcArchive