Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In perl preferably. Thanks. Part 1. Write a program that takes a text file as an

ID: 3734695 • Letter: I

Question

In perl preferably. Thanks.

Part 1. Write a program that takes a text file as an input (as a command line argument). The program should print out the total number of lines, words, and characters in the text file, and the content in the reverse order, both in terms of lines and in terns of characters in each and every line. 10 ptsl Note: Except the new line character, everyother type of characters should be counted. Sample input and output $ cat input21.txt Q1.1. List Operators Write a program that takes a text file as an input. perl q3.pl.pl input21.txt lines: 2, worda: 14, characters: 72 reversed: tupni na sa elif txet a sekat taht margorp a etirw srotarep0 tail. .1.1q

Explanation / Answer

#!/usr/bin/perl
   use strict;
    use warnings;
   open my $fh, '<', $ARGV[0];
   my @file = <$fh>;
   close $fh;

   foreach my $line (reverse @file) {
   my $revLine = reverse $line;
   print $revLine;
   }
   print " ";