Never underestimate the importance of trying a small test script. Notice what the following code reveals.
#!/usr/bin/perl -w
$_ = "The quick\n\nbrown fox\njumped.";
print "-------------\n";
foreach (/(.*)/gm){
print "[$_]\n";
}
print "-------------\n";
foreach (split/\n/){
print "[$_]\n";
}
print "-------------\n";
This code prints out the following:
-------------
[The quick]
[]
[]
[brown fox]
[]
[jumped.]
[]
-------------
[The quick]
[]
[brown fox]
[jumped.]
-------------
So, while it may look the same, it really isn't.