claudiu25cm has asked for the wisdom of the Perl Monks concerning the following question:

My question is more of a cry for help or somewhat of a challenge to you though perl guys. Im not much for talk so i'll get to the point. I need to write a utility that would help me a lot at work and im not good enough to do it. Consequently i thought that maybe some of you guys might consider it a challenge and help me with it. I am familiar with thw language itself but seeing a working program that can do what i need would help me improve my own skills. So what i need is a program that can organize and facilitate working with a database. The files in the database are regular .txt and in a format like the one below example:

Line1
copy1 : 10.01.2008 10.12.2007
copy2 : 10.02.2008 20.12.2007

Line2
copy1 : 10.01.2008 10.12.2007
copy2 : 10.02.2008 20.12.2007

and so forth
these are different lines of mutated flies (i work in experimental genetics)
The software i need would have to be able to:
-open different .txt files that are in a specific location
-be able to append new dates to each copy
-be able to append a warning flag to a certain line and show all flagged lines on command.
If anyone would be able to do this for me i would much appreciate it. I probably wont use it as such but rather as
 a template to modify a bit to my needs and build on it
 some more so please keep it not too complex. A GUI for it
 would be awesome but not required since im totally crap at that.
 thnx and sorry for the bad formatting

Replies are listed 'Best First'.
Re: writing an organiser in perl
by lamp (Chaplain) on Sep 13, 2008 at 17:13 UTC
    Please note that this site is neither script writing site nor a homework solution site. Please go though Perlmonks FAQ for more information.

    For opening a .txt file and appending a content, please go through perlfunc:open.

    For making a GUI you can go through CGI

      I can see by your nick that you may have a different world view than many of us, however a browser UI would not generally be called a GUI. In Perl the most often used GUI tool is likely to be Tk.


      Perl reduces RSI - it saves typing

        I personally believe that while I would have agreed with you for years, as of late I've been seing web-based apps become more and more similar to "regular" GUIs, and more and more offered as controlling interfaces for other programs, that I'm not sure the distiction has the right to stay so neat any more...

        One wild idea could be to use XUL as a framework, and indeed it may be not that wild after all, if you count the number of hits out of a simple cpan search: what's more, now that I notice, there's a module called XUL::Node which seems to be just about implementing this very idea!

        --
        If you can't understand the incipit, then please check the IPB Campaign.
Re: writing an organiser in perl
by apl (Monsignor) on Sep 14, 2008 at 14:23 UTC
    How much does this pay? Or are you asking for our consulting rates? 8-)
Re: writing an organiser in perl
by Anonymous Monk on Sep 14, 2008 at 09:42 UTC
    What you're asking for is about as complex as this type of stuff gets (after that you just repeat a thousand times).

    Don't know enough about genetics, but Bio::Tk::HitDisplay looks like a starting point

        I personally believe that if you had registered instead of posting as an anonymonk, then you wouldn't have needed to post a followup to your own reply. Had you registered, instead of replying I would have /msg'd you to point out that instead of hardcoding the link to the module like [http://search.cpan.org/~birney/bioperl-gui-0.7/Bio/Tk/HitDisplay.pm|Bio::Tk::HitDisplay], you may have used the Monastery's special shortcut [mod://Bio::Tk::HitDisplay] which renders like Bio::Tk::HitDisplay.

        --
        If you can't understand the incipit, then please check the IPB Campaign.
Re: writing an organiser in perl
by blazar (Canon) on Sep 14, 2008 at 13:54 UTC
    I am familiar with thw language itself but seeing a working program that can do what i need would help me improve my own skills.

    (Additional emphasis by me!)

    I personally believe that your requirements below would tend to make it hard to believe you actually are...

    open different .txt files that are in a specific location

    perldoc -f open

    be able to append new dates to each copy

    Ditto as above, then perldoc -f print, or if really needed, perldoc -f printf

    be able to append a warning flag to a certain line and show all flagged lines on command.

    On a certain line based on what? Line number? Some criterion?

    --
    If you can't understand the incipit, then please check the IPB Campaign.
Re: writing an organiser in perl
by claudiu25cm (Initiate) on Sep 15, 2008 at 14:33 UTC
    im sorry of i didnt read the faq before posting, i was under the impression that this was a help and information sharing site, and this is the kind of help i need. ive gone through a few tutorials, and i do know how to open files, write to files, ifs, fors, regexes etc. What im having trouble with is putting it all together to do exactly what i need. I will eventually get it done on my own but having an example to use as a backbone might speed things up for me. sorry if i offended your awesomeness by asking something.
      PerlMonks can, indeed, be considered a "help and information sharing site", but you need to make some effort to show what you have tried and explain how your attempt(s) do not meet your expectations. I think you will find that the folks here are willing to help you with code that you post. But you keep asking for examples of code that meets a vaguely stated set of requirements and asking for code that you can use.

      May I suggest the following line of attack:

      • First read your private /msgs. You can see them (among other places) at the top of the ChatterBox nodelet. According to blazar's note in Re^5: writing an organiser in perl you have a /msg asking you to fix some formatting in your original node.
      • Create a small data file (10 lines or so) that is representative of the data that you need to process.
      • Write some code that uses this small data file as input and creates (or attempts to create) the output you want.
      • If your code does not produce the output you want, post the code and the sample data with a clear explanation of how your expectations are not being met.

      If you can do that, chances are that you will get some help. There are, of course, no guarantees of that, but your chances will be much improved over your current approach.