Re: Flushing Buffers (WAS: recursive search)

2005-12-03 Thread John Doe
The Ghost am Freitag, 2. Dezember 2005 19.30: Hi, In addition to John W. Krahn's good advices: So far I did this: #!/usr/bin/perl use File::Find; my $totalLines; find(\wanted, '@directories'); sub wanted { unless ($_=~m/.html|.mas|.pl|.txt$/i) {return 0;} #filter the

Re: Flushing Buffers (WAS: recursive search)

2005-12-03 Thread John W. Krahn
John Doe wrote: The Ghost am Freitag, 2. Dezember 2005 19.30: open FILE, $File::Find::name; Always check if operations succeeded: open (FILE, '', $File::Find::name) or die couldn't open $File::Find::name: $!; Thanks, don't know how I missed that. :-) John -- use

Re: Flushing Buffers (WAS: recursive search)

2005-12-03 Thread John W. Krahn
John Doe wrote: The Ghost am Freitag, 2. Dezember 2005 19.30: print $_: ; my @lines=FILE; and close opened files: close FILE or die couldn't close $File::Find::name: $!; print $#lines\n; $totalLines+=$#lines; #wanted's value is ignored so we have to do

Re: Flushing Buffers (WAS: recursive search)

2005-12-03 Thread John Doe
John W. Krahn am Samstag, 3. Dezember 2005 15.27: John Doe wrote: The Ghost am Freitag, 2. Dezember 2005 19.30: print $_: ; my @lines=FILE; and close opened files: close FILE or die couldn't close $File::Find::name: $!; print $#lines\n;

Re: Flushing Buffers (WAS: recursive search)

2005-12-02 Thread Shawn Corey
Jennifer Garner wrote: $|=1; Be careful with this one. The documentation for it makes it sound like it's a good idea to set this but doing so turns buffering OFF, not ON. Normally you leave this alone, even for pipes and sockets; Perl does the right thing in almost every case. See:

Re: Flushing Buffers (WAS: recursive search)

2005-12-02 Thread The Ghost
So far I did this: #!/usr/bin/perl use File::Find; my $totalLines; find(\wanted, '@directories'); sub wanted { unless ($_=~m/.html|.mas|.pl|.txt$/i) {return 0;} #filter the kinds of files you want open FILE, $File::Find::name; print $_: ; my @lines=FILE;

Re: Flushing Buffers (WAS: recursive search)

2005-12-02 Thread John W. Krahn
The Ghost wrote: So far I did this: #!/usr/bin/perl That should be followed by these two lines: use warnings; use strict; use File::Find; my $totalLines; find(\wanted, '@directories'); Do you actually have a directory in the current directory named '@directories'? sub wanted