02-15-2009
Taking user response in perl
I was wondering if it was possible to take in a user's response in a perl program.
For example.
Ask user a yes or no question, and then depending on the response, print out a corresponding answer?
Thanks!
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Would there be any reason for why a 'read ans' would not wait for a user's response (i.e user has to hit a key to continue)? I know for sure that it is doing everything else in that part of my 'if' statement but it doesn't wait for me to hit a key before continuing.
The strange thing is that... (4 Replies)
Discussion started by: giannicello
4 Replies
2. Shell Programming and Scripting
How would i go about the following,
I open a text document with loads of text, about 150 lines
e.g. "Best Time: 02:55.88"
How would i get perl just to take the time and put into a variable but also be able to take any time like that from the file??
i've done this so far to open the... (2 Replies)
Discussion started by: perleo
2 Replies
3. Shell Programming and Scripting
Hi,
I am new to perl
I need to connect from linux server to oracle database and i need to query the database and take result into csv file.
i try to do but i am getting this error:
#!/usr/bin/perl
use DBI;
BEGIN {
$ENV{ORACLE_HOME} = '/home/oracle/product/8.1.7';
... (1 Reply)
Discussion started by: prakash.gr
1 Replies
4. Shell Programming and Scripting
I am using the following code in a CShell script to get a yes/no response from the user:
echo ""
echo -n "Do you want to archive your main level directory? <y> or n: "
set main_answer = $<
Is there a way to extract the first letter from the user's response and then perhaps convert that... (4 Replies)
Discussion started by: phudgens
4 Replies
5. Shell Programming and Scripting
Hi All,
I am facing a problem while taking input from user in Shell Script. Basically , I want to read a file line by line. And I want to remove certain lines of that file.But before removing those lines , I need to ask the user whether user wants to remove the lines. If user inputs "Yes" , the... (3 Replies)
Discussion started by: swapnil.nawale
3 Replies
6. Shell Programming and Scripting
Need help in scripting . Below is the situation and need your inputs
Checking all the processes, scripts running time based on user input time . Below Example
ps -aef -o user,pid,etime,stime,args| grep sleep
<user> 28995 01:24 14:14:39 sleep 120
<user> 29385 00:52 14:15:10... (8 Replies)
Discussion started by: ajayram_arya
8 Replies
7. Shell Programming and Scripting
Dear community, I'm going crazy to convert TCP response to HEX using perl. I have a simple connection request where I send data, something like:
use strict;
use IO::Socket;
my $sock;
$sock = new IO::Socket::INET(
PeerAddr => '192.168.10.7',
PeerPort =>... (1 Reply)
Discussion started by: Lord Spectre
1 Replies
8. Shell Programming and Scripting
In the bash below I am trying to run the script entire script including the ....(which is a bunch of code) and then in the run function if the user response is y (line in bold). then start processing from execute function. Basically, goto the # extract folder for variable filename line and start... (4 Replies)
Discussion started by: cmccabe
4 Replies
9. Shell Programming and Scripting
I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade.
I have:
if ( $response =~ m/^/ ) {
$user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
LEARN ABOUT DEBIAN
www::cnic::response
WWW::CNic::Response(3pm) User Contributed Perl Documentation WWW::CNic::Response(3pm)
NAME
WWW::CNic::Response - base class for WWW::CNic response objects.
SYNOPSIS
use WWW::CNic;
my $query = WWW::CNic->new( OPTIONS );
my $response = $query->execute();
DESCRIPTION
This is the base class for all response objects returned by WWW::CNic. Each query type returns a different object, all of which inherit
their basic functionality from this module.
This module should never be accessed directly, only through its children.
METHODS
All the child classes of WWW::CNic::Response inherit the following methods:
$response->is_success();
This returns true if the transaction was completed successfully. If there was a server-side error due to invalid data or a system error, or
there was an HTTP error this method will return undef.
$response->is_error();
This is the converse of "is_success". It returns true if there was an error.
$response->error();
This returns the error message generated, if any. This can be either a server-side error message or an HTTP error.
$response->message();
This returns the message returned when the transaction was successful.
$response->keys();
This returns an array containing all the keys returned by the server.
$response->response($key);
This returns the value corresponding to $key as returned by the server. This may be a scalar, or a reference to an array or hash, depending
on the context.
$response->dump();
This prints a human-readable dump of the data stored in the object to "STDOUT". Mainly useful in debugging.
COPYRIGHT
This module is (c) 2011 CentralNic Ltd. All rights reserved. This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
SEE ALSO
o http://toolkit.centralnic.com/
o WWW::CNic
perl v5.12.3 2011-05-13 WWW::CNic::Response(3pm)