Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Find all JPEG files in a directory

by spiritway (Vicar)
on Aug 12, 2005 at 05:03 UTC ( #483184=note: print w/replies, xml ) Need Help??


in reply to Find all JPEG files in a directory

Since this is a Linux environment, you can use the 'ls' command:

ls *.jp* > textfile

Not Perl, but it works in Linux.

Replies are listed 'Best First'.
Re^2: Find all JPEG files in a directory
by holli (Monsignor) on Aug 12, 2005 at 06:09 UTC
    #perl use File::Slurp; write_file ('filenameW', $ENV{OS} =~ /Windows/i ? `dir /b *.jpg` : `ls + *.jpg` );
    Update: changed single qutoes to backticks as originally intended.


    holli, /regexed monk/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://483184]
help
Chatterbox?
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D
[Corion]: The upside to this is that I've reduced my $work (well, $paid) time to 80%, so I'll be at $work only four days/week, which will hopefully make the crunch less crunchy on me ;)
[marto]: yeah, so that stays as before. But before the boys were born I'd be on quite often at night (GMT) also
[marto]: I had the option during our TUPE transfer to buy 5 more days holiday. They were shocked when I did :P

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-06-29 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.