"...HTMLArea will give them too much power to potentially screw up the page..."

Well, don't let them change the ENTIRE PAGE! :) Just the smallest amount necessary. Now then, if they need to able to change, say, some text that is located inside a table, well, first off the WYSIWYG editor will allow them to add rows and so forth, but secondly, maybe you should determine all the fields that your user can change and provide a standard form so they can only change the values, not the presentation.

And yes, HTMLArea really only works well on Windows boxes, but 99% of the users "out there" have Windows. The latest versions of Firebird and Mozilla will render HTMLArea V3.0, but i have had intermittent results with those browsers on Linux boxes - some work and some don't. But remember that you don't have to run IIS or anything like that to get HTMLArea to work. It is a client side technology, and surely your user has a Windows box available. (I actually had a client that only used Macs, and thus i had to provide a file upload alternative).

As for the last question ... i would rather read in the file, display it for the user somehow, and then write the entire file back out instead of using in-place editting. Having to fork and exec another shell to the Perl interpreter should be avoided when it can.

Best of luck to you! :)

UPDATE:
Here is a quicky script that might help you out. As long as you can set the permissions for the store file (i named it CONTENT with no extension for no real reason) you should be good to go. I used CGI.pm, mainly because it is readily available and it handles HTML entity escaping for you.

#!/usr/bin/perl -T use strict; use warnings; use CGI qw(:standard); print header,start_html('mini cms'); if (param('content')) { open FILE,'>','CONTENT' or error("Can't write content file: $!"); print FILE param('content'); close FILE; } open FILE,'<','CONTENT' or error("Can't read content file: $!"); my $content = do{local $/; <FILE>}; close FILE; print start_form, textarea(content => $content, 10,50),br, submit, end_form, div({id=>'content'},$content), ; sub error { print pre(shift),end_html; exit; }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to 5Re: Converting FILEHANDLE to string by jeffa
in thread Converting FILEHANDLE to string by joev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.