in reply to Re^2: How to split a string
in thread How to split a string

$payload_32 $sensor_7 $sensor_125

Didn't you just prove merlyn's point?

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^4: How to split a string
by osunderdog (Deacon) on Jan 28, 2005 at 21:33 UTC

    No, I don't think so. My examples correspond to pin out locations and are hardly ever sequential. I guess I could use an array to store them but it would be extremly sparse.

    I believe merlyn's point (if I may bo so bold) is that a developer shouldn't just enumerate variables. IE ($t1, $t2, $t3, etc). Which I agree with whole heartedly.

    However I disagree that digits should be disallowed from a variable name in a language to avoid the problem. There are a lot of valid uses for a digit in a variable. The only way to keep developers from doing this is to educate them on the disadvantages.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

      My examples correspond to pin out locations and are hardly ever sequential. I guess I could use an array to store them but it would be extremly sparse.

      Hmm. You could use a hash or use named constants to say something like $pin[ FOO_SENSOR ], then.

      Makeshifts last the longest.

        But it's already in a hash: %::

        :^D

        "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.