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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:14:48+00:00 2026-06-11T05:14:48+00:00

I have a strange behaviour with Perl’s say function in FCGI mode. Newlines won’t

  • 0

I have a strange behaviour with Perl’s say function in FCGI mode. Newlines won’t be append. Why does this happen?

Sample code:

#!/usr/bin/perl -wT
use strict;
use warnings;
use utf8;
use feature qw( say );
use FCGI ();
use CGI qw( header );
my $cnt = 0;
my $req = FCGI::Request();
while ( $req->Accept() >= 0 ) {
    $cnt++;
    print header( -type => 'text/plain', -charset => 'utf-8' );
    say "Hello, world #$cnt";
    print "\n";
    print "$$\n"
    print 'Test 1234';
}

Expected result (and actual result via console):

Content-Type: text/plain; charset=utf-8

Hello, world. #1

6712
Test 1234

Actual result via Apache/FCGI:

Content-Type: text/plain; charset=utf-8

Hello, world. #3
6709
Test 1234

Some software info…

Debian Wheezy x86_64
Apache/2.2.22-11
mod_fcgid/1:2.3.6-1.1
Perl/5.14.2-12
FCGI.pm/0.75-1+b1

  • 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-06-11T05:14:50+00:00Added an answer on June 11, 2026 at 5:14 am

    Unfortunately the implementation of the say() function requires the filehandle to support the $\ variable. Basically say is equivalent to writing:

    { local $\ = "\n"; print LIST }
    

    Using FCGI, your STDOUT is replaced by a tied filehandle, which doesn’t support $\. This means that say() doesn’t work as intended. Whether this is a bug in FCGI or in say() seems to be debatable.

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

Sidebar

Related Questions

Why this two functions have the strange behaviour of when I click on thead,
I have a strange behaviour when autowiring I have a similar code like this
I have this strange behaviour in VS2010 where any modifications I make to keyboard
I'm seeing a strange behaviour, hopefully someone out there can explain this. I have
I have several forms with this strange behaviour. For instance I have this form
I have a strange behaviour, maybe I'm missing something. I have this DOM element
This is a very strange behaviour. If I have something like this (time interval
I have noticed a strange behaviour of a str_replace function. Can you tell me
I have a strange behaviour with the code below: function update(txt, _) { #text
I have a strange behaviour of my phonegap app on Android. I'm using this

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.