------------------------------------------------ On Mon, 24 Mar 2003 18:52:24 +0000, "mel awaisi" <[EMAIL PROTECTED]> wrote:
> Hi, > > The problem has been highlighted to me by a great person in this list, but i > just cant solve it. > > I have this script that is not working as it should be. this is what it is > supposed to be doing, take images from a directory (images are coming from > camera) and renames them with the date and time of image. then insert some > meta information into MySQL. what the script is supposed to be doing is to > always keep looking and whenever it finds images to perform the change and > insert. the output is as follow: it only does the process once. > > i would appreciate any help. > Did you try what I suggested? It does not appear so as your output has not changed. One of the keys to learning to program is not only in writing the initial code, but also in debugging that code when it does not do what you want, or at least you don't think it does, I realize you are under a deadline (we all are) but you need to put forth the effort in debugging the script and heeding the advice others provide before asking for further help. Now on to the problem.... > > while (-e "$lockfile") { > process($check_file) if (-r "$original_dir/$check_file.$suffix"); > infoinsert(); > sleep 30; > } In the above code you first call the 'process' sub with the file argument, this sub then passes that information through to the 'infoinsert' sub, which expects an argument and receives it the first time. Then after 'process' returns you call 'infoinsert' again (which is presumably the bug) with no argument, which causes your script to die. If you had added the print statement to the top of 'infoinsert' like I suggested you would have seen that it was called twice and should have realized this isn't what you wanted... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]