Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Print perl source code in compiled script...

by Old_Gray_Bear (Bishop)
on Feb 09, 2012 at 16:47 UTC ( #952783=note: print w/ replies, xml ) Need Help??


in reply to Print perl source code in compiled script...

One Word -- git. (Or SVN, or CVS, or Perforce, even) Get into the Source Control habit now.

----
I Go Back to Sleep, Now.

OGB


Comment on Re: Print perl source code in compiled script...
Re^2: Print perl source code in compiled script...
by oko1 (Deacon) on Feb 09, 2012 at 21:15 UTC

    Where'd that bloody '++++++++' button go, now...

    Yeah. What Old_Gray_Bear said, in triplicate. If you're too lazy to do it manually (<cough> like a certain programmer whom I see in the mirror every morning...), configure your editor to automatically 'svn ci' what you're working on at every save, at least for your code.

    This has saved my bacon not just once, nor even twice. In various emergency and non-emergency situations, in a large variety of blowups, code rollbacks, other-programmer-caused problems, and in one case, a computer catching fire while I was at lunch (!), I would estimate the bacon-saving efficacy of that little hack at a couple of dozen.

    Don't get caught without it. :)

    -- 
    I hate storms, but calms undermine my spirits.
     -- Bernard Moitessier, "The Long Way"
Re^2: Print perl source code in compiled script...
by davido (Archbishop) on Feb 09, 2012 at 22:30 UTC

    One word -- git.

    One more word: Bingo! (git is the answer to preventing this situation in the future.)

    And a few more words...

    How do I do that?

    Spend a few hours one evening reading Pro Git (free). Spend a few hours tinkering, reading man-pages, tinkering some more.

    Set up a local repo in one of your project's working directories. Set up a "bare" repo on a NAS you have mounted, or on a physically separate box to which you have SSH access. Learn how to commit, branch, merge, and push your local repo to the mounted or SSH-available one (for safe keeping).

    And if you really like learning it backwards and forwards, read Version Control with Git from O'Reilly.

    I recommend both Pro Git and Version Control with Git, and I would read them both in that order. The latter doesn't discuss Github at all, but is more thorough in just about every other way. The former is a gentler introduction, I think. Both are valuable.

    Then keep in mind the philosophy that anything worth working on is worth committing to version control.

    Now for a humorous quote:

    "Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it ;)"
    -- Linus Torvalds, (1996-07-20). Post. linux.dev.kernel newsgroup. Google Groups. Retrieved on 2006-08-28.

    I think if Linus had created Git before coining this quote he would have said it more like this: "...real men just upload their important stuff onto an open source git repository, and let the rest of the world fork and clone it. ;)" And if he were a Perl enthusiast he may have mentioned CPAN too. :)

    Of course not everything belongs in an open source repo or on CPAN, but Git is great for private projects and local non-distributed version control too. At minimum setting up a bare repo and pushing local commits to it will ensure that you have two copies of the project's entire history; more if your repos themselves are part of an automated backup plan.

    Update: How could I forget merlyn's excellent Git talk? Follow the link for the video that includes Randal and his slides. It's just under two hours, and time well spent.


    Dave

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-12-28 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls