Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Grabbing file prefixes with Reg Exp

by MrNobo1024 (Hermit)
on May 13, 2001 at 20:19 UTC ( #80048=note: print w/replies, xml ) Need Help??


in reply to Grabbing file prefixes with Reg Exp

grep returns the whole filenames, not just a parenthesized group. I think what you want is my @audiofiles = map { /([^\.]+)\.ram/i ? $1 : () } readdir DH;

Replies are listed 'Best First'.
Re: Re: Grabbing file prefixes with Reg Exp
by nysus (Curate) on May 13, 2001 at 20:24 UTC
    You so smart! That did the trick. Guess I gotta learn the "map" function now...thanks!

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar";
    $nysus = $PM . $MCF;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://80048]
help
Chatterbox?
[choroba]: command line FTW!
[marto]: good morning all, sane dots all round
[Corion]: Hi marto! I hope all is well!

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-12-07 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (125 votes). Check out past polls.