in reply to Re: Do as I say. Not as I do
in thread Do as I say. Not as I do

I'd change the second split to use delimiters other than /.

Good point, VSarkiss, but when using a different delimiter you have to write

split m|/|; # instead of split |/|;

I agree fully with your suggestions and like especially your point about making the comment. This solution was not mentioned elsewhere. A perl programmer should know that $_ (or $elem) is an alias for the actual element. Nevertheless overreading this is easy, so the comment is a good solution.

-- Hofmator

Replies are listed 'Best First'.
Re: Re: Re: Do as I say. Not as I do
by runrig (Abbot) on Dec 17, 2001 at 22:24 UTC
    Good point, VSarkiss, but when using a different delimiter you have to write
    split m|/|; # instead of split |/|;
    Or you can say: split "/"; (though " " is, of course, a special case, but for other simple one character (non-metacharacter) splits I like to use quotes :) If you're splitting on literal ".", you can't use "." but you could use "\\." but then I'd just assume use /\./ ...Got all that?