Hello, I noticed a strange problem in my app and I have dumbed it down as much as I can to help me figure out what's wrong, but I can't!! Help!
Simply, I pass each line of a text file this function, here:The file I am passing it from is here:sub sup09 { my $sup09 = "09"; my $nobloc = $config->{NoBlockCI}; my $trans_date = ×tamp; my $return_date = ×tamp; my $AP = $config->{AP}; my $AO = $config->{AO}; my $AB = "AB".$_[0]; my $AC = $config->{AC}; my $seq = "AY0"; my $message = $sup09.$nobloc.$trans_date.$return_date.$AP.$arnold. +$AO.$arnold.$AB.$arnold.$AC.$arnold.$seq; my $checksum = &Checksum($message); my $sup09string = $message.$checksum; if($logging == 1) { &logging($sup09string); } return $sup09string;
use strict; use warnings; use IO::Socket::INET; require "functions.pm"; our $socket = new IO::Socket::INET ( PeerAddr => '127.0.0.1', PeerPort => 16001, TimeOut => "10", Proto => 'tcp', ) or die "There is no connection to the SUPPY Server..........\n"; my $itemfile = 'inumlist.txt'; #my $send; open (FILE,$itemfile) or die "Cannot file file"; while (<FILE>) { my $print = sup09($_); print "$print"; };
So far, all very simple. The trouble is the function returns the $sup09string with a line break in it and I can't figure out how or why. If I pass a static string to the function (not from the files being read) the function returns the string as one
Can anyone see how silly I am!!!
In reply to Function Oddity by packetstormer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |