Perhaps it is a CSV file (or similar) and in that case Text::CSV can help you to deal with the empty fields.
Or perhaps the data are generated by another program and piped to your program or your program picks the data up through its STDIN. In those cases you will have to channel the data through a filter that will replace empty or missing fields with undef, before you hand over the data for further processing.
It will all depend on where the data is coming from and where it is going to. .
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial DeltronicsIn reply to Re: Perl reference array
by CountZero
in thread Perl reference array
by teun-arno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |