Write a perl script that prints the contents of a file, Programming Languages

Write a Perl script that prints the contents of a file

  • Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should accept exactly one argument representing the name of the file.
  • The script should be able to handle the following error conditions:

 

  1. Incorrect number of arguments
  2. The specified argument is not a file.
  • You cannot use the UNIX "cat" command in this assignment. You must use Perl to read the file and count the lines.
  • You cannot use the UNIX "nl" command in this assignment.
  • The printf function in Perl is useful for formatting numbers.
  • The script must be able to execute on Einstein
  • The script file name must be: linenum
  • The script must be located in $HOME/itec400/homework
  • Make sure the permissions on the your itec400 directory are 705
  • Make sure the permissions on your script are 705.
Posted Date: 2/18/2013 5:46:31 AM | Location : United States







Related Discussions:- Write a perl script that prints the contents of a file, Assignment Help, Ask Question on Write a perl script that prints the contents of a file, Get Answer, Expert's Help, Write a perl script that prints the contents of a file Discussions

Write discussion on Write a perl script that prints the contents of a file
Your posts are moderated
Related Questions
For this assignment you will use the robot/maze simulation example introduced in mini-assignments 0625ma-0627ma to develop a maze-solving program. The program will read a file cont

What is .NET TECHNOLOGY? .NET technological innovation was presented by Enthusiasm, to get the industry from the SUN's Coffee. Few in the past, Enthusiasm had only VC++ and VB

Im having problems with my php / mysql code. I am trying to make it so it looks for an asset Number and if it is in the shop if the asset is in the database but is not in the shop

find value of nCr using function

Question 1 Explain the three traits of Object Oriented Programming Question 2 Write a note on (a) Assignment Operators                             b) Bitwise Operators.

Hi I have an assignment for prolog languagle is it possible to get help

Write a program that will generate 25 DWORD values in the range from +/-50 representing a two dimensional array of size 5 x 5. It should then display the array as a table (5 x 5) b

I''m studying electrical engineering, and this semester im taking course that called Computer Design. in this course they need me to a final project about any thing we took during

Question: (i) What is multithreaded programming? Lists the benefits achieved by multithreading your code in a program. (ii) What type of coding should be eliminated when d

1) Write a program that takes an input value (for example, a number 5). The output should be sum of all numbers from 1 to the value input by the user (in this example, the output w