in reply to Re: Passing a parameter to a callback
in thread Passing a parameter to a callback

I'm not sure I follow what you're trying to say here. I didn't do any special indentations... in my submitted source code *none* of the comments were indented.

Please explain further...

Where do you want *them* to go today?
  • Comment on Re^2: Passing a parameter to a callback

Replies are listed 'Best First'.
Re^3: Passing a parameter to a callback
by runrig (Abbot) on Jul 19, 2006 at 22:02 UTC

    The comments diotalevi is referring to are the lines below the function definitions, which (I assume) are meant to highlight the function names. He is saying that those lines, being unindented after a '{' defining a new code block, are wrong (would he like it more if the "{" came after the comment line? I don't know). I would disagree since highlighting the function name like that is a somewhat common practice (though I wouldn't do it), so I'd say it's somewhat acceptable, although perltidy doesn't have an option to handle it, so you will lose the formatting if your program is ever run through perltidy. I've seen the practice a lot in other languages (that don't use {} for blocks mostly) but not much in perl.

    The other unindented comment is where you have "# Now stat the file to compare its modification time", which I assume is a temporary placemarker for actual code and so I wouldn't really worry about that either since making markers like that ugly make them easy to find when you need to replace them.

Re^3: Passing a parameter to a callback
by diotalevi (Canon) on Jul 19, 2006 at 21:48 UTC

    Yes, that's the problem. I've just told you that the way your formatted your code isn't any good. It destroyed important information. It's as close to having no indentation as is possible while still having some.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      You're not being especially constructive here...

      Are you saying that I mistakenly included a comment line just after the "sub" declaration? My bad...

      You'll notice that lines within a sub (with the one above exception) are indented one level, and everything *not* in a sub is *not* indented.

      This isn't how it should be done???

      If I may ask, how would you have done it?

      Where do you want *them* to go today?
      A reply falls below the community's threshold of quality. You may see it by logging in.