On Dec 21, 2007 11:01 AM, banker123 <[EMAIL PROTECTED]> wrote:

> 1. This only processes the first record in the file, the file has many
> records and I would like to process each record.

It sounds as if you want to wrap what you have in a loop. Perhaps you
want to do something like this:

  while (my $data = <INPUT>) {
    # existing code
  }

> 2. My array has empty elements, how do I remove empty or blank
> elements?

With grep(), probably. It's documented in the perlfunc manpage.

> 3. When I print the array the first element is on row 1 and the
> remaining elements are on row 2, how do I print on 1 row?

You probably need chomp(), to get rid of the unwanted newline on the
input data string. Put it inside the while loop:

    chomp($data);

Of course, you'll have to add code to output newline characters where
you do want line breaks.

> @[EMAIL PROTECTED],-2,-3,-4,-5,-6,-7];

Maybe you want reverse()?

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to