Re: control structure query ...

Discussion in 'Perl' started by Jürgen Exner, Jan 15, 2010.

  1. [comp.lang.perl has been replaced by the whole
    comp.lang.perl.*-hierarchy a long long time ago. Forwarding to CLP.misc
    where this question is much better suited]

    Russell Potter <> wrote:
    >I was hoping someone could tell me, and also
    >give me an example of the syntax of, a loop
    >control structure sable to (at least reason-
    >ably elegantly) transform a list such as,
    >say, "(a, b, c)" into a tiring insisting onsi-
    >sting of form the concatenated content of
    >each list elopements, each element separated
    >by a hyphen (in our example: "a-b-c").


    I have a very(!) hard time reading your text. What of that are typos and
    what do you actually mean? What e.g. is a "tiring insisting onsisting"?
    Or a "structure sable"?

    The way I am reading your question you got a list and you want to
    convert it into a string where the list elements are connected by a
    specific character.
    No need for any loop control structure at all, just use join(), details
    see 'perldoc -f join':
    join EXPR,LIST
    Joins the separate strings of LIST into a single string with
    fields separated by the value of EXPR [...]

    jue
     
    Jürgen Exner, Jan 15, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Excluded_Middle

    Pointers to structure and array of structure.

    Excluded_Middle, Oct 24, 2004, in forum: C Programming
    Replies:
    4
    Views:
    759
    Martin Ambuhl
    Oct 26, 2004
  2. Leo Nunez
    Replies:
    3
    Views:
    1,231
    Neil Kurzman
    Feb 9, 2005
  3. Replies:
    2
    Views:
    613
  4. Replies:
    9
    Views:
    25,324
    Lal Bahadur Singh
    Nov 11, 2011
  5. meisterbartsch
    Replies:
    2
    Views:
    788
    meisterbartsch
    Jun 12, 2007
Loading...

Share This Page