Anoop Kurup schrieb:

> Hi,
>
>
> Can somebody explain to me what is the syntax error in the following
> code:
>
>
>     20  sub func()
>     21  {
>     22     my ($retension_period, $file_list) = @_;
>     23     my $file;
>     24
>     25     while(defined($file = glob("$file_list")))
>     26     {
>     27        -s $file && -M $file > $retension_period && { print "File
> name is: $file\n"; print "File found\n"; }
>     28     }
>     29  }
>
>
>
>
>
> The error that I get is:
>
>
> syntax error at 2perlfind.pl line 27, near "; print"
> syntax error at 2perlfind.pl line 29, near "}"
> 2perlfind.pl had compilation errors.
>

Apart from the other suggestions in this thread, remove the empty
prototype or there will be no @_ !

Here's what I get when trying to run this code:
Too many arguments for main::func at ...

> Regards,
> Anoop

Greetings,
Andreas Puerzer

-- 
perl -mAcme::JAPH

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


Reply via email to