Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
|
---|
Replies are listed 'Best First'. | |
---|---|
(Ovid - stop asking if you don't want answers) Re: problems editing a flat-file
by Ovid (Cardinal) on Jul 18, 2001 at 00:34 UTC | |
Hello, deriwana. Why, pray tell, dost thou post anonymously? Could it because this is virtually the same problem that you had before? Could it be because numerous monks tried to answer your questions but you don't care to listen? We also tried to help you when you asked earlier. Oh, and here's another time you asked this same question. This post, therefore, is at least the fourth time that you have asked for help, but ignored the answers. Why is this? Cheers, Hmm... I seem to be particularly testy today :( Vote for paco! Join the Perlmonks Setiathome Group or just click on the the link and check out our stats. | [reply] [Watch: Dir/Any] |
| |
| |
Re: problems editing a flat-file
by Albannach (Monsignor) on Jul 17, 2001 at 23:38 UTC | |
In your foreach $guest loop your split is not acting on $guest as you have mis-placed your brackets. Because of this, you never find the matching record that you want to change, and so your file is never any different after execution. Warnings would have caught this problem. -- | [reply] [Watch: Dir/Any] [d/l] [select] |
Re: problems editing a flat-file
by aijin (Monk) on Jul 17, 2001 at 23:56 UTC | |
First off, your formatting is very difficult to read. You should indent the code like this. Example:
It makes it much easier to check that all your braces line up. Secondly, you're not sending $query to the valid_code subroutine, or any of the other subroutines that require that information to work properly. Thirdly, you don't need to put the code in your first if statement into an eval statement. My guess is that you're never getting to the part of your code that updates the records. There are a lot of things you need to do to get this script working. If you'd like, msg me, and I'd be happy to guide you in the right direction. -aijin | [reply] [Watch: Dir/Any] [d/l] [select] |
(ichimunki) Re: problems editing a flat-file
by ichimunki (Priest) on Jul 18, 2001 at 01:57 UTC | |
You should probably consider using the wonderful CGI functions that make HTML happen for you (your code becomes a lot more readable as a Perl script when you do this). This would also allow you to do away with print_start_page and print_page_end. The sub valid_form does not appear to be properly closed-- although you have an extra } hanging off the end of the script, which will close it in order to prevent compiler warnings. As others have noted, your indentation style is a little obscure-- I suggest finding an editor (see Outside Links) that will automatically assist you in this. I use emacs on both Linux and Windows and find it to be an excellent cross-platform tool. Finally, my personal preference would be to replace &subroutine with subroutine() for subroutine calls and to consistently parenthesize all function calls for readability: push( @my_array, $my_new_value );. YMMV. | [reply] [Watch: Dir/Any] [d/l] [select] |
Re: problems editing a flat-file
by buckaduck (Chaplain) on Jul 18, 2001 at 23:34 UTC | |
At a guess, I wonder if you're having trouble accessing the file /cgi-bin/data/igb-data.ais On most web servers, the cgi-bin directory is not in the server's root directory (even though you might think so from the URL). So perhaps the file you're looking for is really: $WWW_HOME/cgi-bin/data/igb-data.ais If this is the case, you'd see it as an error message when you try to open the file. If you ever checked for the error messages, that is... buckaduck | [reply] [Watch: Dir/Any] [d/l] [select] |
Re: problems editing a flat-file | my input to your effort
by andr321 (Initiate) on Apr 29, 2008 at 06:20 UTC | |
It is not a solution, but a tool. Change your file name like this: must go away. This is where you have an outpout with no data in the "Modify Records." Create andre1.txt or any file with your fields names and your delimiter you chose: Gray Hair |hair@yahoo.com| Wisdom of old man Try it. It may delete your file when you click submit, but play with it. That is your first bullet to see something on the screem. Let me know what you come up with. Anre is my name. I will hear from you in this post. I have no idea on your retrieve.pl but if it works fine, it should serve well instead of andre1.txt and my output on the screen. Submit destroy it, but you may continue from there. There is a +'; that I put on coment for you too. I am not a programer in perl, I know nothing,but I love to learn and to be around the learners and the experts. Here your full code here. copy it and paste it and do : http://127.0.0.1/cgi-bin/data1/data2.pl It should give you a better result.
| [reply] [Watch: Dir/Any] [d/l] [select] |