Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: RFC: new module r (or R)

by samtregar (Abbot)
on Mar 05, 2004 at 18:26 UTC ( #334308=note: print w/ replies, xml ) Need Help??


in reply to RFC: new module r (or R)

This sounds useful, but I think I'd prefer it packaged as a script. My reasoning is that modules are for reusable code on a large scale, but scripts are the right size for small-scale reusability like this.

Maybe call it 'pgrep'? Or 'prep'?

-sam


Comment on Re: RFC: new module r (or R)
Re: Re: RFC: new module r (or R)
by etcshadow (Priest) on Mar 05, 2004 at 18:45 UTC
    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 " switch.

    ------------ :Wq Not an editor command: Wq

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-12-18 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (59 votes), past polls