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.