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. However, if I use the normal "if" condition, the error disappears. Can somebody please explain to me what am I doing wrong here? Regards, Anoop ============================================================================================================================ Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra. ============================================================================================================================