I thought I would show you all the conclusion I came up
with thanks to your help. I used the solution to
getting my variables originally posted by Turo, not
my min/max as I had it. But here is the program in full.

#!c:\perl\bin use warnings; use strict; my $lotNumber; my $productName; my $Info; my $choice; my $printLocal; my $printEcho; my $ftpobj; my $ftp; &MAIN; sub MAIN { print "Please make sure that you have all labels added into labellist. +txt\nin the correct format.\n\nLot number then a tab and then Product + Name for each line\n\nEXAMPLE\:\nE1234567\t2RZ563DA\nE2345678\t2RZ12 +8CA\nE3456789\t2RS128BB\n\n\n"; print " 1\: East QPS\n 2\: East TC\n 3\: West Etest\n 4\: West TC\n 5\ +: Quit\n What is your choice? "; $choice = <STDIN>; chomp ($choice); if ($choice==1) { $printLocal="10\.10\.10\.10"; $printEcho="East QPS Label Printer"; } elsif ($choice==2) { $printLocal="10\.10\.10\.11"; $printEcho="East TC Label Printer"; } elsif ($choice==3) { $printLocal="10\.10\.10\.12"; $printEcho="West TC Label Printer"; } elsif ($choice==4) { $printLocal="10\.10\.10\.13"; $printEcho="West Etest Label Printer"; } elsif ($choice==5) { system "CLS"; print "MultiPrint Has Shut Down."; exit 0; } else { system "CLS"; print "You have chosen an invalid Number, Please try again\n\ +n"; &MAIN; } print "Backing up old test.txt... \n"; rename ("Labels.txt", "test.bac") || die "Cannot rename Labels.txt +: $!"; open (LABELS, "labellist.txt") or die "I could not get at labellist.tx +t as input"; open (OUTPUT, ">>Labels.txt") or die "I could not get at Labels.txt as + ouput"; my %info; while (<LABELS>) { my $printCode = ""; my ($lotNumber,$productName) = m/(\S+)\s+(\S+)/; $info{$lotNumber} = $productName; # print "$lotNumber\n"; # print "$productName\n"; print OUTPUT "\^XA\^LH30,30\n\^FO110,65\^A0,N,100\^FD$lotNumbe +r\^FS\n\^FO150,160\^BY2,3.0\^B3N,N,125,N,N\^FD$lotNumber\^FS\n\^FO75, +375\^A0,N,50,30\^FD$productName\^FS\n\^FO30,425\^BY2,2.0\^B3N,N,50,N, +N\^FD$productName\^FS\n\^XZ\n"; } close LABELS; close OUTPUT; } print "You have chosen to print Labels.txt to the $printEcho ($printLo +cal).\n\n Sending to printer now.\n\n"; use Net::FTP; $ftpobj = Net::FTP -> new("$printLocal", Debug => 0) or die "Cannot connect to some.host.name: $@"; $ftpobj -> login("user","") or die "Cannot login ", $ftp->message; $ftpobj -> put ("Labels.txt") or die "put failed ", $ftp->message; $ftpobj -> quit; print `CLS`; &MAIN;
This gives them a menu option that asks where they want it
to be printed, then once they chose it is all good.
It has been tested to work and print the labels
as wanted. Once again, THANK YOU ALL!


Of course all confidential info has been changed to
protect my company :)

In reply to Re^3: Parse data from a line to get 2 variables by Sunnmann
in thread Parse data from a line to get 2 variables by Sunnmann

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.