in reply to
Re: RFC: new module r (or R)
in thread RFC: new module r (or R)
Well, the reason that I'd want to use it as a module (really, even, making it a module is just an end-around run at making it a command line option to the perl interpretter), is because you could use it for anything that puts files on the command line.
The thing about making it a script is that, sure, you can use it to work like grep... but greping files is just the beginning of the potential for this. Any command or script you have that expects files in @ARGV could benefit from this. I know that I, myself, do a lot of stuff that fits that bill.
Imagine, for example, some script perl validate_files.pl [file1] [file2] ..., (whatever validate_files.pl might be): wouldn't it be nice to be able to say: "perl -mr validate_files.pl *"? Or, for that matter, since it is a module, you could incorporate it into validate_files.pl, activated by a "-r
Not an editor command: Wq