Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Perl said method B if A judge     - PostgreSQL Stream Configuration (Database)

- OpenStack image production in the CentOS 6.2 (Linux)

- Linux Getting Started Tutorial: How to set up a static MAC address on VMware ESXi virtual machine (Mobile)

- The istgt PSD on ported to Mac OS X (Linux)

- Linux environment RabbitMQ installation and monitoring of plug-in installation (Linux)

- Linux file system data file deletion problem space is not freed (Database)

- Use this one-time password via SSH secure login Linux (Programming)

- Android project using the command to create and install the package (Programming)

- Json data with double backslashes to a single backslash Json data processing (Programming)

- Install Mac OS X 10.9 systems VMware10 (Linux)

- Experience PHP 7.0 on CentOS 7.x / Fedora 21 (Server)

- How to install Ubuntu applications Device 7 (Linux)

- Repair Raspbian Encountered a section with no Package (Linux)

- Linux basic introductory tutorial ---- Software Installation under Linux (Linux)

- By creating a personal technology blog Detailed GitHub (Linux)

- Linux operating system security settings initial understanding (Linux)

- MyCAT separate read and write to achieve MySQL Practice (Database)

- ORA-12537: TNS: connection closed error process (Database)

- Ubuntu deployed under regular tasks with crontab (Linux)

- Nginx logging client ip (Server)

  Perl said method B if A judge
  Add Date : 2017-09-18      
  Perl provides another "if A then B" representation. Modifiers can be added if the general statement that the conditional expressions on the back, such as:

some_statements if condition;

In this statement, for example, if the condition is true, then execute some_statements section. Such wording identical with the following wording:

if (condition) {

Here are some similar usage:

expression unless condition; ## similar unless (condition) {expression};
expression while condition; ## similar while (condition) {expression};
expression until condition; ## similar until (condition) {expression};

The above statements are executed first condition, it decides whether to perform genuine expression.

Modifiers must be a simple expression, not a statement block.

Although the condition determination written on the back, but it is first run.

The other two "if A then B" representation:

this && that;

this || that;


#! / Usr / bin / perl -w
@a = (97..122);
@b = ( 'a' .. 'z');
@a == @b && print ( "They are equal \ n");
@a == @b || print ( "They are not equal \ n");

Logic procedures are as follows:
Table @a equal list @b, the front part of the third statement is true, the statement following && continue output "They are equal"; fourth statement, because the front is true, the statement following the || is not executed.
Table @a is not equal to the list @b, the front part of the third statement is false, it is no longer execute the statement following &&; fourth statement, because the front is false, so it needs to execute the statement following the output "They are not equal ";
- Oracle 11g maintenance partitions - Adding Partitions (Database)
- Linux firewall iptables beginner tutorial (Linux)
- Composition and dynamic memory allocation C program (Programming)
- MySQL Error Code Complete (Database)
- Repair Chrome for Linux is (Linux)
- SUSE Linux install Oracle 10g and problem solving (Linux)
- Use pg_basebackup build PostgreSQL streaming replication environment (Database)
- C # get the current screenshot (Programming)
- Install Web-based monitoring tool: Linux-Dash (Server)
- Docker + OpenvSwitch build experimental environment VxLAN (Server)
- Ubuntu 14.04 / 14.10 how to install Mate 1.10.0 (Linux)
- Laravel cache paged results (Server)
- SQLite3 simple operation (Database)
- Configuring Allatori code confusion when developing general Java applications in NetBeans (Programming)
- Remote installation of Net-SNMP whole process (Linux)
- CentOS 7 Add yum source (Linux)
- Hadoop 2.7.1 Installation and Configuration under RedHat Linux 6.5 (Server)
- ethtool command Detailed (Linux)
- Memcache explain in detail (Server)
- Linux basic introductory tutorial ---- regex basis (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.