Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Austin, TX
    Posts
    11

    Question Unanswered: Delimiting variable names from numeric suffixes

    I have a variable $varname with value of VAR. I have a table named VAR3_IX.

    I want to refer to this table in a statement like $varname3_IX. However, I need to delimit the $varname from the 3_IX so that $varname can be resolved by Perl.

    How can I do this?

    Thanks for your help!
    sjw

  2. #2
    Join Date
    Sep 2003
    Location
    Austin, TX
    Posts
    11

    Talking Solution

    OK I got it to work, although I expect there's a much more elegant solution. (I'd love to see one.)

    I created another variable $numsuff = 3 and used $varname$numsuff\_IX in my expression.

    Thanks,
    sjw

  3. #3
    Join Date
    Aug 2003
    Posts
    13
    since it seems like all you are doing is concatenating strings, you may as well use real concatenation.

    instead of making a new variable try using:
    $varname."3\_IX";

    hope that works
    ~Viz

  4. #4
    Join Date
    Sep 2003
    Location
    Austin, TX
    Posts
    11

    Smile Thanks

    Thank you, Viz.

    I appreciate the help!

    sjw

  5. #5
    Join Date
    Aug 2003
    Posts
    13
    anytime

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •