Jan Eden wrote:

>
>John McKown wrote:
>
>>On Thu, 15 Jan 2004, Andre Chaves Mascarenhas wrote:
>>
>>> Hello i wanna know what Perl module can I use and what commands to do the 
>>folowing:
>>> 1-Check to see if the file is a valid jpg file
>>
>>You didn't say what OS. If you're running Linux (or almost any UNIX based 
>>system), then I'd do something like:
>>
>>if (`file $file` =~ /JPEG/) {
>>   print "$file appears to be a JPEG file.\n";
>>} else {
>>   print "$file does not appear to be a JPEG file.\n";
>>}
>>
>This will tell you if the filename contains a certain string. 

Sorry! Please disregard my previous post, I overlooked the backquotes.

- Jan
-- 
How many Microsoft engineers does it take to screw in a lightbulb? None. They just 
redefine "dark" as the new standard.

--
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