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

Hello All, I am very new to perl scripting. Have not done anytime before. I need to write a script where in the script looks for a .txt file in a particular directory (say for eg : /TgtFiles directory). The script would update this variable value in a table. The same file in TgtFiles directory will be copied to some other directory as a source for a mapping. Could someone help me on this? Thanks, Priyanka

Replies are listed 'Best First'.
Re: copy and update through perl
by ww (Archbishop) on Sep 15, 2012 at 11:51 UTC
    PM is not a script writing service.

    If you've "not done anytime before" and you "need to write a script," you need to...

    • study Perl (perhaps an online tut; perhaps buy and read "Learning Perl") until you know at least enough to try to write your script
      or...
    • hire a programmer.

    Since we're here to help people learn, the first is an excellent option, unless you need the script yesterday (or "tomorrow")... in which case, you'd do well to check out the sites advertising programmers-for-hire.

Re: copy and update through perl
by prashantktyagi (Scribe) on Sep 15, 2012 at 10:35 UTC
    Please read Writeup Formatting Tips.
    You can read files in a directory like this ..
    @files = <path>; foreach $file (@files) { print $file . "\n"; if ( $file =~ /*\.txt/) { #add to table #copy file }
    Not tested
    Please search nodes before posting a query. copy files from one directory to another.

    The script would update this variable value in a table.
    which type of table (database ot text) ?