Forum OpenACS Q&A: TCL string manipulation problems (sorry for bothering)

Sorry to bother with this question. I have a problem with a TCL string manipulation:

mail_result contains the email address: gregor@lanifex.com what I need is to get the @ out and set gregor to a variable called first and lanifex.com to a second variable called last.

# this splits the e-mail by @ and puts it into a list.
# That contains now {gregor lanifex.com}
set mail_result [list [split $mail @]]

#This should put gregor into first
#But it puts {gregor lanifex.com}
set first [lindex $mail_result 0]

# This should contain {lanifex.com}
# But it contains nothing
set last [lindex $mail_result 0]
any ideas?
regexp "(.*)@(.*)" $mail dummy first second

Should do the trick and its only 1 line :)

Don't put the result from split in another list:
# this splits the e-mail by @ and puts it into a list.
# That contains now {gregor lanifex.com}
set mail_result [split $mail @]