Inserting a 'newline' in arrays? 
Author Message
 Inserting a 'newline' in arrays?

Hi....I've got this segment of code -







right?
                        }

      open(OUTFILE, ">$user_name") or die "Couldn't open file
$user_name\n";

So I'm creating a file called $user_name, and in that file is $date and
$elapsed_time, this is fine, but, I have the values seperated by commas
on one continual line!

How do I force a \n after the $elapsed time but without placing a ','
after the $elapsed_time?
SO -
02-03-99,4321
03-03-99,2334
etc
Would be the output I require in the users file.
not
02-03-99,4321,
03-03-99,2334, etc
or
02-03-99,4321,03-03-99,2334, etc
Any help is greatly appreciated!
Thanks,
Mick

--
                                                             HORIZON
                                                       Software
Solutions

                                                    Developers /
Consultants
                            -= Integrated Systems / Internet / Unix /
Windows / Linux =-



Sun, 19 Aug 2001 03:00:00 GMT  
 Inserting a 'newline' in arrays?


: How do I force a \n after the $elapsed time but without placing a ','
: after the $elapsed_time?


        print $_, "\n";
    }

Greg
--
Woody: Hey, Mr. Peterson, Jack Frost nipping at your nose?
Norm:  Yep, now let's get Joe Beer nipping at my liver, huh?



Sun, 19 Aug 2001 03:00:00 GMT  
 Inserting a 'newline' in arrays?

<URL::">
!!


!! right?
!!                         }

Unlikely, as what you do in the loop doesn't depend on the iteration
value.

Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))



Sun, 19 Aug 2001 03:00:00 GMT  
 Inserting a 'newline' in arrays?


: How do I force a \n after the $elapsed time but without placing a ','
: after the $elapsed_time?


--
    Tad McClellan                          SGML Consulting

    Fort Worth, Texas



Sun, 19 Aug 2001 03:00:00 GMT  
 Inserting a 'newline' in arrays?

Quote:


>So I'm creating a file called $user_name, and in that file is $date and
>$elapsed_time, this is fine, but, I have the values seperated by commas
>on one continual line!

>How do I force a \n after the $elapsed time but without placing a ','
>after the $elapsed_time?

        $\ = "\n";

                print OUTFILE;
        }

        Bart.



Mon, 20 Aug 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Can't insert newline

2. Text widget's 'insert', and jpg images

3. insert 'n' amount of questions

4. Newlines and regex's

5. Can't figure out how to remove newlines

6. $\ on Win95 - can't get unix newline

7. Regexp's and Newlines

8. DBI: "INSERT INTO db VALUES ('?')" gives db.field1 = 'NULL'

9. insert newlines in a long string

10. How to insert a newline in Perl

11. How to insert newline break into a long string

12. Insert newline into long string

 

 
Powered by phpBB® Forum Software