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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:26:49+00:00 2026-05-29T07:26:49+00:00

I need to clear the printed values in perl console window. For an example,

  • 0

I need to clear the printed values in perl console window. For an example,
Note: I am developing this in Windows OS.

use strict;

my $mode;

Initialize();

sub Initialize{
    print "Enter 1 or 2";
    $mode=<STDIN>;
    chomp($mode); 
    check_mode($mode);
}

sub check_mode{
    if(($mode!=1) and ($mode!=2)){
        print "invalid selection";
        Initialize();
    }
    else{
        print "valid selection";
        sleep 5;
   }
}

While entering wrong selection, I have called the Initialize function, it is printing again. But, what I want is while calling the function it should delete already printed value in the console window and it should print again. Is it possible?

Please give your valuable suggestions.

  • 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-29T07:26:50+00:00Added an answer on May 29, 2026 at 7:26 am

    for specific to window os and linux os

    system($^O =~ /win/i ? 'cls' : 'clear');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clear the read-only flag of a file in my Perl program
I need to clear the default values from input fields using js, but all
I need a very simple and clear example of how to create an OCX
I need to clear all my inventory tables. I've tried this: SELECT 'TRUNCATE TABLE
I need to clear all APC cache entries when I deploy a new version
I had a requirement where I need to clear off the select all checkbox
Do I need to release a Core Foundation objects to clear up memory? And
It's not clear to me if the Eclipse plugin completely replaces the need to
i need to clear the data on serial port when i have read the
I need to clear many tables (preferably truncate table). But tables have many FK

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.