Re: iinfinite loop

2001-05-30 Thread Jeff Pinyan
On May 30, David Gilden said: >$data = 'some >multi line >string'; > >while($data){ > push(@everyline, $_); >} You're confusing this with while () { # do something with $_; } You can do: @lines = split /\n/, $data; or you can download the IO::String module from

Re: iinfinite loop

2001-05-30 Thread Ondrej Par
1) better use $data = < The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); > > } -- Ondrej Par Internet Securities Software Enginee

RE: iinfinite loop

2001-05-30 Thread Jeffrey Goff
Michalski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 30, 2001 1:31 PM To: David Gilden Cc: [EMAIL PROTECTED] Subject: Re: iinfinite loop Because the while loop will loop for as long as $data is "true" or contains data Considering that it has data in it, you have create

Re: iinfinite loop

2001-05-30 Thread Brett W. McCoy
On Wed, 30 May 2001, David Gilden wrote: > The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); > > } Yes, it's going to loop infinitel

Re: iinfinite loop

2001-05-30 Thread Brent Michalski
OOps, hit send too soon... This is _not_ the same as reading from a filehandle! while () is NOT the same as while($variable) {unless $variable is a filehandle} If working with a filehandle, the while will loop until no data is left. With a string, it will just keep looping while true (data i

Re: iinfinite loop

2001-05-30 Thread Brent Michalski
Because the while loop will loop for as long as $data is "true" or contains data Considering that it has data in it, you have created an "infinite" loop David Gilden

Re: iinfinite loop

2001-05-30 Thread John Joseph Trammell
On Wed, May 30, 2001 at 01:25:07PM -0400, David Gilden wrote: > The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); >