Using grep the empty lines can be removed from an array in perl. Here is how.
### Remove any empty lines @dataArray = grep(/S/, @dataArray);
S does the pattern matching that if everything on that line is a space.
Using grep the empty lines can be removed from an array in perl. Here is how.
### Remove any empty lines @dataArray = grep(/S/, @dataArray);
S does the pattern matching that if everything on that line is a space.
Comments are closed.
You need the backslash before the ‘S’ like this: /S/
Thank you Seth, I have corrected.