On Sun, 2008-10-26 at 14:57 +0000, Brian wrote:
> They are all tiny text files.
> 
> I now have the following code:-
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> use File::Find;
> 
> open my $REPORT, '>', 'dummy.txt' or die "Cannot open 'dummy.txt' $!";
> print $REPORT scalar localtime, "\n";
> 
> print STDERR 'Enter a string to search for: ';
> chomp( my $string = <STDIN> );
> 
> find sub {
>      return unless -f;
>      open my $FH, '<', $_ or die "Cannot open '$_' $!";
>      while ( <$FH> ) {
>          /\Q$string/ && print $REPORT "$File::Find::name\n" and
> return;
>          }, '/test';

         }}, '/test';
# One for the while, one for the sub

> 
> print $REPORT scalar localtime, "\n";
> 
> 
> I'm getting syntax error line 17 and line 19, it is also complaining 
> about missing right curly braces.
> I can't see the problem. :-(
> Brian
> 
-- 
Just my 0.00000002 million dollars worth,
  Shawn

Linux is obsolete.
-- Andrew Tanenbaum


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to