| AnAnt | I am trying to do a multiline replacement in perl using s/// operator, can someone help ? I tried @arr = s/line1 match expression line2 match expression/replacement/ |
| shigetsu | AnAnt, did you try the /s modifier? |
| AnAnt | but that did not work shigetsu: yup shigetsu: is what I am doing right ? |
| shigetsu | paste the code at http://sial.org/pbot/perl also, consider using quotemeta. |
| AnAnt | shigetsu: does that site run java ? |
| zamolxes | AnAnt: http://perldoc.perl.org/perlretut.html#More-on-characters%2c-strings%2c-and-character-classes read this |
| shorten | zamolxes's url is at http://xrl.us/u9bn |
| AnAnt | shigetsu: does that site use java script ? |
| shigetsu | sial.org? |
| AnAnt | shigetsu: yeah |
| shigetsu | why do you want to know? |
| AnAnt | shigetsu: to know if I should use elinks or not |
| shigetsu | ehm, it's a stupid form. no more or less AFAICT. but I may be wrong. |
| pasteling | "AnAnt" at 62.114.91.55 pasted "multiline substitute" (3 lines, 71B) at http://sial.org/pbot/23402 |
| shigetsu | AnAnt, I have no idea about the input data. Provide the entire script. |
| zamolxes | AnAnt: have you read the link I gave you? |
| shigetsu | AnAnt, you should be using $1$2 instead of \1\2. |
| AnAnt | zamolxes: looking at it |
| zamolxes | and ARGH don't parse html with regexps use a CPAN module for that |
| shigetsu | and you could use s{}{} instead of s///. this will allow you to not escape slashes. zamolxes, ++. |
| pasteling | "AnAnt" at 62.114.91.55 pasted "multiline substitute" (22 lines, 673B) at http://sial.org/pbot/23403 |
| AnAnt | shigetsu: escape slashes ? |
| shigetsu | what's your question? |
| AnAnt | zamolxes: I'm trying to avoid using modules |
| shigetsu | not another one. |
| AnAnt | shigetsu: you said: "allow you to not escape slashes" shigetsu: not another what ? |
| shigetsu | do you want to know what a slash is? and are you using windows? |
| zamolxes | AnAnt: what benefit would that bring? Other than bugs and unmaintainable code already written and tested by somebody else |
| AnAnt | shigetsu: a slash is \ shigetsu: no, I use linux |
| shigetsu | \ is a backslash, whereas / is a slash. |