Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7127817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:04:20+00:00 2026-05-28T11:04:20+00:00

I’m using TextMate 1.5.10 (Mac OSX 10.7.2) to write a perl modulino application .

  • 0

I’m using TextMate 1.5.10 (Mac OSX 10.7.2) to write a perl modulino application. To verify the functionality, I’m using test scripts designed to be run with the prove command line tool.

An example of the directory structure I’m using looks like this:

text_mate_test/MyModule.pm
text_mate_test/t/001_load_test.t

The 001_load_test.t file looks like this:

#!/usr/bin/perl 

use Modern::Perl;
use Test::More;
use MyModule;

my $testObj = new_ok("MyModule", undef, "Initial load test.");

done_testing();

When I run prove or prove -v in the “text_mate_test” directory, everything passes as expected.

I’d like to be able to setup a hotkey in TextMate that allows me to run the test file without having to jump over to the terminal. Currently, if I run “001_load_test.t” directly from inside TextMate with Cmd+R, it chokes saying “Can’t locate MyModule.pm in @INC”. That’s expected since the test script isn’t designed to run directly. (I’m still pretty new to writing test files, but I believe that’s the proper way to set them up.)

Running off the assumption that I don’t want to change the test file itself, is there a way to setup a hotkey so I can run the file accurately from inside TextMate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:04:20+00:00Added an answer on May 28, 2026 at 11:04 am

    I’ve figured out an even better way to do this.

    In the TextMate Bundle Editor (Menubar -> Bundles -> Bundle Editor -> Show Bundle Editor), I’ve updated the default “Perl -> Run Script” bundle to this:

    #!/usr/bin/env ruby
    
    require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor"
    require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/save_current_document"
    
    TextMate.save_current_document
    TextMate::Executor.make_project_master_current_document
    
    ### If it's a ".t" test script in a "t" directory, run prove
    if ( ENV["TM_FILEPATH"] =~ /^.*\/(t\/[^\/]+)$/ )
    
        ### Grab the relative file path for more legible output
        relative_file_path = $1
    
        ### Jump up one directory so prove will work
        Dir.chdir("../");
    
        ### Call prove with args to run only the file you are working on.
        TextMate::Executor.run("prove", :script_args => ["-v", relative_file_path]);
    
    ### Otherwise, run with perl
    else
        TextMate::Executor.run(ENV["TM_PERL"] || "perl", "-I#{ENV["TM_BUNDLE_SUPPORT"]}", 
            "-Mexception_handler", ENV["TM_FILEPATH"], 
            :version_args => ["-e", 'printf "Perl v%vd", $^V;'])
    end
    

    Here’s a screenshot of how it looks in the Bundle Editor.

    TextMate Bundle Editor Screen Shot for using prove to run perl test scripts

    The benefit of this is that you can use the same hot key (Cmd+r by default) to run your normal scripts with perl and your test scripts with prove.

    This is what I was looking for.


    UPDATED: When I first developed this, I only had one test script in the “t” directory. I didn’t notice until I added other test scripts that the code in the original version of this answer would run prove across all the scripts. Not just the one being worked on. To get back to the expected behavior, I’ve update the bundle code so that prove will only run on the active script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.