in reply to String Splitting
or if you really want to do it with a regex:
my ($str1, $str2) = $line =~ /^(.*?)\t(.*)/;
Note that this splits at the first tab. Remove the ? and it will split at the last tab. Note also that the solutions using split actually generate a list with one entry per tab plus one. The regex can only generate a list with two entries. See perlretut.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String Splitting
by Transient (Hermit) on Aug 18, 2005 at 18:53 UTC | |
by GrandFather (Saint) on Aug 18, 2005 at 19:03 UTC |