join('')

Discussion in 'Perl' started by Todd Anderson, Sep 11, 2003.

  1. Dear Sirs and or Madaams,
    I need to write a file from @fields. I need the file to look like...
    $bgcolor = "black"; $textcolor = "black"; etc... or
    $bgcolor = "black";
    $textcolor = "black";

    @fields = split (/\|/, $line);

    foreach $field (@user_field_order)
    {
    This is what I have but it's not putting the >>";\n\n<< after each item
    @fields and the $field is printing as $field and it's creating a list
    foreach $field (@user_field_order)
    $list .= join('\$$field = \"' => @fields => '\"\; \n\n ');
    }
    Any help is appreciated and thanks in advance for your help.
     
    Todd Anderson, Sep 11, 2003
    #1
    1. Advertising

  2. Todd Anderson

    Kris Wempa Guest

    Your question is a little unclear. You have an array @fields. Are the
    elements of the array supposed to represent each line in a file ? Or, is
    each array element multiple lines that must be split on the '\n' ? Also,
    how does @user_field_order relate to @fields ?? Please clarify.

    "Todd Anderson" <> wrote in message
    news:...
    > Dear Sirs and or Madaams,
    > I need to write a file from @fields. I need the file to look like...
    > $bgcolor = "black"; $textcolor = "black"; etc... or
    > $bgcolor = "black";
    > $textcolor = "black";
    >
    > @fields = split (/\|/, $line);
    >
    > foreach $field (@user_field_order)
    > {
    > This is what I have but it's not putting the >>";\n\n<< after each item
    > @fields and the $field is printing as $field and it's creating a list
    > foreach $field (@user_field_order)
    > $list .= join('\$$field = \"' => @fields => '\"\; \n\n ');
    > }
    > Any help is appreciated and thanks in advance for your help.
    >
     
    Kris Wempa, Sep 12, 2003
    #2
    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. laurent
    Replies:
    7
    Views:
    1,929
    Joe Smith
    May 27, 2004
  2. Taewoon Kwon

    Qustion about ithreads join

    Taewoon Kwon, Sep 10, 2004, in forum: Perl
    Replies:
    1
    Views:
    429
    Joe Smith
    Sep 15, 2004
  3. Gareth Stretch
    Replies:
    0
    Views:
    4,753
    Gareth Stretch
    Jun 26, 2003
  4. Alan Silver
    Replies:
    0
    Views:
    892
    Alan Silver
    Jun 5, 2006
  5. googleboy
    Replies:
    1
    Views:
    932
    Benji York
    Oct 1, 2005
Loading...

Share This Page