Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Golf Soccer Stats

by jynx (Priest)
on May 23, 2002 at 19:22 UTC ( #168883=note: print w/replies, xml ) Need Help??


in reply to Re: Golf Soccer Stats
in thread Golf Soccer Stats


For some reason,

Many people believe that the shortest way to get arguments is either all at once or not at all. Usually i have found this not to be the case. For instance, coupling your statements with your argument pulling i get 46:

sub ss{ #23456789_123456789_123456789_123456789_123456789_ $l=-($t=$_[1]%3)-($w=(-$t+pop)/3)+pop;$w,$l,$t }
And if i couple the assignments with the return statement, i can shave off another 8:
sub ss2{ #23456789_123456789_123456789_123456789_123456789_ $w=(-($t=$_[1]%3)+pop)/3,-$t-$w+pop,$t }
They seem to test out correctly, but i didn't test all that extensively (engineer's test: if it works 3 times for 3 different input it must work for everything :)

jynx

update: it strikes me that i am using a personal definition that i should elaborate on slightly. i think of "pulling arguments" as using pop, shift, or @_ to take an argument out of @_ and assign it to another variable. Not doing so is using $_[$x] directly throughout.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168883]
help
Chatterbox?
[marto]: they still don't know there was a problem, nobody told them! :P
[Corion]: marto: Ow! I would assume there is a cron job monitoring the free disk space and automatically opening a ticket at 90%, 95% and 100% usage...
[Corion]: Even we had automatic emails back when we maintained the machine ourselves...
[marto]: Corion you under estimate how lazy these admins are :P
[Discipulus]: we too; using opsview alarms
[marto]: the key word: outsourcing ;)
[Corion]: marto: Yeah, feels like that ;) You could set up the cronjob that auto-creates tickets :-))
[marto]: the ticketing system does not accept calls via email, nor has it a working API. It's tied into Active Directory for authentication and the Solaris boxes aren't on that domain
[Corion]: The one thing I haven't figured out a solution to is how to get an edge-trigger instead of sending an email every 5 minutes if the usage is above 90%. I want one mail when it goes over 90% but no more emails as long as it stays between 90% and 95%.
[Corion]: marto: Clever! ;)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-01-24 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.