|Think about Loose Coupling|
Parse data from a line to get 2 variablesby Sunnmann (Acolyte)
|on May 12, 2006 at 23:48 UTC||Need Help??|
Sunnmann has asked for the wisdom of the Perl Monks concerning the following question:
For the life of me I have been searching for this
information for a while now. I am not good at perl (as
I have stated before), but still learning slowly as I
get the chance to use it.
What I need is to take information from a file, which I
know how to do with the code below.
Now, labellist.txt has information like so:
Those are tabs between the LOT and PRODUCT.
What I would like to do is somehow get each LOT# into
a variable $lotnumber and each PRODUCT# into a variable
A little more information:
LOT# will always be 8 characters long and be in the
format 1Letter followed by 7 Numbers or 8 Numbers
(Exs: F1234567, J1234567, 12345678). Product can range
from 6-9 characters and ussually start with a number
followed by 2 Letters then 3 numbers and most times at
the end have 2-3 letters (Exs: 4GT765, 4GT765HF,
I have tried something like this but it is not working out!
What I get is not what I want when I test it by
printing out @info or trying to get $Info and
$info. the only thing in @Info is the whole line and the LOT
and PRODUCT dont go in the array as seperate entities.