"Martin Barth" schreef:
> Allam Reddy, Thomas:

>> I have a string "jdbc/abc.xml" which I wanted to tokenize using the
>> delimiter "/"
>> May I know the perl code for this?
>
> you could use split in this situation.
>
> @tokens = split(/\//, $string);
> the frist parameter to split is a regular expression with an escaped
> slash: \/.

I would not code a regex with an escaped slash, but would for example
write it like this:

   my @tokens = split m{/}, $string;

Or not code a regex at all, and use a module like File::Basename or
File::Spec.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to