Good Morning Esteemed Monks!
What I would like is a pure perl solution in splitting the screen as shown in the code below. Top of the screen shows all the information and at the bottom of the screen is where new values can be entered. I would like the top screen to be shown all the time and the bottom screen changes for each input that needs to be changed. In this case the only value that needs changed is Owner. Thanks in advance.

#!/usr/bin/perl use strict; use warnings; use diagnostics; use Win32::Console::ANSI; use Win32::Console; use Term::ANSIColor; use Term::ANSIScreen qw/:cursor :screen/; ################### # # TEST ONLY # ################### Title "Edit Car"; open(MYINPUTFILE, "cardata.txt"); # open for input $| = 1; my @lines = <MYINPUTFILE>; # read file into list close (MYINPUTFILE); printf ("|VERIFY CAR OWNER|\n\n"); my $carownerverify = <STDIN>; $carownerverify = <STDIN> until defined $carownerverify; chomp($carownerverify); cls(); printf ("| OWNER | MAKE | MODEL | YEAR |\n\n"); my $found = 0; foreach my $carownerverify2 (@lines) { my @field = split(':',$carownerverify2); if ($field[0] =~ /(?<![\w-])$carownerverify(?![\w-])/i) { my $format = " %-13s %-15s %-11s %0s\n"; printf ($format, $field[0], $field[1], $field[2], $field[3]); $found =1; } } # END FILE LOOP ######################################### # # THE ABOVE STAYS ON TOP OF THE SCREEN # THE BELOW IS WHAT CHANGES # ######################################### print("| OWNER: |\n\n"); my $origOwner = <STDIN>; $origOwner = <STDIN> until defined $origOwner; chomp $origOwner; cls(); print("| NEW OWNER: |\n\n"); my $newOwner = <STDIN>; $newOwner = <STDIN> until defined $newOwner; chomp $newOwner; cls(); my $file = "cardata.txt"; local $^I = ".bak"; local @ARGV = ($file); while (<>) { chomp; my ($Owner,$Make,$Model,$Year) = split(/\:/); if ($Owner eq $origOwner) { print "$Owner:$Make:$Model:$Year:$newOwner\n"; } else { print "$_\n"; } } unlink("$file.bak"); #close $file; print("CAR UPDATED SUCCESSFULLY!!\n\n"); sleep 10;

In reply to Pure Perl Split Screen by PilotinControl

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.