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
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
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
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
:
Subject: iinfinite loop
05/30/01 12:25
PM
David Gilden
cc:
Subject: iinfinite loop
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, $_);
>
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, $_);
}