http://www.perlmonks.org?node_id=999983


in reply to Re^2: New student, can we write this program in perl...
in thread New student, can we write this program in perl...

my @data = <> would be one way. Could always read one line at a time with while (<>) {...}. This is stuff that you or your instructor should have already covered in your course, isn't it?

Update: if not, take a look at perlintro, perlfaq, perlsyn, perldata, and so on.

--MidLifeXis

Replies are listed 'Best First'.
Re^4: New student, can we write this program in perl...
by rahulraina7 (Initiate) on Oct 19, 2012 at 17:27 UTC
    In india we do have to do lots of research work like this, blame it to the poor teaching system.

      I find it ironic that you would ask us to write a solution for you rather than ask for assistance gaining a better understanding, and then in the same thread blame the "poor teaching system" for your not knowing how to do it. Decide now if you'll be the student who digs in and learns how to learn, or the student that gets weeded out after the 2nd semester (or the 2nd week on the job).

      Get familiar with the Perl documentation. perlintro is a good place to start, and contains 99% of what you need to accomplish the task you've been assigned. Reading through it will take an hour. Absorbing it will take a little more in-depth study. That should put you back on the path of the student who learns how to learn (and consequently goes much farther than those who just want to get through the course).


      Dave

      This is not research. That involves actually studying the authoritative sources such as perldocs (which happen to be available at your console).