06-01-2004 06:46 AM - last edited on 07-06-2014 05:34 PM by Lisa198503
I have a string, say, First.Last and want to split it on the dot. I use the following perl code:
($First,$Last) = split "." , $string;
I have also used:
($First,$Last) = split '.', $string;
($First,$Last) = split /./, $string;
And have put parens around it:
($First, $Last) = split (".", $string);
But I get nothing! If the string is separated by any other character (comma or slash) it works! How can I split on a dot?
Thanks for your help!
P.S. This thread has been moved from HP-UX>System Administration to HP-UX > languages. -HP Forum Moderator
Solved! Go to Solution.
06-01-2004 06:54 AM
and so on.
so your dot may be getting interpretted as any character. Did you try escaping it with a backslash "\" ?
UNIX because I majored in cryptology...
06-01-2004 07:30 AM
I am really at a loss here. I need to be able to split on the dot. I hope someone out there can help me...
06-01-2004 07:43 AM
live free or die