in reply to Re: Where oh where should I initialize my vars?
in thread Where oh where should I initialize my vars?
Uh... there is nothing wrong with split("\t"). To quote Camel 2 (note that this is different from our own docs for split):
| The /PATTERN/ argument may be replaced with an expression to specify patterns that vary at run-time. (To do run-time compilation only once, use /$variable/o.) As a special case, specifying a space " " will split on whitespace just as split with no argument does. Thus, split(" ") can be used to emulate awk's default behavior, whearas split(/ /) will give you as many null initial fields as there are leading spaces. (Other then this special case, if you supply a string instead of a regular expression, it'll be interpreted as a regular expression anyway.) |
My point, runrig, is TIMTOWTDI, and that sometimes the 'correct' way isn't the way the programmer wanted to do it. I, for one, like to use quotes around constants that I am splitting on, and slashes for things that look more like regular expressions. Yeah, I know they are the same, but quotes around strings looks better (to me) then slashes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Re: Where oh where should I initialize my vars?
by runrig (Abbot) on Oct 26, 2000 at 20:37 UTC | |
by tye (Sage) on Oct 26, 2000 at 21:00 UTC |