Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Damian ate my Makefile

by SilasTheMonk (Chaplain)
on Apr 23, 2010 at 15:34 UTC ( #836539=perlquestion: print w/ replies, xml ) Need Help??
SilasTheMonk has asked for the wisdom of the Perl Monks concerning the following question:

I recently bought and read Perl Best Practices. Generally my thoughts are that the book breaks down as follows:

15% of the book is clearly good and could by used by anyone without even needing to read the book, by just enforcing a subset of Perl::Critic.

5% of the book concerns inside-outside classes. While the concept is sort of beautiful, I don't think I want to even so much as start a flame war on that particular subject let alone actually use them.

The remaining 80% of the book probably does make perl better, more maintainable and more comprehensible BUT only to people who have read the book! A case in point would be extended regular expressions which I think are really scary if you just dived into the perl man page.

Anyway I was thankful to him that I could at last enforce a policy on indenting - until I needed to write a Makefile. Now all the tabs in the Makefile are spaces and its not really a Makefile any more. I suppose the solutions are to either use a different editor for Makefiles or to load a special config for Makefiles.

Comment on Damian ate my Makefile
Re: Damian ate my Makefile
by JavaFan (Canon) on Apr 23, 2010 at 15:53 UTC
    Hmmm, Damian uses vi (or a modern imposter), doesn't he? So, I guess you copied some vi macros and/or settings from him that turned tabs into space.

    Next time, if you really want a tab, enter it as ^V^I (control-V control-I). That should bypass any macros written by someone who isn't an evil genius.

    Oh, wait. You said Damian. He is an evil genius.

      Thanks. I'll give that a go.
Re: Damian ate my Makefile
by MidLifeXis (Monsignor) on Apr 23, 2010 at 16:57 UTC

    To enforce a policy for perl source files on a make source file is not a good, umm, policy.

    Use the right tool for the job. Emacs can set rules for indentation, syntax, etc based on the type of file. I believe that vi also allows you to do that. Do not run perltidy on your makefile, run maketidy (is there such a beast?). Same as you would not run htmltidy, lint, or other inappropriate code cleaners on your perl file.

    My wife is walking for a cure for MS. Please consider supporting her.

Re: Damian ate my Makefile
by assemble (Friar) on Apr 23, 2010 at 17:57 UTC
    I use the following line in my .vimrc to fix Make files:
    "Fix Make files: autocmd FileType make set noexpandtab
    Should fix you right up!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://836539]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2015-07-03 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls