I am trying to get perl to read in a bunch of info from the user and format it, to print it out on screen like this:

+--------------------------------------------------------------+ | Check No. $chkno | | $first $last | | $addr[0] | | $addr[1] | | $phone $date | | | | Pay to the | | Order of: $payee $amount | | | | For: $memo Stamped Signature | | | +--------------------------------------------------------------+

I keep running into errors and I am not sure what's wrong. The address is supposed to be stored in an @array[0] and @array1 (first for house number and street, second for city, state, zip).

Take a look at my code and see if you can help me out.

#!/usr/bin/env perl use warnings; use strict; print "Please enter the check number: "; chomp (my $chkno = <STDIN>); print "Please enter your first and last name: "; chomp (my $first = <STDIN>); chomp (my $last = <STDIN>); print "Please enter your house number (or PO box) and street name: "; chomp (my $one =<STDIN>); print "Please enter your city, state, and zipcode: "; chomp (my $two = <STDIN>); my @addr = {$one, $two}; print "Please enter your phone number: "; chomp (my $phone = (<STDIN>)); print "Please enter the date: "; chomp (my $date = <STDIN>); print "Please enter the payee's name: "; chomp (my $payee = <STDIN>); print "Please enter the amount to be paid: "; chomp (my $amount = <STDIN>); print "Please enter a memo for the check: "; chomp (my $memo = <STDIN>); format CHECK = +--------------------------------------------------------------+ | Check No. @##### | $chkno, | @<<<<<<<<< @||||||||||||||| | $first, $last, | @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | $addr[0], | @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | $addr[1], | @<<<<<<<<<< @|||||||||||||||||| | $phone, $date, | | | Pay to the | | Order of: @|||||||||||||||||||||||||||| @#####.## | $payee, $amount, | | | For: @<<<<<<<<<<<<<<< Stamped Signature | $memo | | +--------------------------------------------------------------+ . write (CHECK);

In reply to Formatting and write help by negzero7

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.