learnedax ([personal profile] learnedax) wrote2006-09-20 05:21 pm

(no subject)

I'm not the only one who's written perl* just to construct an LJ comment, right?

... right?

*or some similar lightweight script

[identity profile] herooftheage.livejournal.com 2006-09-20 09:49 pm (UTC)(link)

[identity profile] rufinia.livejournal.com 2006-09-20 09:50 pm (UTC)(link)
::raises eyebrow::

Probably not.

[identity profile] page-of-swords.livejournal.com 2006-09-20 10:11 pm (UTC)(link)
Not in the least, SSI's back to my box :)

[identity profile] metahacker.livejournal.com 2006-09-20 10:30 pm (UTC)(link)
print("I've written perl in comments for demonstration purposes, but that's about it.");

[identity profile] londo.livejournal.com 2006-09-21 12:55 am (UTC)(link)
I'm not sure how I feel about Perl being described as a "lightweight" language.
dsrtao: dsr as a LEGO minifig (Default)

[personal profile] dsrtao 2006-09-21 01:33 am (UTC)(link)
Perl can be written lightweight. Perl can be written heavyweight. You can write BASIC in Perl, C in Perl, and Lisp in Perl, only with some squiggly brackets as well as parens.

[identity profile] dglenn.livejournal.com 2006-09-21 01:38 am (UTC)(link)
Er ... I presume csh/tcsh counts; what about sed?

You can guess my answer based on my questions.

[identity profile] katkt.livejournal.com 2006-09-21 02:16 pm (UTC)(link)
This makes me curious what it is you wanted to say in an lj comment that required a programming language to construct. I don't usually find that the things I was to put in a comment are subject to simplification through coding.

This comment, for example, would just be much more complicated if I were to create it using perl. I suppose I might be able to do some sort of compression algorithm on it so that the code was shorter than the comment, but it would still take much longer to generate, because I'd have to figure out the algorithm, and I'd probably still have to type out this whole comment and feed it it.

I could see if you were giving some sort of formatted list or if you had some data you wanted to massage and then give to someone, but ... those aren't the sorts of things I frequently end up putting in LJ comments.

[identity profile] learnedax.livejournal.com 2006-09-21 02:21 pm (UTC)(link)
I had a list of N questions, which I wanted to quote interleaved with N unquoted responses, so I passed the initial list through a script to wrap every line in <em>XYZ</em>

[identity profile] hakamadare.livejournal.com 2006-09-21 04:47 pm (UTC)(link)

i write all my comments (and my posts, when i do post) in Markdown, and then use a Cocoa TextService to do the conversion right in my browser’s input field.

for trivial comments (one that do not strictly require any HTML markup) the process takes only a few seconds longer than it would take to just let LJ autoformat; for any comment that requires markup (emphasis, links, lists) the process is much quicker and less prone to error than writing the HTML by hand would be for me.

-steve

[identity profile] learnedax.livejournal.com 2006-09-21 06:24 pm (UTC)(link)
You know, that looks like a really useful set of tools, and I think I may start using them (at least when at home). In this one-off instance I would have used a script to pre-mark the stuff I was quoting anyway, but there are a lot of things Markdown would make easier.
jducoeur: (Default)

[personal profile] jducoeur 2006-09-25 05:41 pm (UTC)(link)
<ObLangSnobbery>I haven't, but probably would. But in Ruby, of course, rather than Perl...</ObLangSnobbery>

[identity profile] learnedax.livejournal.com 2006-09-25 07:15 pm (UTC)(link)
ObRetort: in superlightweight scripting, as in so many areas, Ruby remains the bastard stepchild of perl. But at least you can be glad that oneliners like
cat <file> | ruby -ne 'printf("%-6s%s", $., $_)'
(which as you can plainly see adds line numbers to a file) demonstrate the inherent cleanliness that Ruby lords over perl.