On Sunday 09 April 2006 19:34, John W. Krahn wrote: > Alan_C wrote: > > Hi. > [ . . ] > This may be close to what you want:
Very nearly exactly. It's very fast and without a pre created index file as well. Likely is portable to other platform too. I admit mine a bit hunky in places -- but it has been a stretch and a learning experience for me. 1 'split' found in: xtst101505 map is key to unlocking some of the real power of Perl split join That's a snippet of output from running the code I created (prints the keyword line for each specific and numbered $found_tally output) (the keyword line on each output helps me to choose which of the found items I want) In your code (without success) I tried to get the output to be like this: 1 'split' | map is key to unlocking some of the real power of Perl split join (has all of the keyword line except for the filename) (the wherefound line lists the filenames) Your code is above my ability level. What are topics and/or terms for things for me to study/practice in order for me to make the leap? > #!/usr/bin/perl -w > use strict; > > my @search4 = @ARGV; # keywords > > @ARGV = glob 'xtst*'; > my @lines; > while ( <> ) { > if ( s/^#:// ) { > push @lines, [ $ARGV, split ]; # what are the square brackets, does that create array reference? > } > > # quit looking when we reach the ninth line > close ARGV if $. == 9; > } print @lines, "\n"; # neither of these print and I don't know why print @$lines, "\n"; [ just for brevity's sake, snipped remainder of code ] -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>