>From: Jon Shorie [mailto:[EMAIL PROTECTED]] > >I am hitting a mental block on this. I know that it is probably simple, but I >will ask anyway. I am trying to convert a string of the form: > >$string1 = "900/00-2.3" > >to > >$string2 = "900/00/2/3" > >Here is what I have so far: > > >($n1,$r2) = split(/-/, $string1); >($n2,$n3) = split(/./, $r2); >$string2 = $n1 . "/" . $n2 . "/" . $n3; >$string3 = $n1 . "/" . $r2 >If I then print out $string2, I get >900/00// >If I print out $string3, I get >900/00/2.3 >any ideas?
Missing at least 2 things... use strict; and escaping the "." (\.) in your regex.. Mark _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs