I would use Term::Interact like so
#!/usr/bin/perl -- use strict; use warnings; use Data::Dumper; use Term::Interact; print Dumper( prompt_customer() ); sub prompt_customer { my %customer; my $ti = Term::Interact->new; $customer{firstname} = $ti->get( msg => "\nComputer Information\n-----------------------\n", prompt => "Customer First Name: ", check => [ qr/^\w+$/, ], ); $customer{lastname} = $ti->get( msg => "", prompt => "Customer Last Name: ", check => [ qr/^\w+$/, ], ); $customer{phone} = $ti->get( msg => "", prompt => "Customer Phone #: ", check => [ qr/^[\d\s\-\,]+$/, ], ); $customer{email} = $ti->get( msg => "", prompt => "Customer Email: ", check => [ qr/^\S+$/, ], ); $customer{compman} = $ti->get( msg => "\nComputer Information\n-----------------------\n", prompt => "Computer Manufacturer: ", ); $customer{compmodel} = $ti->get( msg => "", prompt => "Computer Model: ", ); $customer{compModelNum} = $ti->get( msg => "", prompt => "Computer Model #: ", ); $customer{errormsg} = $ti->get( msg => "", prompt => "Error Message (if any): ", ); $customer{os} = $ti->get( msg => "", prompt => "Operating System: ", ); $customer{probdesc} = $ti->get( msg => "", prompt => "Problem Description: ", ); $customer{loginpw} = $ti->get( ReadMode => 2, msg => "", prompt => "Administrator/Root Login Password: ", ); $customer{service} = $ti->get( msg => "", prompt => "Computer Service Needed: ", ); $customer{barcode} = $ti->get( msg => "", prompt => "Barcode Number: ", ); $customer{date} = scalar localtime; print "\n"; return \%customer; } __END__ ### for testing, COPY/PASTE when prompted first last 444 444 444 asdf@email.com manu mode 33 err os prob rootpass compserv barcode ## sample session Computer Information ----------------------- Customer First Name: first Customer Last Name: last Customer Phone #: 444 444 444 Customer Email: asdf@email.com Computer Information ----------------------- Computer Manufacturer: manu Computer Model: mode Computer Model #: 33 Error Message (if any): err Operating System: os Problem Description: prob Administrator/Root Login Password: Computer Service Needed: compserv Barcode Number: barcode $VAR1 = { 'probdesc' => 'prob', 'firstname' => 'first', 'date' => 'Tue Sep 22 12:44:24 2009', 'barcode' => 'barcode', 'lastname' => 'last', 'service' => 'compserv', 'phone' => '444 444 444', 'os' => 'os', 'email' => 'asdf@email.com', 'loginpw' => 'rootpass', 'errormsg' => 'err', 'compModelNum' => '33', 'compman' => 'manu', 'compmodel' => 'mode' };

In reply to Re: DBD::mysql trouble by Anonymous Monk
in thread DBD::mysql trouble by vendion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.