Re: parsing Makefiles

2004-02-24 Thread zsdc
Andrew Gaffney wrote: zsdc wrote: First of all, using foreach will _always_ wait for all of the data before doing anything else, no matter what, so first change: foreach () { to: while () { Ok, so it was the 'foreach' causing my problem the whole time. Good to know it's working now. Here

Re: parsing Makefiles

2004-02-23 Thread Andrew Gaffney
Andrew Gaffney wrote: zsdc wrote: Andrew Gaffney wrote: I tried that and it still spits out all the output at the end. Here's my current code: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; print "$total\n"; my ($count, $line); open MAKE, "make |" or die "Can'

Re: parsing Makefiles

2004-02-23 Thread Andrew Gaffney
zsdc wrote: Andrew Gaffney wrote: I tried that and it still spits out all the output at the end. Here's my current code: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; print "$total\n"; my ($count, $line); open MAKE, "make |" or die "Can't open MAKE pipe"; fore

Re: parsing Makefiles

2004-02-23 Thread Andrew Gaffney
zsdc wrote: Andrew Gaffney wrote: I tried that and it still spits out all the output at the end. Here's my current code: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; print "$total\n"; my ($count, $line); open MAKE, "make |" or die "Can't open MAKE pipe"; fore

Re: parsing Makefiles

2004-02-23 Thread zsdc
Andrew Gaffney wrote: I tried that and it still spits out all the output at the end. Here's my current code: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; print "$total\n"; my ($count, $line); open MAKE, "make |" or die "Can't open MAKE pipe"; foreach () { $

Re: parsing Makefiles

2004-02-23 Thread Andrew Gaffney
zsdc wrote: Andrew Gaffney wrote: open MAKE, "make |"; foreach $line () { $count++; my $percent = int(($count / $total) * 100); print "..$percent"; } Try changing this line: foreach $line () { to this: while (defined($line = )) { or if you can use $_ instead of $line, then just: whil

Re: parsing Makefiles

2004-02-23 Thread zsdc
Andrew Gaffney wrote: open MAKE, "make |"; foreach $line () { $count++; my $percent = int(($count / $total) * 100); print "..$percent"; } Try changing this line: foreach $line () { to this: while (defined($line = )) { or if you can use $_ instead of $line, then just: while () { which i

Re: parsing Makefiles

2004-02-23 Thread Andrew Gaffney
David le Blanc wrote: From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 12:35 AM To: David le Blanc Cc: [EMAIL PROTECTED] Subject: Re: parsing Makefiles David le Blanc wrote: From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 6:09 PM To

RE: parsing Makefiles

2004-02-22 Thread David le Blanc
> From: Andrew Gaffney [mailto:[EMAIL PROTECTED] > Sent: Monday, 23 February 2004 12:35 AM > To: David le Blanc > Cc: [EMAIL PROTECTED] > Subject: Re: parsing Makefiles > > David le Blanc wrote: > >>From: Andrew Gaffney [mailto:[EMAIL PROTECTED] > >>Sent:

Re: parsing Makefiles

2004-02-22 Thread Andrew Gaffney
David le Blanc wrote: From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 6:09 PM To: David le Blanc Cc: [EMAIL PROTECTED] Subject: Re: parsing Makefiles David le Blanc wrote: I've come up with some *simple* code that seems to work: #!/usr/bin/perl use strict

RE: parsing Makefiles

2004-02-22 Thread David le Blanc
> From: Andrew Gaffney [mailto:[EMAIL PROTECTED] > Sent: Sunday, 22 February 2004 6:09 PM > To: David le Blanc > Cc: [EMAIL PROTECTED] > Subject: Re: parsing Makefiles > > David le Blanc wrote: > >>I've come up with some *simple* code that seems to work: &g

Re: parsing Makefiles

2004-02-21 Thread Andrew Gaffney
David le Blanc wrote: I've come up with some *simple* code that seems to work: #!/usr/bin/perl use strict; use warnings; $| = 1; my $total = `make -n | wc -l`; my ($count, $line); open MAKE, "make |"; foreach $line () { $count++; my $percent = int(($count / $total) * 100); print "..$percent

RE: parsing Makefiles

2004-02-21 Thread David le Blanc
> I've come up with some *simple* code that seems to work: > > #!/usr/bin/perl > > use strict; > use warnings; > > $| = 1; > my $total = `make -n | wc -l`; > my ($count, $line); > open MAKE, "make |"; > foreach $line () { >$count++; >my $percent = int(($count / $total) * 100); >prin

Re: parsing Makefiles

2004-02-21 Thread Andrew Gaffney
David le Blanc wrote: From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 4:53 PM To: beginners Subject: parsing Makefiles I'm looking to write a script that will parse a toplevel Makefile in a source tree and then descend into all the directories and parse those Ma

RE: parsing Makefiles

2004-02-21 Thread David le Blanc
> From: Andrew Gaffney [mailto:[EMAIL PROTECTED] > Sent: Saturday, 21 February 2004 4:53 PM > To: beginners > Subject: parsing Makefiles > > I'm looking to write a script that will parse a toplevel > Makefile in a source tree and > then descend into all the directories and parse those > Makefi