Tony -- ...and then Akens, Anthony said... % % I wrote the following quick'n'dirty script that converts % a plain text file (with a little custom markup)
I'm curious... Your custom markup looks an awful lot like HTML already. Why not just write in HTML? Are you converting existing documents that are already in this format for some other parser? ... % % Here's the script - feel free to offer comments on it, % as well. Always good to hear constructive criticism. I feel the same way. And I'm happy to help :-) % ... % The conventions I'm using in the text document are: % [title]my_title[/title] % [link]my_docname[name]my_linkname[/name] Since you have "special" characters in your markup, ... ... % s/\[\/title\]/<\/c>/; % s/\[link\]/<a href=\"file\:\/\/\/help\//; ... you end up with a backslash festival like this. You can take care of some of them by changing your expression character so that you write something like s@...@file://...@ and no long have to escape the /s but that doesn't help for everything. You should look into compiling your regexps so that you list them literally and do away with the escaping entirely. Um, I think that's qr@expr@repl@ but I'm not sure. ... Yes, that looks like it; have a look at perldoc perlop and jump down to the "Quote and Quote-Like Operators" section (though, of course, you should read the whole thing from top to bottom :-) HTH & HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg28298/pgp00000.pgp
Description: PGP signature