Matt Harp wrote: > Thanks Mike! > > I had tried single quotes but didn't think to try double quotes. > > I should probably be banned from this mailing list for such stupidity. > > but Ok, I'll push my luck... Any hints on how to make this a script > that'll let me pass *.*? > > I seem to remember a reference to a way to tell it to work on multiple > files from the cmd-line but can't seem to find the forum post any > longer. > > Something like -file (name=*.*)? Or something...
Just noticed a module that may help - it seems to work. Win32-Autoglob [1.01 ] expand globs in @ARGV when the shell doesn't Otherwise you can use glob, File::Glob or File::DOS::Glob to handle the *.txt >>From: Arms, Mike [mailto:[EMAIL PROTECTED] >>Matt Harp wrote: >> >>>This has to be an easy question to answer, but I've been >> >>looking and >> >>>hacking for a day now and can't figure it out. >>> >>>I want to just do search/replace on a set of files using regular >>>expressions. >>> >>>I have ActiveState 5.8.6 installed on WinXP, if that matters. >>> >>>I am trying it like this... >>> >>> perl -i.bak -pe s/^ext$/HARP/m fred.txt >>> >>>Perl help says that using m should result in ^,$ matching >> >>beginning of >> >>>line, end of line, but that's not what this does. It >> >>matches any 'ext' >> >>>string and replaces it with HARP. >>>I've tried \n instead also, but then that doesn't replace anything. >>> >>>My second question is of course, how to make this into a >> >>script so I >> >>>can pass *.txt. I've found a couple scripts but none of >> >>them will even >> >>>run w/o giving me errors. >>> >>>Any help on either issue would be immensley appreciated. I >> >>can't take >> >>>any more of this... >>> >>> >>>Regards, >>> >>>-matt <[EMAIL PROTECTED]> >>>[EMAIL PROTECTED] >> >> >>I'm guessing that the issue is that you need to put the >>script portion in quotes: >> >> perl -i.bak -pe "s/^ext$/HARP/m" fred.txt >> >>Try that and let us know. -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs