Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You actually cannot use pop instead of shift in the first line unless you rearrange the argument list order. The same goes for most of the subroutines.
WOW! Thank you so much for having pointed out so: I would have never imagined myself...

What I wanted to stress is that even for a mediocre golfer like me at a first glance the code, despite some evident conciseness still was largely suboptimal from this point of view for just applying a standard golfing technique like using pop() instead of shift() (and reversing the order of the arguments - pointing out the obvious, just to keep you satisfied) wherever applicable would have saved quite a lot charachters.

But then it's well known that experienced golfers use any sort of more refined tricks. For example I can remember one case in which there were four arguments to take from the cmd line and it was practically mandatory to assign these to variables so they used something along the lines of this (since the golf rules did not require strictures or warnings): $$_=pop for a..d;

You cannot use open F,pop; because there are 3 args coming in, not 2.
Huh?!?
The &x() syntax is actually the golfed version in several places, particularly &$3($2,$4,$');. Now, in others, it can be removed. But, I sincerely doubt it has anything to do with the author's skills as a programmer. Personally, I'm impressed with a P2P client in under 1000 characters.
Well, indeed if we're talking symrefs then you're right. It may also save some chars in other situations. Generally with modern enough perls the &-syntax does not do what one expects, and as a matter of a fact unless there's a really good reason to adopt it (and indeed in golfing and obfuscation games there may be some well beyond "regular" ones), code that abuses it reveals that he/she who wrote it is still programming Perl4. I'm not sure if this is the case with this particular program, but this is the impression I got at a quick glance.

In reply to Re^3: P2P Golf: MoleSter by blazar
in thread P2P Golf: MoleSter by hossman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found