?

Log in

No account? Create an account

techie humor // life - Lograh — LiveJournal

Thursday, 27.May.2004

9:46 - techie humor // life

Previous Entry Share Flag Next Entry

"
This usage is vaguely deprecated, which means it just might possibly be removed in some distant future version of Perl, perhaps somewhere around the year 2168.
" -- perl operator referance

thanks to macklinr for slapping me upside the hed by saying "duh, use perl!" while I was lamenting my task of correlating the output data from our computer survey.

Comments:

[User Picture]
From:macklinr
Date:10:36 27.May.2004 (UTC)
(Link)
Regex is your friend and your god.
(Reply) (Thread)
[User Picture]
From:lograh
Date:10:42 27.May.2004 (UTC)
(Link)
oh fuck yes..

the snippet I'm working with, which does *almost* exactly what I need is:
if($line =~ /$_+\s*(.*$)/){print "$1\n";}

only problem is, I'd rather have all the output on the same line, with commas between the values. The regex part that has (.*$) captures up to, and including (here's where the problem lies) the CR character. So when I go to print them all in a row, they end up over-writing eachother..

I'm searching the docs for how to specify the CR character in a regex.
(Reply) (Parent) (Thread)
[User Picture]
From:urbeatle
Date:12:16 27.May.2004 (UTC)
(Link)
isn't it something like \x0D ??
(Reply) (Parent) (Thread)
[User Picture]
From:macklinr
Date:12:26 27.May.2004 (UTC)
(Link)
Yeah, that's the hex character form of it. It's also just \r (\n being the newline character, or \x0A).
(Reply) (Parent) (Thread)