{"id":411574,"date":"2024-06-29T22:02:46","date_gmt":"2024-06-29T22:02:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=411574"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T22:02:46","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=411574","title":{"rendered":"<span>\u041e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 Perl ( m\/\/ )<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u0434\u043d\u044f\u0445 \u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c:<\/p>\n<pre><code class=\"perl\">... my $re = get_text_in_filter(); @list = grep { \/$re\/i } @list; ...<\/code><\/pre>\n<p><code>$re<\/code> \u0431\u044b\u043b \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438 \u0432 <code>@list<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/580\/77a\/1bb\/58077a1bb5d48ec18b562636c83c1237.png\" width=\"181\" height=\"205\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/580\/77a\/1bb\/58077a1bb5d48ec18b562636c83c1237.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435, \u0430 \u043f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b, \u0447\u0442\u043e <code>$re<\/code> \u0438\u043b\u0438 <code>@list<\/code> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u043b \u0438\u0445 \u0434\u0430\u0442\u0430\u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"perl\">use DDP; p my $x=[$re, qr\/$re\/, $list[0], $list[0] =~ qr\/$re\/? \"ok\":\"no\")];  # 1-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: [     [0] \"\",     [1]   (modifiers: u),     [2] \"Application\",     [3] \"ok\" ] # 2-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: [     [0] \"\",     [1]   (modifiers: u),     [2] \"Application\",     [3] \"no\" ]<\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0430\u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430 \u043e\u043d\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. &#171;\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u043b\u0430\u0433 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d&#187;, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u044f. \u0418 \u0441\u0434\u0430\u043c\u043f\u0438\u043b $x \u0434\u044d\u0432\u044d\u043b-\u043f\u0438\u043a\u043e\u043c:<\/p>\n<pre><code class=\"perl\">pop @$x; use Devel::Peek; Dump($x);  # 1-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: SV = IV(0x56228695d7f8) at 0x56228695d808   REFCNT = 1   FLAGS = (ROK)   RV = 0x56228708a930   SV = PVAV(0x56228712b618) at 0x56228708a930     REFCNT = 1     FLAGS = ()     ARRAY = 0x562287095590     FILL = 2     MAX = 3     FLAGS = (REAL)     Elt No. 0     SV = PV(0x56228708c200) at 0x562286bfdbb0       REFCNT = 1       FLAGS = (POK,pPOK)       PV = 0x562286fd9930 \"\"\\0       CUR = 0       LEN = 10     Elt No. 1     SV = IV(0x5622870ac428) at 0x5622870ac438       REFCNT = 1       FLAGS = (ROK)       RV = 0x562286c0ef68       SV = REGEXP(0x56228710d4a0) at 0x562286c0ef68         REFCNT = 1         FLAGS = (OBJECT,POK,FAKE,pPOK)         PV = 0x5622870c04d0 \"(?^u:)\"         CUR = 6         LEN = 0         STASH = 0x562285ffd230  \"Regexp\"         COMPFLAGS = 0x100 ()         EXTFLAGS = 0x80000100 (NULL)         ENGINE = 0x7f817615d380 (STANDARD)         INTFLAGS = 0x0 ()         NPARENS = 0         LASTPAREN = 0         LASTCLOSEPAREN = 0         MINLEN = 0         MINLENRET = 0         GOFS = 0         PRE_PREFIX = 5         SUBLEN = 0         SUBOFFSET = 0         SUBCOFFSET = 0         SUBBEG = 0x0         MOTHER_RE = 0x562287123810         SV = REGEXP(0x56228710d3e0) at 0x562287123810           REFCNT = 2           FLAGS = (POK,pPOK)           PV = 0x5622870c04d0 \"(?^u:)\"           CUR = 6           LEN = 10           COMPFLAGS = 0x100 ()           EXTFLAGS = 0x80000100 (NULL)           ENGINE = 0x7f817615d380 (STANDARD)           INTFLAGS = 0x0 ()           NPARENS = 0           LASTPAREN = 0           LASTCLOSEPAREN = 0           MINLEN = 0           MINLENRET = 0           GOFS = 0           PRE_PREFIX = 5           SUBLEN = 0           SUBOFFSET = 0           SUBCOFFSET = 0           SUBBEG = 0x0           MOTHER_RE = 0x0           PAREN_NAMES = 0x0           SUBSTRS = 0x562287042a00           PPRIVATE = 0x562287130bb0           OFFS = 0x5622870153f0           QR_ANONCV = 0x0           SAVED_COPY = 0x0         PAREN_NAMES = 0x0         SUBSTRS = 0x562287042970         PPRIVATE = 0x562287130bb0         OFFS = 0x562287095090         QR_ANONCV = 0x0         SAVED_COPY = 0x0     Elt No. 2     SV = PVNV(0x5622870402a0) at 0x562286bfdd00       REFCNT = 1       FLAGS = (POK,IsCOW,pPOK)       IV = 0       NV = 0       PV = 0x562287130eb0 \"Application\"\\0       CUR = 11       LEN = 13       COW_REFCNT = 3        # 2-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: SV = IV(0x56228695d7f8) at 0x56228695d808   REFCNT = 1   FLAGS = (ROK)   RV = 0x562287058898   SV = PVAV(0x562287139a90) at 0x562287058898     REFCNT = 1     FLAGS = ()     ARRAY = 0x5622871cb700     FILL = 2     MAX = 3     FLAGS = (REAL)     Elt No. 0     SV = PV(0x56228713b690) at 0x56228712e378       REFCNT = 1       FLAGS = (POK,pPOK)       PV = 0x562287113620 \"\"\\0       CUR = 0       LEN = 10     Elt No. 1     SV = IV(0x5622871c7be0) at 0x5622871c7bf0       REFCNT = 1       FLAGS = (ROK)       RV = 0x5622871419b8       SV = REGEXP(0x56228710d860) at 0x5622871419b8         REFCNT = 1         FLAGS = (OBJECT,POK,FAKE,pPOK)         PV = 0x5622870c04d0 \"(?^u:)\"         CUR = 6         LEN = 0         STASH = 0x562285ffd230  \"Regexp\"         COMPFLAGS = 0x100 ()         EXTFLAGS = 0x80000100 (NULL)         ENGINE = 0x7f817615d380 (STANDARD)         INTFLAGS = 0x0 ()         NPARENS = 0         LASTPAREN = 0         LASTCLOSEPAREN = 0         MINLEN = 0         MINLENRET = 0         GOFS = 0         PRE_PREFIX = 5         SUBLEN = 0         SUBOFFSET = 0         SUBCOFFSET = 0         SUBBEG = 0x0         MOTHER_RE = 0x562287123810         SV = REGEXP(0x56228710d3e0) at 0x562287123810           REFCNT = 2           FLAGS = (POK,pPOK)           PV = 0x5622870c04d0 \"(?^u:)\"           CUR = 6           LEN = 10           COMPFLAGS = 0x100 ()           EXTFLAGS = 0x80000100 (NULL)           ENGINE = 0x7f817615d380 (STANDARD)           INTFLAGS = 0x0 ()           NPARENS = 0           LASTPAREN = 0           LASTCLOSEPAREN = 0           MINLEN = 0           MINLENRET = 0           GOFS = 0           PRE_PREFIX = 5           SUBLEN = 0           SUBOFFSET = 0           SUBCOFFSET = 0           SUBBEG = 0x0           MOTHER_RE = 0x0           PAREN_NAMES = 0x0           SUBSTRS = 0x562287042a00           PPRIVATE = 0x562287130bb0           OFFS = 0x5622870153f0           QR_ANONCV = 0x0           SAVED_COPY = 0x0         PAREN_NAMES = 0x0         SUBSTRS = 0x5622871b0af0         PPRIVATE = 0x562287130bb0         OFFS = 0x562287093f70         QR_ANONCV = 0x0         SAVED_COPY = 0x0     Elt No. 2     SV = PVNV(0x562287040580) at 0x5622871cdc18       REFCNT = 1       FLAGS = (POK,IsCOW,pPOK)       IV = 0       NV = 0       PV = 0x562286fe39d0 \"Application\"\\0       CUR = 11       LEN = 13       COW_REFCNT = 3<\/code><\/pre>\n<p><strong>meld<\/strong> \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0447\u0442\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u0445 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c, \u0444\u043b\u0430\u0433\u0438 \u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1fc\/9b6\/40a\/1fc9b640a26b198a0c72c0b30d9f29d0.png\" width=\"1128\" height=\"803\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fc\/9b6\/40a\/1fc9b640a26b198a0c72c0b30d9f29d0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>&#171;\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>perl<\/strong>-\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438&#187;, \u0440\u0435\u0448\u0438\u043b \u044f.<\/p>\n<p>\u042f \u0443\u0436 \u0434\u0443\u043c\u0430\u043b \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <strong>perl<\/strong>-\u0430, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0443\u0433\u043b\u0438\u043b. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <strong>perlop<\/strong>. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0430 (<code>=~<\/code>): \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f <strong>perl<\/strong>-\u043e\u043c, \u0430 \u043f\u0443\u0441\u0442\u0430\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043c\u0430\u0442\u0447\u0438\u0442 \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f. \u0427\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;  # -> a $y =~ \/\/; print $`;   # -> x<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0447\u0451\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e:<\/p>\n<pre><code class=\"perl\">sub f1 { $_[0] =~ \/b\/; print $`; } sub f2 { f1(@_) } $x = \"abc\"; $y = \"xby\"; f2($x);             # -> a $y =~ \/\/; print $`; # -> x<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u043c\u0438 \u043e\u0442\u0431\u043e\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0433\u0434\u0435-\u0442\u043e \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0430\u0441\u044c \u0438 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0443\u0441\u0442\u0430\u044f \u044d\u0442\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 <strong>perl<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0436\u0435 \u0441\u0443\u0434\u0438\u0442:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;                # -> a my $re = \"\"; $y =~ \/$re\/; print $`; # -> x<\/code><\/pre>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>$re<\/code> \u043d\u0435 \u043f\u0443\u0441\u0442\u0430\u044f:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;                 # -> a my $re = \"y\"; $y =~ \/$re\/; print $`; # -> xb<\/code><\/pre>\n<p>\u0412 <strong>perlop<\/strong> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0432\u0438\u0442\u044c <code>()<\/code> \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $_ = \"xby\"; $x =~ \/b\/; my $re = \"\"; $y =~ \/()$re\/; print $`; # -> print $'; # -> xby<\/code><\/pre>\n<p>\u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0435, \u043d\u043e \u0438 \u043f\u0440\u0438 \u0437\u0430\u043c\u0435\u043d\u0435 \u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0432 <code>split<\/code> (\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u044a\u0451\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u044b):<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $_ = \"xby\"; $x =~ \/b\/; s\/\/*\/; print;  # -> x*y $, = \", \"; print split \/\/, \"abc\"; # -> a, b, c<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0451, \u0447\u0442\u043e \u0441 \u044d\u0441\u043a\u0435\u0439\u043f\u0438\u043d\u0433\u043e\u043c <code>\/\\Q$re\\E\/<\/code> \u043e\u043d\u0430 \u0442\u043e\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`; # -> a my $re = \"\"; $y =~ \/\\Q$re\\E\/; print $`; # -> x<\/code><\/pre>\n<p><strong>perl<\/strong> \u0442\u0430\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0439\u043d \u0438 \u043a\u043e\u0433\u0434\u0430 \u0443\u0436\u0435 \u0434\u0443\u043c\u0430\u0435\u0448\u044c, \u0447\u0442\u043e \u0437\u043d\u0430\u0435\u0448\u044c \u043e \u043d\u0451\u043c \u0432\u0441\u0451, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u044b \u043b\u0438\u0448\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u0438\u0440 \u043a\u0440\u0430\u0442\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<ol>\n<li>\n<p>\u041f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \/ <a href=\"https:\/\/perldoc.perl.org\/perlop#The-empty-pattern-\/\/\" rel=\"noopener noreferrer nofollow\">https:\/\/perldoc.perl.org\/perlop#The-empty-pattern-\/\/<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \/ <a href=\"https:\/\/raku.org\/archive\/rfc\/144.html\" rel=\"noopener noreferrer nofollow\">https:\/\/raku.org\/archive\/rfc\/144.html<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \/ <a href=\"https:\/\/metacpan.org\/dist\/POD2-RU\/view\/lib\/POD2\/RU\/perlre.pod#%D0%9F%D0%BE%D0%B2%D1%82%D0%BE%D1%80%D1%8F%D1%8E%D1%89%D0%B8%D0%B5%D1%81%D1%8F-%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B-%D0%BF%D0%BE%D0%B8%D1%81%D0%BA%D0%B0-%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8-%D0%BD%D1%83%D0%BB%D0%B5%D0%B2%D0%BE%D0%B9-%D0%B4%D0%BB%D0%B8%D0%BD%D1%8B\" rel=\"noopener noreferrer nofollow\">https:\/\/metacpan.org\/dist\/POD2-RU\/view\/lib\/POD2\/RU\/perlre.pod#\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f-\u0448\u0430\u0431\u043b\u043e\u043d\u044b-\u043f\u043e\u0438\u0441\u043a\u0430-\u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438-\u043d\u0443\u043b\u0435\u0432\u043e\u0439-\u0434\u043b\u0438\u043d\u044b<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/583952\/\"> https:\/\/habr.com\/ru\/articles\/583952\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430 \u0434\u043d\u044f\u0445 \u0434\u0435\u043b\u0430\u043b \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c:<\/p>\n<pre><code class=\"perl\">... my $re = get_text_in_filter(); @list = grep { \/$re\/i } @list; ...<\/code><\/pre>\n<p><code>$re<\/code> \u0431\u044b\u043b \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438 \u0432 <code>@list<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<figure class=\"float\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435, \u0430 \u043f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b, \u0447\u0442\u043e <code>$re<\/code> \u0438\u043b\u0438 <code>@list<\/code> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u043b \u0438\u0445 \u0434\u0430\u0442\u0430\u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"perl\">use DDP; p my $x=[$re, qr\/$re\/, $list[0], $list[0] =~ qr\/$re\/? \"ok\":\"no\")];  # 1-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: [     [0] \"\",     [1]   (modifiers: u),     [2] \"Application\",     [3] \"ok\" ] # 2-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: [     [0] \"\",     [1]   (modifiers: u),     [2] \"Application\",     [3] \"no\" ]<\/code><\/pre>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0430\u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430 \u043e\u043d\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. &#171;\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u043b\u0430\u0433 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d&#187;, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u044f. \u0418 \u0441\u0434\u0430\u043c\u043f\u0438\u043b $x \u0434\u044d\u0432\u044d\u043b-\u043f\u0438\u043a\u043e\u043c:<\/p>\n<pre><code class=\"perl\">pop @$x; use Devel::Peek; Dump($x);  # 1-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: SV = IV(0x56228695d7f8) at 0x56228695d808   REFCNT = 1   FLAGS = (ROK)   RV = 0x56228708a930   SV = PVAV(0x56228712b618) at 0x56228708a930     REFCNT = 1     FLAGS = ()     ARRAY = 0x562287095590     FILL = 2     MAX = 3     FLAGS = (REAL)     Elt No. 0     SV = PV(0x56228708c200) at 0x562286bfdbb0       REFCNT = 1       FLAGS = (POK,pPOK)       PV = 0x562286fd9930 \"\"\\0       CUR = 0       LEN = 10     Elt No. 1     SV = IV(0x5622870ac428) at 0x5622870ac438       REFCNT = 1       FLAGS = (ROK)       RV = 0x562286c0ef68       SV = REGEXP(0x56228710d4a0) at 0x562286c0ef68         REFCNT = 1         FLAGS = (OBJECT,POK,FAKE,pPOK)         PV = 0x5622870c04d0 \"(?^u:)\"         CUR = 6         LEN = 0         STASH = 0x562285ffd230  \"Regexp\"         COMPFLAGS = 0x100 ()         EXTFLAGS = 0x80000100 (NULL)         ENGINE = 0x7f817615d380 (STANDARD)         INTFLAGS = 0x0 ()         NPARENS = 0         LASTPAREN = 0         LASTCLOSEPAREN = 0         MINLEN = 0         MINLENRET = 0         GOFS = 0         PRE_PREFIX = 5         SUBLEN = 0         SUBOFFSET = 0         SUBCOFFSET = 0         SUBBEG = 0x0         MOTHER_RE = 0x562287123810         SV = REGEXP(0x56228710d3e0) at 0x562287123810           REFCNT = 2           FLAGS = (POK,pPOK)           PV = 0x5622870c04d0 \"(?^u:)\"           CUR = 6           LEN = 10           COMPFLAGS = 0x100 ()           EXTFLAGS = 0x80000100 (NULL)           ENGINE = 0x7f817615d380 (STANDARD)           INTFLAGS = 0x0 ()           NPARENS = 0           LASTPAREN = 0           LASTCLOSEPAREN = 0           MINLEN = 0           MINLENRET = 0           GOFS = 0           PRE_PREFIX = 5           SUBLEN = 0           SUBOFFSET = 0           SUBCOFFSET = 0           SUBBEG = 0x0           MOTHER_RE = 0x0           PAREN_NAMES = 0x0           SUBSTRS = 0x562287042a00           PPRIVATE = 0x562287130bb0           OFFS = 0x5622870153f0           QR_ANONCV = 0x0           SAVED_COPY = 0x0         PAREN_NAMES = 0x0         SUBSTRS = 0x562287042970         PPRIVATE = 0x562287130bb0         OFFS = 0x562287095090         QR_ANONCV = 0x0         SAVED_COPY = 0x0     Elt No. 2     SV = PVNV(0x5622870402a0) at 0x562286bfdd00       REFCNT = 1       FLAGS = (POK,IsCOW,pPOK)       IV = 0       NV = 0       PV = 0x562287130eb0 \"Application\"\\0       CUR = 11       LEN = 13       COW_REFCNT = 3        # 2-\u0439 \u043f\u0440\u043e\u0445\u043e\u0434: SV = IV(0x56228695d7f8) at 0x56228695d808   REFCNT = 1   FLAGS = (ROK)   RV = 0x562287058898   SV = PVAV(0x562287139a90) at 0x562287058898     REFCNT = 1     FLAGS = ()     ARRAY = 0x5622871cb700     FILL = 2     MAX = 3     FLAGS = (REAL)     Elt No. 0     SV = PV(0x56228713b690) at 0x56228712e378       REFCNT = 1       FLAGS = (POK,pPOK)       PV = 0x562287113620 \"\"\\0       CUR = 0       LEN = 10     Elt No. 1     SV = IV(0x5622871c7be0) at 0x5622871c7bf0       REFCNT = 1       FLAGS = (ROK)       RV = 0x5622871419b8       SV = REGEXP(0x56228710d860) at 0x5622871419b8         REFCNT = 1         FLAGS = (OBJECT,POK,FAKE,pPOK)         PV = 0x5622870c04d0 \"(?^u:)\"         CUR = 6         LEN = 0         STASH = 0x562285ffd230  \"Regexp\"         COMPFLAGS = 0x100 ()         EXTFLAGS = 0x80000100 (NULL)         ENGINE = 0x7f817615d380 (STANDARD)         INTFLAGS = 0x0 ()         NPARENS = 0         LASTPAREN = 0         LASTCLOSEPAREN = 0         MINLEN = 0         MINLENRET = 0         GOFS = 0         PRE_PREFIX = 5         SUBLEN = 0         SUBOFFSET = 0         SUBCOFFSET = 0         SUBBEG = 0x0         MOTHER_RE = 0x562287123810         SV = REGEXP(0x56228710d3e0) at 0x562287123810           REFCNT = 2           FLAGS = (POK,pPOK)           PV = 0x5622870c04d0 \"(?^u:)\"           CUR = 6           LEN = 10           COMPFLAGS = 0x100 ()           EXTFLAGS = 0x80000100 (NULL)           ENGINE = 0x7f817615d380 (STANDARD)           INTFLAGS = 0x0 ()           NPARENS = 0           LASTPAREN = 0           LASTCLOSEPAREN = 0           MINLEN = 0           MINLENRET = 0           GOFS = 0           PRE_PREFIX = 5           SUBLEN = 0           SUBOFFSET = 0           SUBCOFFSET = 0           SUBBEG = 0x0           MOTHER_RE = 0x0           PAREN_NAMES = 0x0           SUBSTRS = 0x562287042a00           PPRIVATE = 0x562287130bb0           OFFS = 0x5622870153f0           QR_ANONCV = 0x0           SAVED_COPY = 0x0         PAREN_NAMES = 0x0         SUBSTRS = 0x5622871b0af0         PPRIVATE = 0x562287130bb0         OFFS = 0x562287093f70         QR_ANONCV = 0x0         SAVED_COPY = 0x0     Elt No. 2     SV = PVNV(0x562287040580) at 0x5622871cdc18       REFCNT = 1       FLAGS = (POK,IsCOW,pPOK)       IV = 0       NV = 0       PV = 0x562286fe39d0 \"Application\"\\0       CUR = 11       LEN = 13       COW_REFCNT = 3<\/code><\/pre>\n<p><strong>meld<\/strong> \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0447\u0442\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u0445 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c, \u0444\u043b\u0430\u0433\u0438 \u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>&#171;\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>perl<\/strong>-\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438&#187;, \u0440\u0435\u0448\u0438\u043b \u044f.<\/p>\n<p>\u042f \u0443\u0436 \u0434\u0443\u043c\u0430\u043b \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <strong>perl<\/strong>-\u0430, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0443\u0433\u043b\u0438\u043b. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <strong>perlop<\/strong>. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0430 (<code>=~<\/code>): \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f <strong>perl<\/strong>-\u043e\u043c, \u0430 \u043f\u0443\u0441\u0442\u0430\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043c\u0430\u0442\u0447\u0438\u0442 \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f. \u0427\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;  # -> a $y =~ \/\/; print $`;   # -> x<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0447\u0451\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e:<\/p>\n<pre><code class=\"perl\">sub f1 { $_[0] =~ \/b\/; print $`; } sub f2 { f1(@_) } $x = \"abc\"; $y = \"xby\"; f2($x);             # -> a $y =~ \/\/; print $`; # -> x<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u043c\u0438 \u043e\u0442\u0431\u043e\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0433\u0434\u0435-\u0442\u043e \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0430\u0441\u044c \u0438 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0443\u0441\u0442\u0430\u044f \u044d\u0442\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 <strong>perl<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0436\u0435 \u0441\u0443\u0434\u0438\u0442:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;                # -> a my $re = \"\"; $y =~ \/$re\/; print $`; # -> x<\/code><\/pre>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>$re<\/code> \u043d\u0435 \u043f\u0443\u0441\u0442\u0430\u044f:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`;                 # -> a my $re = \"y\"; $y =~ \/$re\/; print $`; # -> xb<\/code><\/pre>\n<p>\u0412 <strong>perlop<\/strong> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0432\u0438\u0442\u044c <code>()<\/code> \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $_ = \"xby\"; $x =~ \/b\/; my $re = \"\"; $y =~ \/()$re\/; print $`; # -> print $'; # -> xby<\/code><\/pre>\n<p>\u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0438 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0435, \u043d\u043e \u0438 \u043f\u0440\u0438 \u0437\u0430\u043c\u0435\u043d\u0435 \u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0432 <code>split<\/code> (\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u044a\u0451\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u044b):<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $_ = \"xby\"; $x =~ \/b\/; s\/\/*\/; print;  # -> x*y $, = \", \"; print split \/\/, \"abc\"; # -> a, b, c<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0451, \u0447\u0442\u043e \u0441 \u044d\u0441\u043a\u0435\u0439\u043f\u0438\u043d\u0433\u043e\u043c <code>\/\\Q$re\\E\/<\/code> \u043e\u043d\u0430 \u0442\u043e\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439:<\/p>\n<pre><code class=\"perl\">$x = \"abc\"; $y = \"xby\"; $x =~ \/b\/; print $`; # -> a my $re = \"\"; $y =~ \/\\Q$re\\E\/; print $`; # -> x<\/code><\/pre>\n<p><strong>perl<\/strong> \u0442\u0430\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0439\u043d \u0438 \u043a\u043e\u0433\u0434\u0430 \u0443\u0436\u0435 \u0434\u0443\u043c\u0430\u0435\u0448\u044c, \u0447\u0442\u043e \u0437\u043d\u0430\u0435\u0448\u044c \u043e \u043d\u0451\u043c \u0432\u0441\u0451, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u044b \u043b\u0438\u0448\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u0438\u0440 \u043a\u0440\u0430\u0442\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<ol>\n<li>\n<p>\u041f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \/ <a href=\"https:\/\/perldoc.perl.org\/perlop#The-empty-pattern-\/\/\" rel=\"noopener noreferrer nofollow\">https:\/\/perldoc.perl.org\/perlop#The-empty-pattern-\/\/<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \/ <a href=\"https:\/\/raku.org\/archive\/rfc\/144.html\" rel=\"noopener noreferrer nofollow\">https:\/\/raku.org\/archive\/rfc\/144.html<\/a><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \/ <a href=\"https:\/\/metacpan.org\/dist\/POD2-RU\/view\/lib\/POD2\/RU\/perlre.pod#%D0%9F%D0%BE%D0%B2%D1%82%D0%BE%D1%80%D1%8F%D1%8E%D1%89%D0%B8%D0%B5%D1%81%D1%8F-%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B-%D0%BF%D0%BE%D0%B8%D1%81%D0%BA%D0%B0-%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8-%D0%BD%D1%83%D0%BB%D0%B5%D0%B2%D0%BE%D0%B9-%D0%B4%D0%BB%D0%B8%D0%BD%D1%8B\" rel=\"noopener noreferrer nofollow\">https:\/\/metacpan.org\/dist\/POD2-RU\/view\/lib\/POD2\/RU\/perlre.pod#\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f-\u0448\u0430\u0431\u043b\u043e\u043d\u044b-\u043f\u043e\u0438\u0441\u043a\u0430-\u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438-\u043d\u0443\u043b\u0435\u0432\u043e\u0439-\u0434\u043b\u0438\u043d\u044b<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/583952\/\"> https:\/\/habr.com\/ru\/articles\/583952\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-411574","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=411574"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/411574\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}