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 127613
In Process

The Archive Base Latest Questions

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

I have a page written in Perl by someone else. I don’t know Perl,

  • 0

I have a page written in Perl by someone else. I don’t know Perl, so I wrote a PHP file that right now just links from the Perl page. What I’d like to do is embed the PHP file in the Perl file if the perl page has been passed a certain variable. If I were using PHP for both I could just do

if ($_GET['sidebar']) include 'embedded.php'; 

I know there are ways to read text files in Perl, but can I include a PHP file within a Perl file?

I’m assuming it wouldn’t work because they’re processed by different parts of the server, so no high hopes, but maybe someone’s tried something like it.

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

    If you simply want to include the resulting output (HTML, etc.) of the PHP script into the perl-generated page you can use backticks to call either the PHP script via php-cli, like this:

    First, the test.pl script:

    [root@www1 cgi-bin]# cat test.pl #!/usr/bin/perl print 'This is a perl script\n'; my $output = `php test.php`; print 'This is from PHP:\n$output\n'; print 'Back to perl...\n'; exit 0; 

    Next, the test.php script:

    [root@www1 cgi-bin]# cat test.php <?php  echo 'PHP generated this';  ?> 

    Here’s the output of running ‘test.pl’:

    [root@www1 cgi-bin]# perl test.pl This is a perl script This is from PHP: PHP generated this Back to perl... 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page written in PHP that has a playlist of songs. When
I have written a django page that requires only super users to login. So
I have written a simple code in page test_cookie.php to work with cookies. if(isset($_GET['data']))
I have written an GWT app and a static Intro page that introduces the
I have written a page that will scan a site and then extract certain
Working on making an inventory page for work. I have written a page that
I have written a Perl CGI script which fetches an html page from a
I have a single page application written in MVC4 that uses pjax() to push
Let's say we have a page written in PHP. This page loads by it
I want to have a web page (written in php because it's what i

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.