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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:51:09+00:00 2026-05-15T08:51:09+00:00

I am first and foremost a perl coder, but like many, also code in

  • 0

I am first and foremost a perl coder, but like many, also code in PHP for client work, especially web apps.

I am finding that I am duplicating a lot of my projects in the two languages, but using different paradigms (e.g. for handling cgi input and session data) or functions.

What I would like to do is start to code my Perl in a way which is structured more like PHP, so that I
a) am keeping one paradigm in my head
b) can more quickly port over scripts from one to the other

Specifically, I am asking if people could advise how you might do the following in perl?

1) Reproduce the functionality of $_SESSION, $_GET etc.
e.g. by wrapping up the param() method of CGI.pm, a session library?

2) Templating library that is similar to PHP
I am used to mixing my code and HTML in the PHP convention. e.g.

<h1>HTML Code here</h1>
<?
 print "Hello World\b";
?>

Can anybody advise on which perl templating engine (and possibly configuration) will allow me to code similarly?

3) PHP function library
Anybody know of a library for perl which reproduces a lot of the php built-in functions?

  • 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-15T08:51:10+00:00Added an answer on May 15, 2026 at 8:51 am

    Have a look at EmbPerl.

    It’s a Perl based templating system, which seems to provide anything that PHP does based on my admittedly very small knowledge of PHP.

    To cover your specific points:

    • $_GET : EmbPerl provides %fdat hash which contains full set of form data passed via either POST or GET

      %fdat makes no distinction of whether the value originated in GET’s query string or form field via POST).

      If you absolutely MUST have only the values from GET’s QUERY_STRING, here’s a simple example of a function to get it: http://urlgreyhot.com/personal/resources/embperl_getting_values_query_string – although why would you want to separate GET from POST data is escaping me at the moment.

    • $_SESSION : I’m not 100% I get what this does in PHP but if I’m right, there’s %udat for per-user data and %mdat for per-module/page data for handling session stuff.

      Using both is described in more detail in “Session Handling” area of EmbPerl docs, along with all the other multitude of session support in EmbPerl

      Here’s a quick %udat blurb:

      … as soon as you write anything to %udat, Embperl creates a session id and sends it via a cookie to the browser. The data you have written to %udat is stored by Apache::Session. The next time the same user request an Embperl page, the browser sends the cookie with the session id back and Embperl fills the %udat hash from Apache::Session with the same values as you have stored for that user.

    • The templating code you included would look like this in EmbPerl:

         <h1>HTML Code here</h1>
         [-
          print OUT "Hello World!";
         -]
      

      Or for a more idiomatic/correct solution,

         <h1>HTML Code here</h1>
         [+ "Hello World!" +]
      

      P.S. I have no clue what “\b” does in PHP so I didn’t clone that.

      Embperl supports all the standard templating stuff ([- -] for execution, [+ +] for inclusion of results of arbitrary Perl code, template flow control commands ([$ if $]/'[$ for $]` etc…) and much more. It’s also fully compatible with mod_perl.

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

Sidebar

Ask A Question

Stats

  • Questions 484k
  • Answers 484k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all you passes pointer to set by value.… May 16, 2026 at 7:20 am
  • Editorial Team
    Editorial Team added an answer It is a "block", a new feature Apple added to… May 16, 2026 at 7:20 am
  • Editorial Team
    Editorial Team added an answer You can figure out what the old path is by… May 16, 2026 at 7:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.