in reply to I'm splitting a scalar and putting the results in an array. Why is the first element empty?

Not that this has any effect on your code, as you later plainly assign a list to your whole array, but don't do this:
my @MatchFoundArray =  "";
unless you really want to end up with an array containing a string as the single item.
  • Comment on Re: I'm splitting a scalar and putting the results in an array. Why is the first element empty?
  • Download Code

Replies are listed 'Best First'.
Re^2: I'm splitting a scalar and putting the results in an array. Why is the first element empty?
by meanroy (Acolyte) on Aug 11, 2006 at 15:17 UTC
    I added that while (attempting) troubleshooting the problem to make sure I knew what was in the array to begin with.
    I'm trying to do some fairly sophisticated stuff with regex, and frankly, in way over my head at this point.
    FWIW the responses I got here led me to re-read the entries in the Llama and Camel books on regex, followed by an entire day of starting from the beginning (again!) and jumping around trying out examples in the Owl book.
    At least now I'm making a little progress.
    Thanks again.
    Roy.