|Is there a way of reading the file and printing each name with the smallest number next to it?
Though, it seems you forgot to post the code you've worked on. I won't assume you wanted someone else to write it for you, so I'll give you some places to look. Then when you have some code that you have written, and have a problem you can ask a question here. (right after you read this)
- Go take a look at open about reading the file
- Look at foreach loops to go over the lines in the file
- Look at split to get the number and name
- Read about Hashes(associative arrays) to store your results
- perlop will tell you how to evaluate 'less than'
- And finally reading print will show you how to print your results
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||