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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:26:08+00:00 2026-05-23T21:26:08+00:00

novice Perl programmer here!. I’m using the system() function to get the return code

  • 0

novice Perl programmer here!.
I’m using the system() function to get the return code for an external program (in this case – php), however, the command’s output is still printed to the screen.
How do I prevent it from doing so?
My code is:

use strict; use warnings;
print 'Return code:', system('php -l wrong.php'), "\n";

This code does print the return code, but it also print the the output of the command executed.

Any help will be appreciated!

EDIT: further testing shown that this happens while only using the php lint command.. using it with other commands doesnt print anything…

  • 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-23T21:26:09+00:00Added an answer on May 23, 2026 at 9:26 pm

    If you are on a UNIX-like OS, you should be able to redirect the output in the command:

    Try:
    system('php -l wrong.php >> /dev/null') to get rid of what’s being sent to stdout.

    You could also open the command with a pipe to handle the output directly, which should be more portable.

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

Sidebar

Related Questions

I'm a complete perl novice, am running a perl script using perl 5.10 and
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once db_login.php
I am a novice programmer who is trying to teach myself to code, specifically
I'm a very novice OCaml programmer so please forgive me if this is a
Am fairly new to using MySQL and a total novice at Perl but am
Here is client Side code: jQuery(document).ready(function(){ jQuery(#list).jqGrid({ url:'example.php', datatype: 'xml', mtype: 'GET', colNames:['Inv No','Date',
here's my first ever perl program: I want to make sure that if I'm
I have this code #!/usr/bin/perl use strict; my @a = (b,a,d,c); my %h =
I am a AS3 novice learning PureMVC and want to write code following best
I am novice in sharepoint programming. I have a following code: SPWorkflowTask task =

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.