So to begin, I have very little experience with Perl and was just handed an assignment for class.
What we need to accomplish is:
We are given a text document with some info in the form of
<FIRST NAME> <LAST NAME> <NUMBERS>
We need to take this file and produce another that has simple
<first 4 of FIRSTNAME><last four of NUMBERS>
I've gotton as far as basic hello world in Perl and read some input from a file. I was wondering if someone out there could poit me to some brief tutorials that can help me to finish up how to do this, or if someone can explain a type of concept to complete this to me.
I was thinking putting each line into an array, and counting up to the 5th spot, and deleting until i reached the n-4th element and stopping... Since the data is already roughly in format.
One of the things i'm told Perl is great for is pattern matching and the sort, but how would I say "delete everything after the first 4 characters, until the 4th to last character? Any help or guidance or point to some good resource to help on this topic?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |