Created
July 30, 2012 14:53
-
-
Save hpcx82/3207514 to your computer and use it in GitHub Desktop.
testing q, qq, qw, qr, qx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use diagnostics; | |
use warnings; | |
use sigtrap; | |
my $name = "**value**"; | |
# q = single quote | |
print q('hello, world'); | |
print "\n"; | |
print q("hello, world"); | |
print "\n"; | |
print q(hello, $name); | |
print "\n"; | |
# qq = double quote | |
print qq('hello, world'); | |
print "\n"; | |
print qq("hello, world"); | |
print "\n"; | |
print qq(hello, $name); | |
print "\n"; | |
my $world = "world"; | |
print qq("$world"); # add quote to an existing string. | |
print "\n"; | |
# qx = quoted executions | |
print qx(dir C:/); | |
print "\n"; | |
# qw = quoted words | |
my @arr = qw(baiyan danmei haihua xiaoxiao xiaxiu); | |
print join("\n", @arr); | |
print "\n"; | |
# qr = quoted regex | |
my $pattern = qr(^\s*([a-z]+)\s*)is; | |
print $pattern, "\n"; # it is already compiled, why a regex needs to be compiled? | |
my $str = qq( this is a statement ); | |
$str =~ $pattern; | |
print $1; | |
print "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'hello, world' | |
"hello, world" | |
hello, $name | |
'hello, world' | |
"hello, world" | |
hello, **value** | |
"world" | |
cygwin warning: | |
MS-DOS style path detected: C:/ | |
Preferred POSIX equivalent is: /cygdrive/c | |
CYGWIN environment variable option "nodosfilewarning" turns off this warning. | |
Consult the user's guide for more details about POSIX paths: | |
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames | |
$Recycle.Bin Program\ Files Windows | |
360Rec Program\ Files\ (x86) bar.emf | |
360SANDBOX ProgramData cygwin | |
Config.Msi Recovery hiberfil.sys | |
Documents\ and\ Settings System\ Volume\ Information | |
MSOCache Users | |
baiyan | |
danmei | |
haihua | |
xiaoxiao | |
xiaxiu | |
(?si-xm:^\s*([a-z]+)\s*) | |
this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment