Sponsored Content
Full Discussion: user input in perl?
Top Forums Shell Programming and Scripting user input in perl? Post 302595273 by Corona688 on Thursday 2nd of February 2012 01:51:09 PM
Old 02-02-2012
You read input from stdin by using the special STDIN file descriptor.

Code:
print "Type something and hit enter: ";
$LINE=<STDIN>;

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

geting user input from php and using perl for execution

I am using festival speech synthesis system and I would like to allow user input in a browser. This will be taken by a php page which is then supposed to pass the input text to a perl script. The perl script should pass this text to the festival engine by executing a unix command. this in turn... (2 Replies)
Discussion started by: wairimus
2 Replies

2. Shell Programming and Scripting

Executing program with Perl script but needs user input

Hello, I'm running a perl script to execute a program through my Unix command line. The program requires a user input but I want to automatically have perl input the string. Is there a way to do this? Thanks (1 Reply)
Discussion started by: leonard2352
1 Replies

3. Shell Programming and Scripting

Accepting user input and arguments in PERL

Hi All, Can we pass arguments while calling the perl script and as well as ask user input during execution of the script? My program is as below: I am passing arg1 and arg2 as argements to test.pl ]./test.pl arg1 arg2 Inside the test.pl I have : print "Do you want a name ? (y/n) : ";... (2 Replies)
Discussion started by: jisha
2 Replies

4. Shell Programming and Scripting

User input - Perl need Help

If I want all user input to start with " : " if not display error or what I asking is how to do if statement that control a first letter of string that we want to start with. and not worry about the rest Thank (1 Reply)
Discussion started by: guidely
1 Replies

5. Shell Programming and Scripting

List all file that match user input perl

Hi, I want to list all file that match user input ( specified shell wildcard) but when I compile it dont list me #!/usr/bin/perl -w print "Enter Advance Search Function: "; chomp ($func = <STDIN>); my @files = glob("$func"); foreach my $file (@files) { print "$file\n";... (1 Reply)
Discussion started by: guidely
1 Replies

6. Shell Programming and Scripting

every time user input create array perl

Hi, How to create array every time user input and store user input and display all array print " Enter input " my @input = split(' ', $input) chmop($input = <STDIN>; foreach ($input) { @array= @input; } print @array"\n"; (1 Reply)
Discussion started by: guidely
1 Replies

7. Shell Programming and Scripting

Validating uppercase/lowercase of user input with perl compared to unix folders

Hi, I need to copy files from a source directory to a destination directory in unix. I'm using the file::copy for the actual copy. The problem is that the source and dest directories are supplied by different users, who might type the name of the directories in various combinations of lower... (6 Replies)
Discussion started by: Furou
6 Replies

8. Shell Programming and Scripting

User input in perl code

Hello friends . I am newbie to perl scripting but still managed to write a code but i am stuck at a place where i need help . Below is the code and can someone help me in taking user input for changing the font size for a html table .Thank you in advance #!/bin/ksh echo " Enter the Directory... (4 Replies)
Discussion started by: ajayram_arya
4 Replies

9. Shell Programming and Scripting

Perl to read user input

I am creating a bash that uses perl . The below code closes before the input is entered. If I run the perl as a .pl it is fine. What am I doing wrong? Thank you :). #!/bin/bash cd 'C:\Users\cmccabe\Desktop\wget' wget -O getCSV.txt http://xxx.xx.xxx.xxx/data/getCSV.csv print... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. Shell Programming and Scripting

Checking the user input in perl for characters and length

My question is basically as the title says. How can I check a user inputted string is only certain characters long (for example, 3 characters long) and how do I check a user inputted string only contains certain characters (for example, it should only contain the characters 'u', 'a', 'g', and 'c')... (4 Replies)
Discussion started by: Eric1
4 Replies
YSH(1p) 						User Contributed Perl Documentation						   YSH(1p)

NAME
ysh - The YAML Test Shell SYNOPSIS
ysh [options] DESCRIPTION
This program is designed to let you play with the Perl YAML modules in an interactive way. When you to type in Perl, you get back YAML. And vice versa. By default, every line you type is a one line Perl program, the return value of which will be displayed as YAML. To enter multi-line Perl code start the first line with ';' and use as many lines as needed. Terminate with a line containing just ';'. To enter YAML text, start with a valid YAML separator/header line which is typically '---'. Use '===' to indicate that there is no YAML header. Enter as many lines as needed. Terminate with a line containing just '...'. To read in and process an external YAML file, enter '< filename'. The ysh will also work as a standalone filter. It will read anything on STDIN as a YAML stream and write the Perl output to STDOUT. You can say (on most Unix systems): cat yaml.file | ysh | less COMMAND LINE OPTIONS
-MYAML::Module Set the YAML implementation module you wish. -l Keep a log of all ysh activity in './ysh.log'. If the log file already exists, new content will be concatenated to it. -L Keep a log of all ysh activity in './ysh.log'. If the log file already exists, it will be deleted first. -r Test roundtripping. Every piece of Perl code entered will be Dumped, Loaded, and Dumped again. If the two stores do not match, an error message will be reported. -R Same as above, except that a confirmation message will be printed when the roundtrip succeeds. -i<number> Specify the number of characters to indent each level. This is the same as setting $YAML::Indent. -ub Shortcut for setting '$YAML::UseBlock = 1'. Force multiline scalars to use 'block' style. -uf Shortcut for setting '$YAML::UseFold = 1'. Force multiline scalars to use 'folded' style. -uc Shortcut for setting '$YAML::UseCode = 1'. Allows subroutine references to be processed. -nh Shortcut for setting '$YAML::UseHeader = 0'. -nv Shortcut for setting '$YAML::UseVersion = 0'. -v Print the versions of ysh and the YAML implementation module in use. -V In addition to the -v info, print the versions of YAML related modules. -h Print a help message. YSH_OPT If you don't want to enter your favorite options every time you enter ysh, you can put the options into the "YSH_OPT" environment variable. Do something like this: export YSH_OPT='-i3 -uc -L' SEE ALSO
YAML AUTHOR
Ingy doet Net <ingy@cpan.org> COPYRIGHT
Copyright (c) 2006, 2008. Ingy doet Net. Copyright (c) 2001, 2002. Brian Ingerson. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.1 2008-12-01 YSH(1p)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy