Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: RFC: new module r (or R)

by BrowserUk (Pope)
on Mar 05, 2004 at 18:54 UTC ( #334325=note: print w/replies, xml ) Need Help??

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

Personally, I prefer -mr.

...but if the namespace police won't permit that on cpan, it wouldn't matter, because I would simply rename it for local use.

Did you give any thought to depth first -v- breadth first?

It probably wouldn't make any difference at all for most uses. In fact, now I've typed that, the only time it might make a difference is if you were using it to delete files and wanted to also delete the subir if it ended up empty. But that's probably better done with other tools anyway.

The other thought that crossed my mind was I wonder how it would play with the Getopt::short/middle/long/very-very-very-long* modules? I'm not sure when they do there processing of @ARGV? But if the do their processing at BEGIN time, then maybe yours should be done at CHECK time?

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re: Re: RFC: new module r (or R)
by etcshadow (Priest) on Mar 05, 2004 at 19:25 UTC
    Interference with GetOpt* is a good point... Obviously, the only way such a collision could occur is if there were a directory named "--whatever" or "-w", etc. But it's still the sort of thing that shouldn't be allowed to interfere.

    More reason, I think, to go with the -MR-type notation... as that would give more control (over when and where) to someone who was writing a script, or other module, but wanted to incorporate the @ARGV-recursion of this module.

    Of course, another route would be to make it all under something like, and provide a stub that was just:

    use RecursiveARGV;
    Making perl -mr exactly the same as perl -MRecursiveARGV, but allowing people to do more fun stuff in their scripts like:
    #!/usr/bin/perl require RecursiveARGV; # cleans @ARGV of any switches here, # leaving only files GetOpt(...); # now @ARGV becomes directory-magic RecursiveARGV->import();

    Update: I changed midstream between referring to a more full-fledged module as and and things got a little tangled up.

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://334325]
[choroba]: Maybe it's the other way round?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2018-03-22 09:03 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (273 votes). Check out past polls.