473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Edit Record In Perl

Hello Everyone!

New member here and I have posted code below. The question is how do I go about editing on one screen not on several as it is being done in the code below which is a subroutine part of a larger script:

Expand|Select|Wrap|Line Numbers
  1.  
  2. sub editcar {
  3.  
  4. Title "Edit A Car";
  5.  
  6. print("==============\n\n");
  7. print("| MAKE: |\n\n");
  8. print("           ==============\n\n\n\n\n\n\n\n\n\n\n\n");
  9.  
  10. my $origMake = <STDIN>;
  11. $origMake = <STDIN> until defined $origMake;
  12. chomp $origMake;
  13. cls();
  14.  
  15. print("================\n\n");
  16. print("| MODEL: |\n\n");
  17. print("                             ================\n\n\n\n\n\n\n\n\n\n\n\n");
  18.  
  19. my $origModel = <STDIN>;
  20. $origModel = <STDIN> until defined $origModel;
  21. chomp $origModel;
  22. cls();
  23.  
  24. print("                          ==================================\n\n");
  25. print("| YEAR : |\n\n");
  26. print("                          ==================================\n\n\n\n\n\n\n\n\n\n\n\n");
  27.  
  28. my $origYear = <STDIN>;
  29. $origYear = <STDIN> until defined $origYear;
  30. chomp $origYear;
  31. cls();
  32.  
  33. print("                          =============================\n\n");
  34. print("| NEW OWNER: |\n\n");
  35. print("                          =============================\n\n\n\n\n\n\n\n\n\n\n\n");
  36.  
  37. my $newOwner = <STDIN>;
  38. $newOwner = <STDIN> until defined $newOwner;
  39. chomp $newOwner;
  40. cls();
  41.  
  42. my $file = "cardata.txt";       
  43.  
  44. local $^I = ".bak";
  45. local @ARGV = ($file);
  46. while (<>) {
  47. chomp;
  48. my ($Make,$Model,$Year,$Owner) = split(/\:/);
  49. if (($Make eq $origMake) && ($Model == $origModel)) {
  50. print "$Make:$Model:$Year:$newOwner\n";
  51. }
  52. else {
  53. print "$_\n";
  54. }
  55. }
  56. unlink("$file.bak");
  57.  
  58. print("\n\n\n\n\n\n\n\n");    
  59. print("CAR UPDATED SUCCESSFULLY!!\n\n\n\n\n\n\n\n\n\n\n\n");
  60.  
  61. } # END UPDATE CAR
  62.  
  63.  
What I would like is to Enter the Owner on one screen and the next screen would list the cars owned by the owner and then highlight/select a car and the next screen would be the edit screen. Thanks for the help!
Oct 25 '14 #1
2 1413
Hello,

I'll even be willing to pay someone for a working example of what I am in need of...thanks.
Oct 29 '14 #2
Better use a database table.
Nov 20 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: huzz | last post by:
I have a record in edit the mode inside a repeater (single record), and a update button outside the repeater when i click on the button to update the database i can't access the dropdown list...
1
by: Kamal Ahmed | last post by:
Hi All, I have a datagrid that contains multiple records. I want to edit any record in grid and then Update or Cancel same record. What is short & easy way to do so. TIA.
0
by: subrahmanyaam | last post by:
Hi Guys - I am new to vb.net. I just created a form where I can add records and every record has an customer_ID number Now I want to edit a record using the cust_ID Number, how should I do it, Can u...
1
by: alex.gruenther | last post by:
I am new to Access and need help creating an edit record form. I've got a table called Player with attributes like name, address, phone, etc. I've created an edit player form with a combo box...
1
by: shapper | last post by:
Hello, In have a web page layout with various panels. One panel contains a GridView and other panel contains various TextBox, DropDownList, etc. When I click a a GridView row I make visible...
0
by: AYasser | last post by:
Hi All, I am new to oracle 10g and i am facing the problem of not finding how to edit a record in a table, like using the "table data editor" in oracle 8,9i through the DBA studio. can anyone help...
1
by: sebtus | last post by:
I have the following code to edit an existing record. If DCount("ID", "AssignLoc", " = '" & Me.ID & "'") > 0 Then Set db = CurrentDb Set rs = db.OpenRecordset("AssignLoc") ...
8
by: PAuser | last post by:
Greetings, I`m having a curious situation in MS Access 2003 while editing records in a cross table query. Tables are: Table1 (field1_1, field1_2, field1_3) Table2 (field2_1, field2_2,...
1
by: ladyjbean | last post by:
I have been searching for a way to solve my problem for the last few days and have yet to find an answer. Hoping someone here can help. Some background: I am building a db that tracks various...
0
by: jagdishgore | last post by:
redio buttons values fetching from table to edit record or update records, cmd.Parameters.AddWithValue("@user_receive_mails", c); cmd.Parameters.AddWithValue("@user_receive_calls", d);...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.