Gossamer Forum
Home : General : Perl Programming :

Splitting One Variable Into Two

Quote Reply
Splitting One Variable Into Two
In the following example:

$email = 'johndoe@acme.net'

how do I make $name = 'johndoe' and $server = 'acme.net'?
Quote Reply
Re: Splitting One Variable Into Two In reply to
#!/usr/bin/perl
$email = 'johndoe@acme.net';
($name, $server) = split ("\@", $email);

--Mark

------------------
You can reach my by ICQ at UID# 8602162