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

  • Home
  • SEARCH
  • 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 7531989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:19:21+00:00 2026-05-30T05:19:21+00:00

CGI-style perl scripts are hard to test in this style: def test_it_says_hello_to_a_person get ‘/home.pl’,

  • 0

CGI-style perl scripts are hard to test in this style:

def test_it_says_hello_to_a_person
   get '/home.pl', :name => 'Simon'
   assert last_response.body.include?('Simon')
end

(Note: the code is in ruby, using Rack::Test).

But if I can turn static file to a PSGI application
(A code reference, accept $env as parameter, return [$status, $header, $body]), things will be easy, and Plack::Test will do the rest.

I am reading PSGI specification, generally I can see the route to this. But I still want to know is there any existence wheel to this?

Also, I think Plack::Test‘s interface is not as beautiful as Rack::Test, any Alternatives?

  • 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-30T05:19:24+00:00Added an answer on May 30, 2026 at 5:19 am

    I think you want to look at Plack::App::WrapCGI. When you give it a Perl script as an argument, it uses a technique similar to ModPerl::Registry to compile your CGI script into a PSGI app. And even if it can’t figure out how to do that, it has the ability to emulate a complete CGI environment from a PSGI environment, meaning that it can fork and exec a bona fide CGI script (even one written in another language) and run it under any sort of Plack handler, including Plack::Test.

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

Sidebar

Related Questions

I have a Perl CGI script that creates a login screen, i.e. user name
I’m working on a Perl CGI script about 4000 lines big. Our coding style
I have two divs <div id=leftdiv><!--#exec cgi=test.cgi--></div> <div id=rigthdiv > <iframe name=rigthdiv class=contentiframeallowTransparency=true frameborder=0
CGI scripts should have access to a list of environment variables set by the
Why cgi scripts have to stay in cgi-bin folder ? What is the difference
using Fast CGI I can't get it to read the php.ini file. See my
I have a perl cgi script that's fairly resource intensive (takes about 2 seconds
HI. I created two files 'hello.pl' and 'hello.cgi' with the code below. #!/usr/bin/perl print
So I wrote a simple html 1.0 server, and I have some perl scripts
This is my first time programming with both perl and databases, I'm having some

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.