[Linux-disciples] Catching URLs on the command line
Adam Kessel
linux-disciples@bostoncoop.net
Sat, 17 Jan 2004 13:12:30 -0500
On Sat, Jan 17, 2004 at 12:12:55PM -0500, Stephen R Laniel wrote:
> On Sat, Jan 17, 2004 at 12:03:30PM -0500, Adam Kessel wrote:
> > The difference is subject and predicate. Or something. Perl and Unix are
> > both content to have sensible defaults for the *object* of a command, but
> > not for the command itself. E.g., many unix tools default to stdin as
> > the object (e.g., grep), or have some other sensible default behavior if
> > you just run the command. When you don't give Perl any variable to
> > operate on, it operates on the default variable. But there is never a
> > case in Perl or Unix that I'm aware of where you give it some variable
> > and it guesses what action to take on it.
> Here I am just thinking out loud, but: isn't it just as
> dangerous, potentially, to allow default objects as it is to
> allow default verbs? Both introduce some confusion into what
> might be happening at a given moment in a given program, but good
> programmers learn to work around it -- actually, not just work
> around it, but use it to their advantage to write shorter code.
I suspect it's more dangerous to have default executable code rather than
default executable object, but you could probably argue either way.
In any case, many of my worst moments with MS Windows systems are when
they decide a default action for me (e.g., insert a CD with WinXP and you
get a whole stupid menu). I am rarely troubled, on any platform, by
default objects (that I can recall).
--
Adam Kessel
http://bostoncoop.net/adam