Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: What's your programming style?

by Anonymous Monk
on Dec 11, 2018 at 04:50 UTC ( [id://1227079]=note: print w/replies, xml ) Need Help??


in reply to What's your programming style?

#!/usr/bin/perl use strict; use warnings; use Config '%Config'; sub GetPathnameSeparator { =head2 GetPathnameSeparator Return the character used to separate elements in the command shell search PATH. =cut return $Config{path_sep} }

Replies are listed 'Best First'.
Re^2: What's your programming style?
by syphilis (Archbishop) on Dec 11, 2018 at 06:23 UTC
    return $Config{path_sep}

    I don't think that's the "separator" the OP's code is looking for.
    $Config{path_sep} returns the symbol that separates the pathnames in $ENV{PATH}, but I believe the OP's code is looking for the symbol that separates the individual directories within a pathname.

    Cheers,
    Rob
      I don't think that's the "separator" the OP's code is looking for.

      OP is looking for style, not functionality. Document your subs!

        Agree that POD is a million times better than # Comments. POD inside the sub though is incredibly jarring to me. I don't even like it between subs. I like to wear one hat at a time and code and documentation are polar opposites to my creative flow and focus. I deeply appreciate Perl's flexibility with POD but I personally will always only put POD in the __END__ of packages and scripts. Like a manual for a car, I think the real documents should not even be attached. Comments are a fine substitute for things like # Oil or # + and # - engraved on a part though.

Log In?
Username:
Password:

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

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

    No recent polls found