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
I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

Please explain about sub programming.

Introduction A search engine (like Google) has three main components: a crawler that finds and stores copies of files on the web, an indexer that creates a data structure that

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Am unable to write to file of type=file in perl script.It does not have any extension.Help me..

In this Project your task is to create a program that displays various levels of the fractal structure of the so called square shaped Sierpinski-carpet. The display of level 4 is s

How to do socket programming in C

You have been asked to set up a project plan for developing a mobile phone application for London Olympics. Major tasks include conducting some research into different mobile ph

Pseudo code the shows logic for a program that generates a random number, then ask the user to think of a number between 1 and 10

Question: (i) Each time a security mechanism is installed or deleted in a Digital UNIX system, SIA is involved. Draw a Security Integration Architecture diagram. (ii) How