Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: MoleSter update - Golf

by dragonchild (Archbishop)
on Jan 07, 2005 at 13:53 UTC ( #420247=note: print w/replies, xml ) Need Help??

in reply to MoleSter update - Golf

You cannot change how @ARGV is processed because one of the features of the app is to be able to launch it and have it look for files right off the bat. That's what that shift is there for within the for-loop. By changing to use pop, you have to now put the filenames you want to find, then the connection args, as opposed to the connection args before the optional filenames.

As for the three characters you chop by removing ampersands from two calls to a() and one call to h(), that also doesn't work. The reason for the ampersands is to pass on @_. Removing the ampersands doesn't do that, as demonstrated by this snippet:

sub a { print "'@_'\n"; } sub b { &a } sub c { a } b( 'foo' ); c( 'foo' ); -------- 'foo' ''

Additionally, you actually gained characters by not linebreaking at whitespace. If you look at the original, all five linebreaks were at places where whitespace was required. Matt Skala (the author) and I* spent hours figuring out how to arrange the functions so that every linebreak was consuming some piece of whitespace while still allowing for the use of the ampersand notation. It's a lot harder than it looks.

I'm sure there's 2-3 characters that can be shaved, but I'll be damned if I know where they are ...

* I'm the Rob Kinyon he mentions on his page.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: MoleSter update - Golf
by cLive ;-) (Prior) on Jan 07, 2005 at 17:41 UTC
    Ah, good point. Serves me right for not reading the docs :)

    cLive ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://420247]
[naga7667]: hi

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2017-09-26 15:58 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (296 votes). Check out past polls.