Hi ppl, I have to split a file in pieces and I place every segment in an array. Each segment begins with digit(s). What I want to do is to parse the array, and for each segement, record its first digits into a scalar so I can do further manipulations on it (actually I only print the scalar into a file).
What I do right now is : my $digit = 0; for (@commands) { $digit =~ /^\d+/; print FILE "DIGIT = $digit \n"; } The resulting file displays : 0 0 0 0 0 0 ... etc. Here are some sample segments : 1NP256ES-0 <-- here it should take 1 61PC61 <-- here it should take 61 1LT <-- here it should take 1 16PC16 <-- here it should take 16 I am missing something for sure ... but what? Any clues? Thank you so much in advance, Best regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Forestieres La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>