learingperl01
MIS
Hello I have the code below which works for the most part, the only problem that I am trying to figure out is how to get rid of the CR (return) after the use of the $data[1] variable which is splitting my output from 1 line to 2 lines.
Thanks for the help in advance.
Code:
#!/usr/bin/perl
use strict;
use warnings;
open( FILE, $ARGV[0] ) || die "Cannot open file!";
while (<FILE>) {
my $entries = $_;
my @data = split(',', $entries);
print "000269 xrd $data[0], strchr $data[1], trdchr 0029\n";
}
---------------------------------------------------------------------------------------
output
000269 xrd 000101, strchr 001101
, trdchr 0029
000269 xrd 001122, strchr 0111001
, trdchr 0029
__________________________________________________
output should look like this
000269 xrd 000101, strchr 001101, trdchr 0029
000269 xrd 001122, strchr 0111001, trdchr 0029
Thanks for the help in advance.