Create a separate perl scripts


Discuss the below:

Create a separate Perl scripts for each of the given requirements. Mentioned input data files are below. In each case command to run the script from the command line should look like:

COMMAND_PROMPT> script_number.pl input_data_file.txt

[1] A script script_1.pl that replaces each instance of "th" with "TH" in file part1.txt. The script should print the file to the screen, not just the replaced lines.

[2] A script script_2.pl to look for lines in the file part2.txt containing a period, question mark, or comma at the end of the line. When these lines are found, print only the part of the line that occurs after the word "it" (case insensitive).

[3] A script script_3.pl that prints only words (not the entire line) in the file part3.txt on a word boundary that have the letter "p" or "P" in them (i.e. words begin/end with P/p).

1. BIG BLUE LOOKED TO BIG RED -- IBM received great publicity when its  Deep Blue chess machine beat the world chess champion, Gary Kasparov. Deep Blue is a supercomputer that runs on the IBM AIX version of the  UNIX system. After the computer won the second game of the match, the head of the IBM team introduced to the audience his consultant and the creator of UNIX, Lucent's legendary Dennis Ritchie. The audience gave  Ritchie a standing ovation. Maybe Bell Labs should get its deserved share of publicity in this man vs. machine hyperbole.  -- Alex Lubashevsky, Warren, N.J. (Lucent Today 5/13/97)

2. Tim created the Module List in August 1994 and maintained it manually till  April 1996. By that time Andreas had implemented the Perl Authors Upload  Server (PAUSE) and it was happily feeding modules through to the CPAN archive sites. Since PAUSE held a database of module information which could be maintained by module authors it made sense for the module listing part of the Module List to be built  from that database. In April 1996 Andreas took over the automatic posting of  the Module List and I now maintain the other parts of the text. We plan to add  value to the automation over time.

3. CPAN stands for comprehensive Perl Archive Network. ^ and $ are used as anchors in a regular expression. /pattern/ is a pattern match operator. Perl is very easy to learn. Enter 'H' or 'h' for help.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Create a separate perl scripts
Reference No:- TGS01938425

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)