This is off topic.. Your code looks really repetitive.
This is not a negative criticism- This is a suggestion- that there are ways of doing what you're doing in much more pleasant ways. It appears to me you code perl as you would code bash.. (?)..
For example in this chunk..
#Declaire all variables now!
my $customer_firstname; #Store the customers first name
my $customer_lastname; #Store the customers last name
my $customer_phone; #Store the customers main phone number
my $customer_email; #Store the customers email address
my $customer_date; #date that the entry was made
my $customer_AcceptTerm; #Accept Term of use?
my $customer_compman; #Store the computer manufaturer
my $customer_compmodel; #Store the computer model
my $customer_compModelNum; #Store the computer model number
my $customer_errormsg; #Store any and all error messages displaied
my $customer_os; #Store what OS is being used
my $customer_probdesc; #Store the problem description
my $customer_loginpw; #Store the password for the admin/root user
my $customer_service; #Store what services need to be done.
my $customer_barcode; #Store the barcode for the computer.
my $database = "Repairs"; #Specify the database to be used
my $hostname = "192.168.1.111"; #Connect to the MySQL server
my $port = '3306'; #MySQL port
my $user = 'csccrepairs'; #MySQL username
my $password = 'repairshop'; #MySQL password
my $dsn;
my $dbh;
You could do something like this maybe.. ( untested)
my @customer_attributes = qw/firs_tname last_name phone email date Acc
+ept_Term comp_man comp_model comp_Model_Num/;
my %customer;
@customer{@customer_attributes} =();
# Now you have %customer populated with the keys as undef...
require String::Prettify;
for my $att (@customer_attributes){
printf "%s: ", String::Prettify::prettify($att);
my $input = <STDIN>;
chomp($input);
$customer{$att} = $input;
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|