in reply to Splitting and formatting a line
Here's a quick test case to show you how this can be done:
#!/usr/bin/perl -w use strict; while(<DATA>){ my ( $id, $dp, $ln, $fn, $nm ) = split /:/; print "$id $dp $ln $fn $nm\n"; } __DATA__ 011349786:200:Singer:Samuel:6
Your code cannot be actual code because you have an extra '}' in there ($NM = $5;}). If you show us a fuller code fragment, along with a few more lines from your logs, I'm sure we can do something better. I suspect you have scoping issue.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|