If you have programmed before (in another language) then you should know it's possible, and you might've well thought of reading the file and changing that what should be changed and writing it back.
If you're new to programming, I suggest you go read some books and play around with Perl and the examples from the book. You can't expect to be able to make a program that a company will use if you have little programming experience - the resulting program will most probably be unreliable, and perhaps even insecure.
There's all sorts of other things that come into play here:
E.g. if it's a CGI program, it might be run multiple times simultaneously, and multiple instances might try to write to the same file before other instances are finished (race condition). You'll need to research 'file locking' (flock) if it's a CGI script.
If it's a(n interactive) program meant to be run by only one user, you won't need file locking.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.