| brianski | :P |
| mauke | no |
| brianski | 0 is for jerks :) |
| mauke | brianski: reduce takes 3 arguments, conceptually |
| hareldvd | So is the constant SEEK_CUR available at all? |
| mauke | a folding function, a base value, and a list hareldvd: did you read perldoc -f seek? |
| hareldvd | mauke: Yep. I need an example cos I get errors. |
| mauke | no, you need to understand the docs because you get errors |
| hareldvd | mauke: I don't understand where the constant comes from. |
| jink | it appears out of thin air |
| mauke | For 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. |
| hareldvd | mauke: Sorry, I didn't find that. mauke: A simple use? |
| mauke | :( |
| brianski | mauke, 3 arguments? i see two - a function and an array? |
| action | CPAN upload: WebService-BuzzurlAPI-0.01 by HOLLY |
| CPAN | upload: WebService-BuzzurlAPI-0.01 by HOLLY |
| mauke | brianski: no, you see N list elements the first of which is a function and the second is the base value |
| brianski | perl pedantisms aside |
| mauke | the remaining list elements form the virtual 3rd argument sum(@x) = reduce {$a + $b} 0, @x; product(@x) = reduce {$a * $b} 1, @x; |
| brianski | uh sort of oh |
| mauke | concat(@x) = reduce {$a . $b} "", @x; |
| brianski | yeah good call |
| hareldvd | mauke: 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? |
| brianski | i thought you were talking about internal perl stuff that said |
| mauke | hareldvd: yes. Fcntl doesn't export the SEEK_* constants by default |
| rindolf | Hi brianski |
| mauke | hareldvd: you need use Fcntl ":seek"; hareldvd: -1 * $lineLen better written as -$lineLen |
| anabain | does this @array1 = {s///g} @array; make array1 with the substitutions performed on @array? |
| mauke | anabain: no |
| anabain | then how? |
| hareldvd | mauke: Yep Thanks. |