My Regex is a bit weak (hey, I'm kind of new at this. :p ) but this looks it should work. I'm anchoring the search to the beginning of a string, pick up all the characters until I hit the first \n, then use what was found before the new line to replace the existing value in $val.$val =~ s/^(.*)\n/$1/;
So I dug around and found that the following code snippet will work.
$val =~ s/\n.*//s;
I've done searches around the monestary, but I'm at a complete loss at what I'm supposed to be looking for. :( I'm pretty sure I saw a very similar question regarding this sort of thing, but I can't remember where I saw it, much less the answer.
Is it fair to stick a link to my site here?
Thanks for you patience.
In reply to Junking excess string.. junk with s///. by SavannahLion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |