Howdy Monks, I need help with a tiny part of this code............. If you have input lines formatted like "x=y", write Perl code to swap all of them (for example, "y=x"). Fill in where commented in the code below
#!/usr/bin/perl
use strict;
use warnings;
my $filein = ....
my $fileout = ...;
open(INFILE, $filein) || die "Can’t open input ’$filename’: $!\n";
open(OUTFILE, "> fileout") || die "Can’t open output ’$filename’: $!\n
+";
while (my $input_line = <INFILE>) {
chomp($input_line);
my $output_line = '';
# FILL IN CODE HERE
print OUTFILE "$output_line\n";
}
Here is a sample input file:
Mary Smith = 345-78-9090
Joseph Alioto = 976-83-1234
Corresponding sample output file:
345-78-9090 = Mary Smith
976-83-1234 = Joseph Alioto
You also may assume that both field1 and field2 do NOT contain any "="s.