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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:14:51+00:00 2026-05-25T12:14:51+00:00

I had requirement to send command to remote device and whenever it ask for

  • 0

I had requirement to send command to remote device and whenever it ask for “Press CTRL+C to break, other key to continue…” I should again send “Enter key” to remote device.

I have written below scritpt but somehow it doesn’t work.

my $session = new Net::Telnet (
    Timeout => 30, 
    Prompt=> '/>/', 
    Input_log  =>\*STDOUT
);
$session->open('device-id');
$session->login('admin','admin');

print "connected and logged in \n\n"; 
print "Kindly wait till output stored in FILE \n\n";

my @output1=$session->cmd('DSP PATCH:;');
if ($session->waitfor('/Press CTRL+C to break, other key to continue.../')) {
    $session->print('');   # Assuming default is \n for print command
}

print @output1;

Output of above script is


connected and logged in

Kindly wait till output stored in FILE

.

.

some output of command send...........

.
Press CTRL+C to break, other key to continue...

and then it timeout.

Any idea how to send enter hit till my remote device ask me to hit enter.

  • 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-25T12:14:52+00:00Added an answer on May 25, 2026 at 12:14 pm

    The cmd method sends a command and waits for the prompt. Instead, either run your command using print and waitfor (most likely saving the returned prematch), or override the prompt for that cmd call with the remote message. I’d suggest doing the former.

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

Sidebar

Related Questions

I had a requirement where in the text field the first character should be
I had a small requirement of making a specific attribute as primary key, such
I had requirement where user should add only specific type of links as part
I had a requirement where I need to clear off the select all checkbox
Hii, I had a requirement of encode a string provided to a unreadable format
I am working on a database application in C#. I had a requirement to
We recently had a new requirement to use the phonon component of Qt, which
Had a coworker ask me this, and in my brain befuddled state I didn't
Giving small background to my requirement and what i had accomplished so far: There
I had a project requirement which was to stream video to people across the

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.