Guest_imported
New member
- Jan 1, 1970
- 0
Please help.
I need to split a string known as $an{'example'} into two values.
e.g.
$an{'example'} = cat.com
I need to make
$part1 = cat
$part2 = .com
I was thinking something on the lines of;
$part1 =$an{'example'} =~ s/[\W]...//g;
$part2 =$an{'example'} =~ s/^(\w+?)$//g;
My usage of = in the second instance of each line above is obviously wrong (I'm hoping you can see the result I'm trying to achieve).
Any help is greatly appreciated.
Be easy on me I'm only a beginner !
Thank you
I need to split a string known as $an{'example'} into two values.
e.g.
$an{'example'} = cat.com
I need to make
$part1 = cat
$part2 = .com
I was thinking something on the lines of;
$part1 =$an{'example'} =~ s/[\W]...//g;
$part2 =$an{'example'} =~ s/^(\w+?)$//g;
My usage of = in the second instance of each line above is obviously wrong (I'm hoping you can see the result I'm trying to achieve).
Any help is greatly appreciated.
Be easy on me I'm only a beginner !
Thank you