
How to use split function to split on a backslash
Quote:
>> On Fri, 18 Apr 2003 15:37:07 -0600,
> I am trying to split a string which contains a
> backslash. I have tried:
> '\\', $string;
The first argument to split() is a regular expression.
Quote:
> $string contains something like "domainName\userName"
> and I would like to end up with: $words[0] =
> "domainName" $words[1] = "userName"
my $string = 'domainName\userName';
my ($domain, $user) = split /\\/, $string;
hth
t