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

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.


Comment on Re: MoleSter update - Golf
Download Code
Re^2: MoleSter update - Golf
by cLive ;-) (Parson) on Jan 07, 2005 at 17:41 UTC
    Ah, good point. Serves me right for not reading the docs :)

    cLive ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-09-18 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (113 votes), past polls