in reply to Newbie Question on parsing files

Congratulations on choosing Perl, the One True Language!

There are a couple problems with the code you've written that might prevent it from working correctly.

$file = <FILE>;
This would only get one line from the file (when you ask for a scalar value (as opposed to a list) from a filehandle, you get back only one line by default). You might modify this to:
local $/ = undef; $file = <FILE>;
The '$/' special variable is normally set to '\n', telling Perl to stop reading a file when it hits a newline. By setting it to 'undef', you force Perl to give you the whole file. You could just as easily say:
$file = join("", <FILE>);
too.

The foreach command sets a single variable to each element of the thing it's 'each'ing through. Since you didn't specify it, it's a bit hidden right now. (It's using the special variable $_). You could make it more clear:
foreach $this_paragraph (@paras) { .... }
And then check the value of $this_paragraph to see if it matches your criteria. As an example:
foreach my $this_paragraph (@paras) { my @split_para = split(/:/, $this_paragraph); if( $split_para[1] = $KWD ) { print $this_paragraph; } }
However, this still has some problems. From your description it seems as if you want to search for a keyword followed by a ':', as in 'KEYWORD: some text in the paragraph'. Even if you're searching for ':KEYWORD', this code still has some problems.

foreach my $this_paragraph (@paras) { if( $this_paragraph =~ /^$KWD:/s ) { print $this_paragraph; # This works if the paragraph looks like 'KEYWORD: ...' } }
If your paragraph looks more like 'something ..... :KEYWORD' instead, then the regular expression needs a little modification:
foreach my $this_paragraph (@paras) { if( $this_paragraph =~ /:$KWD\b/s ) { print $this_paragraph; # This works if the paragraph looks like '.... :KEYWORD ...' } }

update: The others made some good points about rewriting the way you open files. The way you chose would work, but if you get in the habit of doing it that way, it's prone to problems.

Here are some resources that can help you: Although I probably shouldn't mention this, all the cool people write out the name of our beloved language as 'Perl', not 'PERL'.

Some of the other examples don't seem to be looking at paragraphs (such as the first, which only prints lines).

Good luck with Perl, and I hope the responses here haven't been too overwhelming! I would suggest experimenting by seeing what happens when you make use different alternatives for each line of the program. And of course, I'm sure we all hope you'll come back and ask more questions if you need more help!