cool.. In get_customer() your customer id is being put into $dbh. As you assign directly to $dbh you don't need it in that first line, so..
change: sub get_customer { my ($dbh, $customer_id) = @_; $dbh = WebDB::connect (); ... to: sub get_customer { my ($customer_id) = @_; my $dbh = WebDB::connect ();
Now you really want to keep the subs separate, so instead of calling get_customer from print_results we get_customer, then send the customer details to print results..
if ($choice eq "submit") # customer submitted order number { get_customer (); print_results (); } else ... becomes: if ($choice eq "submit") # customer submitted order number { my $cutomer = get_customer($customer_id); print_results($customer); } else ...
Then we change print_results to accept the customer details as an argument
sub print_results { my $customer = get_customer($customer_id); ... becomes: sub print_results { my $customer = @_;
cheers,
J
In reply to Re: Re: Re: Re: Re: No results from script
by edoc
in thread No results from script
by b310
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |