Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Getting File Type using Regular Expressions

by arden (Curate)
on Apr 21, 2004 at 13:10 UTC ( [id://346991]=note: print w/replies, xml ) Need Help??


in reply to Getting File Type using Regular Expressions

So what have you tried so far? This is a topic covered very extensively and thoroughly in nearly every Perl book I've ever seen!

Just to be helpful, try something like  $filename =~ /\.(jpg|gif|bmp)$/ for image files. I'll assume you can figure out the text file version from that. . .

- - arden.

Update: For more information, see Perl in a Nutshell Chapter 4 section 6, Programming Perl Chapter 1 section 7, Learning Perl Chapter 7 section 1, Perl Cookbook Chapter 6, or even the Tutorials here at PerlMonks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://346991]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-19 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found