# Arabic translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # زايد السعيدي , 2026. msgid "" msgstr "" "Project-Id-Version: manpages-l10n\n" "POT-Creation-Date: 2026-06-05 06:34+0200\n" "PO-Revision-Date: 2026-06-03 04:49+0400\n" "Last-Translator: Zayed Al-Saidi \n" "Language-Team: Arabic \n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" ".MIME-Version: 1.0\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" "X-Generator: Lokalize 23.08.5\n" # #-#-#-#-# fedora-44: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# fedora-rawhide: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# mageia-cauldron: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# opensuse-leap-16-1: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# opensuse-tumbleweed: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # #. #-#-#-#-# debian-trixie: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. ======================================================================== #. type: IX #. #-#-#-#-# debian-unstable: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. ======================================================================== #. type: IX #. #-#-#-#-# fedora-44: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# fedora-rawhide: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# mageia-cauldron: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# opensuse-leap-16-1: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# opensuse-tumbleweed: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Title" msgstr "Title" # #-#-#-#-# fedora-44: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# fedora-rawhide: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# mageia-cauldron: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# opensuse-leap-16-1: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # # #-#-#-#-# opensuse-tumbleweed: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# # #. #-#-#-#-# debian-trixie: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. ======================================================================== #. type: IX #. #-#-#-#-# debian-unstable: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. ======================================================================== #. type: IX #. #-#-#-#-# fedora-44: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# fedora-rawhide: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# mageia-cauldron: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# opensuse-leap-16-1: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #. #-#-#-#-# opensuse-tumbleweed: perlref.1.pot (PACKAGE VERSION) #-#-#-#-# #. Required to disable full justification in groff 1.23.0. #. ======================================================================== #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "PERLREF 1" msgstr "PERLREF 1" #. type: TH #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "PERLREF" msgstr "PERLREF" #. type: TH #: debian-trixie #, no-wrap msgid "2025-07-27" msgstr "27 يوليو 2025" #. type: TH #: debian-trixie debian-unstable #, no-wrap msgid "perl v5.40.1" msgstr "بيرل v5.40.1" #. type: TH #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Perl Programmers Reference Guide" msgstr "دليل مرجع مبرمجي بيرل" #. type: SH #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "الاسم" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "perlref - Perl references and nested data structures" msgstr "perlref - مراجع بيرل وهياكل البيانات المتداخلة" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Xref" msgstr "Xref" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference pointer data structure structure struct" msgstr "مرجع مؤشر هيكل بيانات بنية struct" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NOTE" msgstr "ملاحظة" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Header" msgstr "Header" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This is complete documentation about all aspects of references. For a " "shorter, tutorial introduction to just the essential features, see " "perlreftut." msgstr "" "هذا توثيق كامل حول كافة جوانب المراجع. للحصول على مقدمة تعليمية أقصر للميزات " "الأساسية فقط، انظر perlreftut." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "الوصف" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Before release 5 of Perl it was difficult to represent complex data " "structures, because all references had to be symbolic--and even then it was " "difficult to refer to a variable instead of a symbol table entry. Perl now " "not only makes it easier to use symbolic references to variables, but also " "lets you have \"hard\" references to any piece of data or code. Any scalar " "may hold a hard reference. Because arrays and hashes contain scalars, you " "can now easily build arrays of arrays, arrays of hashes, hashes of arrays, " "arrays of hashes of functions, and so on." msgstr "" "قبل الإصدار 5 من بيرل، كان من الصعب تمثيل هياكل البيانات المعقدة، لأن جميع " "المراجع كان يجب أن تكون رمزية - وحتى حينها كان من الصعب الإشارة إلى متغير " "بدلاً من إدخال في جدول الرموز. الآن لا تكتفي بيرل بجعل استخدام المراجع " "الرمزية للمتغيرات أسهل فحسب، بل تتيح لك أيضًا امتلاك مراجع \"صلبة\" (hard) " "لأي قطعة من البيانات أو الكود. يمكن لأي كمية سلمية (scalar) أن تحمل مرجعًا " "صلبًا. وبما أن المصفوفات والمصفوفات المجزأة (hashes) تحتوي على سلميات، يمكنك " "الآن بسهولة بناء مصفوفات من مصفوفات، ومصفوفات من مجزئات، ومجزئات من مصفوفات، " "ومصفوفات من مجزئات دوال، وما إلى ذلك." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Hard references are smart--they keep track of reference counts for you, " "automatically freeing the thing referred to when its reference count goes to " "zero. (Reference counts for values in self-referential or cyclic data " "structures may not go to zero without a little help; see \"Circular " "References\" for a detailed explanation.) If that thing happens to be an " "object, the object is destructed. See perlobj for more about objects. (In " "a sense, everything in Perl is an object, but we usually reserve the word " "for references to objects that have been officially \"blessed\" into a class " "package.)" msgstr "" "المراجع الصلبة ذكية - فهي تتبع أعداد المراجع لك، وتُحرر الشيء المشار إليه " "آليًا عندما يصل عدد مراجعة إلى الصفر. (قد لا تصل أعداد المراجع للقيم في هياكل " "البيانات ذاتية المرجعية أو الدائرية إلى الصفر دون القليل من المساعدة؛ انظر " "\"Circular References\" لشرح مفصل.) إذا صادف أن كان ذلك الشيء كائنًا، فسيُدمر " "الكائن. انظر perlobj لمزيد عن الكائنات. (بمعنى ما، كل شيء في بيرل هو كائن، " "لكننا عادة ما نحتفظ بالكلمة للمراجع إلى الكائنات التي تم \"مباركتها\" رسميًا " "في حزمة فئة.)" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Symbolic references are names of variables or other objects, just as a " "symbolic link in a Unix filesystem contains merely the name of a file. The " "CW<*glob> notation is something of a symbolic reference. (Symbolic " "references are sometimes called \"soft references\", but please don't call " "them that; references are confusing enough without useless synonyms.)" msgstr "" "المراجع الرمزية هي أسماء لمتغيرات أو كائنات أخرى، تمامًا كما يحتوي الرابط " "الرمزي في نظام ملفات يونكس على اسم ملف فحسب. تدوين CW<*glob> هو نوع من " "المراجع الرمزية. (تُسمى المراجع الرمزية أحيانًا \"مراجع ناعمة\"، ولكن يرجى عدم " "تسميتها بذلك؛ فالمراجع مربكة بما يكفي دون مرادفات عديمة الفائدة.)" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, symbolic reference, soft symbolic reference soft reference" msgstr "مرجع، مرجع رمزي، مرجع رمزي ناعم مرجع ناعم" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "In contrast, hard references are more like hard links in a Unix file system: " "They are used to access an underlying object without concern for what its " "(other) name is. When the word \"reference\" is used without an adjective, " "as in the following paragraph, it is usually talking about a hard reference." msgstr "" "في المقابل، المراجع الصلبة تشبه الروابط الصلبة في نظام ملفات يونكس: فهي " "تُستخدم للوصول إلى كائن أساسي دون الاهتمام باسمه (الآخر). عندما تُستخدم كلمة " "\"مرجع\" دون صفة، كما في الفقرة التالية، فإنها عادة ما تتحدث عن مرجع صلب." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, hard hard reference" msgstr "مرجع، مرجع صلب" #. type: Plain text #: debian-trixie debian-unstable msgid "" "References are easy to use in Perl. There is just one overriding principle: " "in general, Perl does no implicit referencing or dereferencing. When a " "scalar is holding a reference, it always behaves as a simple scalar. It " "doesn't magically start being an array or hash or subroutine; you have to " "tell it explicitly to do so, by dereferencing it." msgstr "" "المراجع سهلة الاستخدام في بيرل. هناك مبدأ رئيس واحد فقط: بشكل عام، لا تقوم " "بيرل بأي إسناد مرجعي أو فك إسناد مرجعي ضمني. عندما تحمل سلمية مرجعًا، فإنها " "تتصرف دائمًا كسلمية بسيطة. لا تبدأ سحريًا في أن تكون مصفوفة أو مجزأة أو دالة " "فرعية؛ يجب عليك إخبارها صراحة بالقيام بذلك عن طريق فك إسنادها المرجعي." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Making References" msgstr "إنشاء المراجع" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, creation referencing" msgstr "مرجع، إنشاء إسناد مرجعي" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Subsection" msgstr "Subsection" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "References can be created in several ways." msgstr "يمكن إنشاء المراجع بعدة طرق." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<عامل الخط المائل العكسي>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\ backslash" msgstr "\\ خط مائل عكسي" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Backslash Operator" msgstr "عامل الخط المائل العكسي" #. type: Plain text #: debian-trixie debian-unstable msgid "" "By using the backslash operator on a variable, subroutine, or value. (This " "works much like the & (address-of) operator in C.) This typically creates " "I reference to a variable, because there's already a reference to " "the variable in the symbol table. But the symbol table reference might go " "away, and you'll still have the reference that the backslash returned. Here " "are some examples:" msgstr "" "باستخدام عامل الخط المائل العكسي على متغير، أو دالة فرعية، أو قيمة. (يعمل " "هذا بشكل يشبه إلى حد كبير عامل & (عنوان) في لغة C.) يؤدي هذا عادةً إلى إنشاء " "مرجع I<آخر> لمتغير، لأن هناك بالفعل مرجعًا للمتغير في جدول الرموز. ولكن مرجع " "جدول الرموز قد يختفي، وستظل تمتلك المرجع الذي أعاده الخط المائل العكسي. إليك " "بعض الأمثلة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $scalarref = \\e$foo;\n" "\\& $arrayref = \\e@ARGV;\n" "\\& $hashref = \\e%ENV;\n" "\\& $coderef = \\e&handler;\n" "\\& $globref = \\e*foo;\n" msgstr "" "\\& $scalarref = \\e$foo;\n" "\\& $arrayref = \\e@ARGV;\n" "\\& $hashref = \\e%ENV;\n" "\\& $coderef = \\e&handler;\n" "\\& $globref = \\e*foo;\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "It isn't possible to create a true reference to an IO handle (filehandle or " "dirhandle) using the backslash operator. The most you can get is a " "reference to a typeglob, which is actually a complete symbol table entry. " "But see the explanation of the CW<*foo{THING}> syntax below. However, you " "can still use type globs and globrefs as though they were IO handles." msgstr "" "ليس من الممكن إنشاء مرجع حقيقي لمقبض إدخال/إخراج (مقبض ملف أو مقبض دليل) " "باستخدام عامل الخط المائل العكسي. أقصى ما يمكنك الحصول عليه هو مرجع لـ " "typeglob، وهو في الواقع إدخال كامل في جدول الرموز. ولكن انظر شرح بناء الجملة " "CW<*foo{THING}> أدناه. ومع ذلك، لا يزال بإمكانك استخدام type globs و " "globrefs كما لو كانت مقابض إدخال/إخراج." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<الأقواس المربعة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "array, anonymous [ [] square bracket bracket, square arrayref array reference reference, array" msgstr "مصفوفة، مجهولة [ [] قوس مربع قوس، مربع مرجع مصفوفة مرجع، مصفوفة" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Square Brackets" msgstr "الأقواس المربعة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "A reference to an anonymous array can be created using square brackets:" msgstr "يمكن إنشاء مرجع لمصفوفة مجهولة باستخدام الأقواس المربعة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $arrayref = [1, 2, [\\*(Aqa\\*(Aq, \\*(Aqb\\*(Aq, \\*(Aqc\\*(Aq]];\n" msgstr "\\& $arrayref = [1, 2, [\\*(Aqa\\*(Aq, \\*(Aqb\\*(Aq, \\*(Aqc\\*(Aq]];\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Here we've created a reference to an anonymous array of three elements whose " "final element is itself a reference to another anonymous array of three " "elements. (The multidimensional syntax described later can be used to " "access this. For example, after the above, CW<\\*(C`$arrayref-E[2]" "[1]\\*(C'> would have the value \"b\".)" msgstr "" "هنا أنشأنا مرجعًا لمصفوفة مجهولة من ثلاثة عناصر، عنصرها الأخير هو نفسه مرجع " "لمصفوفة مجهولة أخرى من ثلاثة عناصر. (يمكن استخدام بناء الجملة متعدد الأبعاد " "الموصوف لاحقًا للوصول إلى هذا. على سبيل المثال، بعد ما سبق، ستكون لقيمة " "CW<\\*(C`$arrayref-E[2][1]\\*(C'> القيمة \"b\".)" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Taking a reference to an enumerated list is not the same as using square " "brackets--instead it's the same as creating a list of references!" msgstr "" "أخذ مرجع لقائمة معدودة ليس هو نفسه استخدام الأقواس المربعة - بل هو نفسه " "إنشاء قائمة من المراجع!" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& @list = (\\e$x, \\e@y, \\e%z);\n" "\\& @list = \\e($x, @y, %z); # same thing!\n" msgstr "" "\\& @list = (\\e$x, \\e@y, \\e%z);\n" "\\& @list = \\e($x, @y, %z); # نفس الشيء!\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "As a special case, CW<\\*(C`\\e(@foo)\\*(C'> returns a list of references to " "the contents of CW<@foo>, not a reference to CW<@foo> itself. Likewise for " "CW<%foo>, except that the key references are to copies (since the keys are " "just strings rather than full-fledged scalars)." msgstr "" "كحالة خاصة، يعيد CW<\\*(C`\\e(@foo)\\*(C'> قائمة مراجع لمحتويات CW<@foo>، " "وليس مرجعًا لـ CW<@foo> نفسها. وبالمثل بالنسبة لـ CW<%foo>، باستثناء أن مراجع " "المفاتيح تكون لنسخ (بما أن المفاتيح هي مجرد سلاسل نصية وليست سلميات كاملة)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<الأقواس المعقوفة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "hash, anonymous { {} curly bracket bracket, curly brace hashref hash reference reference, hash" msgstr "مجزأة، مجهولة { {} قوس معقوف قوس، معقوف حاضنة مرجع مجزأة مرجع، مجزأة" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Curly Brackets" msgstr "الأقواس المعقوفة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "A reference to an anonymous hash can be created using curly brackets:" msgstr "يمكن إنشاء مرجع لمصفوفة مجزأة مجهولة باستخدام الأقواس المعقوفة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $hashref = {\n" "\\& \\*(AqAdam\\*(Aq =E \\*(AqEve\\*(Aq,\n" "\\& \\*(AqClyde\\*(Aq =E \\*(AqBonnie\\*(Aq,\n" "\\& };\n" msgstr "" "\\& $hashref = {\n" "\\& \\*(AqAdam\\*(Aq =E \\*(AqEve\\*(Aq,\n" "\\& \\*(AqClyde\\*(Aq =E \\*(AqBonnie\\*(Aq,\n" "\\& };\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Anonymous hash and array composers like these can be intermixed freely to " "produce as complicated a structure as you want. The multidimensional syntax " "described below works for these too. The values above are literals, but " "variables and expressions would work just as well, because assignment " "operators in Perl (even within B or B) are executable " "statements, not compile-time declarations." msgstr "" "يمكن خلط مؤلفي المجزئات والمصفوفات المجهولة مثل هذه بحرية لإنتاج هيكل معقد " "كما تريد. بناء الجملة متعدد الأبعاد الموصوف أدناه يعمل لهذه أيضًا. القيم " "أعلاه هي قيم حرفية، لكن المتغيرات والتعبيرات ستعمل بنفس الكفاءة، لأن عوامل " "التعيين في بيرل (حتى داخل B أو B) هي عبارات قابلة للتنفيذ، " "وليست تصريحات وقت التصريف." #. type: Plain text #: debian-trixie debian-unstable msgid "" "Because curly brackets (braces) are used for several other things including " "BLOCKs, you may occasionally have to disambiguate braces at the beginning of " "a statement by putting a CW<\\*(C`+\\*(C'> or a CW<\\*(C`return\\*(C'> in " "front so that Perl realizes the opening brace isn't starting a BLOCK. The " "economy and mnemonic value of using curlies is deemed worth this occasional " "extra hassle." msgstr "" "نظرًا لأن الأقواس المعقوفة (الحاضنات) تُستخدم لعدة أشياء أخرى بما في ذلك الكتل " "(BLOCKs)، فقد تضطر أحيانًا إلى إزالة اللبس عن الحاضنات في بداية العبارة بوضع " "CW<\\*(C`+\\*(C'> أو CW<\\*(C`return\\*(C'> أمامها حتى تدرك بيرل أن الحاضنة " "الافتتاحية لا تبدأ كتلة. تعتبر القيمة الاقتصادية والتذكارية لاستخدام الأقواس " "المعقوفة تستحق هذا العناء الإضافي العرضي." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For example, if you wanted a function to make a new hash and return a " "reference to it, you have these options:" msgstr "" "على سبيل المثال، إذا كنت تريد دالة لإنشاء مجزأة جديدة وإعادة مرجع إليها، " "فلديك هذه الخيارات:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& sub hashem { { @_ } } # silently wrong\n" "\\& sub hashem { +{ @_ } } # ok\n" "\\& sub hashem { return { @_ } } # ok\n" msgstr "" "\\& sub hashem { { @_ } } # خاطئة بصمت\n" "\\& sub hashem { +{ @_ } } # جيدة\n" "\\& sub hashem { return { @_ } } # جيدة\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "On the other hand, if you want the other meaning, you can do this:" msgstr "من ناحية أخرى، إذا كنت تريد المعنى الآخر، يمكنك فعل ذلك:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& sub showem { { @_ } } # ambiguous (currently ok,\n" "\\& # but may change)\n" "\\& sub showem { {; @_ } } # ok\n" "\\& sub showem { { return @_ } } # ok\n" msgstr "" "\\& sub showem { { @_ } } # غامضة (جيدة حاليًا،\n" "\\& # ولكن قد تتغير)\n" "\\& sub showem { {; @_ } } # جيدة\n" "\\& sub showem { { return @_ } } # جيدة\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The leading CW<\\*(C`+{\\*(C'> and CW<\\*(C`{;\\*(C'> always serve to " "disambiguate the expression to mean either the HASH reference, or the BLOCK." msgstr "" "تعمل العلامات البادئة CW<\\*(C`+{\\*(C'> و CW<\\*(C`{;\\*(C'> دائمًا على " "إزالة الغموض عن التعبير ليعني إما مرجع HASH أو الكتلة (BLOCK)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<الدوال الفرعية المجهولة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "subroutine, anonymous subroutine, reference reference, subroutine scope, lexical closure lexical lexical scope" msgstr "دالة فرعية، دالة فرعية مجهولة، مرجع مرجع، نطاق دالة فرعية، إغلاق معجمي معجمي نطاق معجمي" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Anonymous Subroutines" msgstr "الدوال الفرعية المجهولة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A reference to an anonymous subroutine can be created by using " "\\&CW<\\*(C`sub\\*(C'> without a subname:" msgstr "" "يمكن إنشاء مرجع لدالة فرعية مجهولة باستخدام \\&CW<\\*(C`sub\\*(C'> بدون اسم " "للدالة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $coderef = sub { print \"Boink!\\en\" };\n" msgstr "\\& $coderef = sub { print \"Boink!\\en\" };\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Note the semicolon. Except for the code inside not being immediately " "executed, a CW<\\*(C`sub {}\\*(C'> is not so much a declaration as it is an " "operator, like CW<\\*(C`do{}\\*(C'> or CW<\\*(C`eval{}\\*(C'>. (However, no " "matter how many times you execute that particular line (unless you're in an " "\\&CW), CW<$coderef> will still have a reference to the " "I anonymous subroutine.)" msgstr "" "لاحظ الفاصلة المنقوطة. باستثناء أن الكود الموجود بالداخل لا يُنفذ على الفور، " "فإن CW<\\*(C`sub {}\\*(C'> ليس تصريحًا بقدر ما هو عامل، مثل " "CW<\\*(C`do{}\\*(C'> أو CW<\\*(C`eval{}\\*(C'>. (ومع ذلك، بغض النظر عن عدد " "المرات التي تنفذ فيها هذا السطر المحدد (إلا إذا كنت في \\&CW)، سيظل CW<$coderef> يمتلك مرجعًا لـ I<نفس> الدالة الفرعية المجهولة.)" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Anonymous subroutines act as closures with respect to B variables, " "that is, variables lexically visible within the current scope. Closure is a " "notion out of the Lisp world that says if you define an anonymous function " "in a particular lexical context, it pretends to run in that context even " "when it's called outside the context." msgstr "" "تعمل الدوال الفرعية المجهولة كإغلاقات (closures) فيما يتعلق بمتغيرات " "B، أي المتغيرات المرئية معجميًا داخل النطاق الحالي. الإغلاق هو مفهوم من " "عالم Lisp يقول إنه إذا قمت بتعريف دالة مجهولة في سياق معجمي معين، فإنها " "تتظاهر بالعمل في ذلك السياق حتى عندما يتم استدعاؤها خارج السياق." #. type: Plain text #: debian-trixie debian-unstable msgid "" "In human terms, it's a funny way of passing arguments to a subroutine when " "you define it as well as when you call it. It's useful for setting up " "little bits of code to run later, such as callbacks. You can even do object-" "oriented stuff with it, though Perl already provides a different mechanism " "to do that--see perlobj." msgstr "" "بالمصطلحات البشرية، إنها طريقة ممتعة لتمرير المعاملات إلى دالة فرعية عند " "تعريفها وكذلك عند استدعائها. إنها مفيدة لإعداد أجزاء صغيرة من الكود لتعمل " "لاحقًا، مثل الاستدعاءات الراجعة (callbacks). يمكنك حتى القيام بأشياء كائنية " "التوجه بها، على الرغم من أن بيرل توفر بالفعل آلية مختلفة للقيام بذلك - انظر " "perlobj." #. type: Plain text #: debian-trixie debian-unstable msgid "" "You might also think of closure as a way to write a subroutine template " "without using B. Here's a small example of how closures work:" msgstr "" "قد تفكر أيضًا في الإغلاق كطريقة لكتابة قالب دالة فرعية دون استخدام B. " "إليك مثال صغير على كيفية عمل الإغلاقات:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& sub newprint {\n" "\\& my $x = shift;\n" "\\& return sub { my $y = shift; print \"$x, $y!\\en\"; };\n" "\\& }\n" "\\& $h = newprint(\"Howdy\");\n" "\\& $g = newprint(\"Greetings\");\n" "\\&\n" "\\& # Time passes...\n" "\\&\n" "\\& &$h(\"world\");\n" "\\& &$g(\"earthlings\");\n" msgstr "" "\\& sub newprint {\n" "\\& my $x = shift;\n" "\\& return sub { my $y = shift; print \"$x, $y!\\en\"; };\n" "\\& }\n" "\\& $h = newprint(\"Howdy\");\n" "\\& $g = newprint(\"Greetings\");\n" "\\&\n" "\\& # يمر الوقت...\n" "\\&\n" "\\& &$h(\"world\");\n" "\\& &$g(\"earthlings\");\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "This prints" msgstr "يطبع هذا" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& Howdy, world!\n" "\\& Greetings, earthlings!\n" msgstr "" "\\& Howdy, world!\n" "\\& Greetings, earthlings!\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Note particularly that CW<$x> continues to refer to the value passed into " "B I \"my CW<$x>\" having gone out of scope by the time " "the anonymous subroutine runs. That's what a closure is all about." msgstr "" "لاحظ بشكل خاص أن CW<$x> يستمر في الإشارة إلى القيمة الممررة إلى " "B I<على الرغم> من خروج \"my CW<$x>\" عن النطاق بحلول الوقت الذي " "تعمل فيه الدالة الفرعية المجهولة. هذا هو جوهر الإغلاق." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This applies only to lexical variables, by the way. Dynamic variables " "continue to work as they have always worked. Closure is not something that " "most Perl programmers need trouble themselves about to begin with." msgstr "" "بالمناسبة، ينطبق هذا فقط على المتغيرات المعجمية. تستمر المتغيرات الديناميكية " "في العمل كما عملت دائمًا. الإغلاق ليس شيئًا يحتاج معظم مبرمجي بيرل لإزعاج " "أنفسهم به في البداية." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<المنشئات>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "constructor new" msgstr "منشئ جديد" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Constructors" msgstr "المنشئات" #. type: Plain text #: debian-trixie debian-unstable msgid "" "References are often returned by special subroutines called constructors. " "Perl objects are just references to a special type of object that happens to " "know which package it's associated with. Constructors are just special " "subroutines that know how to create that association. They do so by " "starting with an ordinary reference, and it remains an ordinary reference " "even while it's also being an object. Constructors are often named " "CW. You I call them indirectly:" msgstr "" "غالبًا ما تُعاد المراجع بواسطة دوال فرعية خاصة تسمى المنشئات (constructors). " "كائنات بيرل هي مجرد مراجع لنوع خاص من الكائنات يصادف أنه يعرف الحزمة المرتبط " "بها. المنشئات هي مجرد دوال فرعية خاصة تعرف كيفية إنشاء ذلك الارتباط. وهي " "تفعل ذلك بالبدء بمرجع عادي، ويظل مرجعًا عاديًا حتى أثناء كونه كائنًا أيضًا. " "غالبًا ما تُسمى المنشئات CW. I<يمكنك> استدعاؤها بشكل غير مباشر:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $objref = new Doggie( Tail =E \\*(Aqshort\\*(Aq, Ears =E \\*(Aqlong\\*(Aq );\n" msgstr "\\& $objref = new Doggie( Tail =E \\*(Aqshort\\*(Aq, Ears =E \\*(Aqlong\\*(Aq );\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "But that can produce ambiguous syntax in certain cases, so it's often better " "to use the direct method invocation approach:" msgstr "" "لكن هذا قد ينتج بناء جملة غامضًا في حالات معينة، لذا غالبًا ما يكون من الأفضل " "استخدام نهج استدعاء الطريقة المباشر:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $objref = Doggie-Enew(Tail =E \\*(Aqshort\\*(Aq, Ears =E \\*(Aqlong\\*(Aq);\n" "\\&\n" "\\& use Term::Cap;\n" "\\& $terminal = Term::Cap-ETgetent( { OSPEED =E 9600 });\n" "\\&\n" "\\& use Tk;\n" "\\& $main = MainWindow-Enew();\n" "\\& $menubar = $main-EFrame(-relief =E \"raised\",\n" "\\& -borderwidth =E 2)\n" msgstr "" "\\& $objref = Doggie-Enew(Tail =E \\*(Aqshort\\*(Aq, Ears =E \\*(Aqlong\\*(Aq);\n" "\\&\n" "\\& use Term::Cap;\n" "\\& $terminal = Term::Cap-ETgetent( { OSPEED =E 9600 });\n" "\\&\n" "\\& use Tk;\n" "\\& $main = MainWindow-Enew();\n" "\\& $menubar = $main-EFrame(-relief =E \"raised\",\n" "\\& -borderwidth =E 2)\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This indirect object syntax is only available when \\&CW<\\*(C`use feature " "\"indirect\"\\*(C'> is in effect, and that is not the case when CW<\\*(C`use " "v5.36\\*(C'> (or higher) is requested, it is best to avoid indirect object " "syntax entirely." msgstr "" "يتوفر بناء جملة الكائن غير المباشر هذا فقط عندما تكون ميزة \\&CW<\\*(C`use " "feature \"indirect\"\\*(C'> فعالة، وهذا ليس هو الحال عند طلب CW<\\*(C`use " "v5.36\\*(C'> (أو أعلى)، فمن الأفضل تجنب بناء جملة الكائن غير المباشر تمامًا." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<النشوء الذاتي (Autovivification)>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "autovivification" msgstr "النشوء الذاتي" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Autovivification" msgstr "النشوء الذاتي" #. type: Plain text #: debian-trixie debian-unstable msgid "" "References of the appropriate type can spring into existence if you " "dereference them in a context that assumes they exist. Because we haven't " "talked about dereferencing yet, we can't show you any examples yet." msgstr "" "يمكن للمراجع من النوع المناسب أن تظهر إلى الوجود إذا قمت بفك إسنادها المرجعي " "في سياق يفترض وجودها. ولأننا لم نتحدث عن فك الإسناد المرجعي بعد، لا يمكننا " "أن نعرض لك أي أمثلة بعد." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<فتحات Typeglob>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "*foo{THING} *" msgstr "*foo{THING} *" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Typeglob Slots" msgstr "فتحات Typeglob" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A reference can be created by using a special syntax, lovingly known as the " "*foo{THING} syntax. *foo{THING} returns a reference to the THING slot in " "*foo (which is the symbol table entry which holds everything known as foo)." msgstr "" "يمكن إنشاء مرجع باستخدام بناء جملة خاص، يُعرف بمحبة باسم بناء جملة " "*foo{THING}. يعيد *foo{THING} مرجعًا لفتحة THING في *foo (وهي إدخال جدول " "الرموز الذي يحمل كل شيء يُعرف باسم foo)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $scalarref = *foo{SCALAR};\n" "\\& $arrayref = *ARGV{ARRAY};\n" "\\& $hashref = *ENV{HASH};\n" "\\& $coderef = *handler{CODE};\n" "\\& $ioref = *STDIN{IO};\n" "\\& $globref = *foo{GLOB};\n" "\\& $formatref = *foo{FORMAT};\n" "\\& $globname = *foo{NAME}; # \"foo\"\n" "\\& $pkgname = *foo{PACKAGE}; # \"main\"\n" msgstr "" "\\& $scalarref = *foo{SCALAR};\n" "\\& $arrayref = *ARGV{ARRAY};\n" "\\& $hashref = *ENV{HASH};\n" "\\& $coderef = *handler{CODE};\n" "\\& $ioref = *STDIN{IO};\n" "\\& $globref = *foo{GLOB};\n" "\\& $formatref = *foo{FORMAT};\n" "\\& $globname = *foo{NAME}; # \"foo\"\n" "\\& $pkgname = *foo{PACKAGE}; # \"main\"\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Most of these are self-explanatory, but CW<*foo{IO}> deserves special " "attention. It returns the IO handle, used for file handles (\"open\" in " "perlfunc), sockets (\"socket\" in perlfunc and \"socketpair\" in perlfunc), " "and directory handles (\"opendir\" in perlfunc). For compatibility with " "previous versions of Perl, CW<*foo{FILEHANDLE}> is a synonym for CW<*foo{IO}" ">, though it is discouraged, to encourage a consistent use of one name: IO. " "On perls between v5.8 and v5.22, it will issue a deprecation warning, but " "this deprecation has since been rescinded." msgstr "" "معظم هذه الأشياء تشرح نفسها، لكن CW<*foo{IO}> يستحق اهتمامًا خاصًا. فهو يعيد " "مقبض الإدخال/الإخراج، المستخدم لمقابض الملفات (\"open\" في perlfunc)، " "والمقابس (sockets) (\"socket\" في perlfunc و \"socketpair\" في perlfunc)، " "ومقابض الأدلة (\"opendir\" في perlfunc). للتوافق مع الإصدارات السابقة من " "بيرل، يعد CW<*foo{FILEHANDLE}> مرادفًا لـ CW<*foo{IO}>، على الرغم من عدم " "تشجيعه، للتشجيع على الاستخدام المتسق لاسم واحد: IO. في إصدارات بيرل بين v5.8 " "و v5.22، سيصدر تحذير بشأن الإهمال، ولكن تم التراجع عن هذا الإهمال منذ ذلك " "الحين." #. type: Plain text #: debian-trixie debian-unstable msgid "" "\\&CW<*foo{THING}> returns undef if that particular THING hasn't been used " "yet, except in the case of scalars. CW<*foo{SCALAR}> returns a reference to " "an anonymous scalar if CW<$foo> hasn't been used yet. This might change in " "a future release." msgstr "" "يعيد \\&CW<*foo{THING}> القيمة undef إذا لم يُستخدم THING المحدد بعد، " "باستثناء حالة السلميات. يعيد CW<*foo{SCALAR}> مرجعًا لسلمية مجهولة إذا لم " "يُستخدم CW<$foo> بعد. قد يتغير هذا في إصدار مستقبلي." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "\\&CW<*foo{NAME}> and CW<*foo{PACKAGE}> are the exception, in that they " "return strings, rather than references. These return the package and name " "of the typeglob itself, rather than one that has been assigned to it. So, " "after \\&CW<\\*(C`*foo=*Foo::bar\\*(C'>, CW<*foo> will become \"*Foo::bar\" " "when used as a string, but CW<*foo{PACKAGE}> and CW<*foo{NAME}> will " "continue to produce \"main\" and \"foo\", respectively." msgstr "" "يعد \\&CW<*foo{NAME}> و CW<*foo{PACKAGE}> الاستثناء، حيث يعيدان سلاسل نصية " "بدلاً من المراجع. وتعيد هذه الحزمة والاسم الخاص بـ typeglob نفسه، بدلاً من تلك " "التي عُينت له. لذا، بعد \\&CW<\\*(C`*foo=*Foo::bar\\*(C'>، سيصبح CW<*foo> هو " "\"*Foo::bar\" عند استخدامه كسلسلة نصية، لكن CW<*foo{PACKAGE}> و CW<*foo{NAME}" "> سيستمران في إنتاج \"main\" و \"foo\" على التوالي." #. type: Plain text #: debian-trixie debian-unstable msgid "" "\\&CW<*foo{IO}> is an alternative to the CW<*HANDLE> mechanism given in " "\"Typeglobs and Filehandles\" in perldata for passing filehandles into or " "out of subroutines, or storing into larger data structures. Its " "disadvantage is that it won't create a new filehandle for you. Its " "advantage is that you have less risk of clobbering more than you want to " "with a typeglob assignment. (It still conflates file and directory handles, " "though.) However, if you assign the incoming value to a scalar instead of a " "typeglob as we do in the examples below, there's no risk of that happening." msgstr "" "\\&CW<*foo{IO}> هو بديل لآلية CW<*HANDLE> المذكورة في \"Typeglobs and " "Filehandles\" في perldata لتمرير مقابض الملفات إلى أو من الدوال الفرعية، أو " "تخزينها في هياكل بيانات أكبر. عيبه هو أنه لن ينشئ مقبض ملف جديد لك. ميزته هي " "أن لديك مخاطرة أقل في تخريب أكثر مما تريد بتعيين typeglob. (إنه لا يزال يخلط " "بين مقابض الملفات والأدلة، رغم ذلك.) ومع ذلك، إذا قمت بتعيين القيمة الواردة " "إلى سلمية بدلاً من typeglob كما نفعل في الأمثلة أدناه، فلا يوجد خطر من حدوث " "ذلك." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& splutter(*STDOUT); # pass the whole glob\n" "\\& splutter(*STDOUT{IO}); # pass both file and dir handles\n" "\\&\n" "\\& sub splutter {\n" "\\& my $fh = shift;\n" "\\& print $fh \"her um well a hmmm\\en\";\n" "\\& }\n" "\\&\n" "\\& $rec = get_rec(*STDIN); # pass the whole glob\n" "\\& $rec = get_rec(*STDIN{IO}); # pass both file and dir handles\n" "\\&\n" "\\& sub get_rec {\n" "\\& my $fh = shift;\n" "\\& return scalar E$fhE;\n" "\\& }\n" msgstr "" "\\& splutter(*STDOUT); # تمرير الـ glob بالكامل\n" "\\& splutter(*STDOUT{IO}); # تمرير مقابض الملفات والأدلة معًا\n" "\\&\n" "\\& sub splutter {\n" "\\& my $fh = shift;\n" "\\& print $fh \"her um well a hmmm\\en\";\n" "\\& }\n" "\\&\n" "\\& $rec = get_rec(*STDIN); # تمرير الـ glob بالكامل\n" "\\& $rec = get_rec(*STDIN{IO}); # تمرير مقابض الملفات والأدلة معًا\n" "\\&\n" "\\& sub get_rec {\n" "\\& my $fh = shift;\n" "\\& return scalar E$fhE;\n" "\\& }\n" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Using References" msgstr "استخدام المراجع" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, use dereferencing dereference" msgstr "مرجع، استخدام فك الإسناد المرجعي فك إسناد" #. type: Plain text #: debian-trixie debian-unstable msgid "" "That's it for creating references. By now you're probably dying to know how " "to use references to get back to your long-lost data. There are several " "basic methods." msgstr "" "هذا كل شيء بخصوص إنشاء المراجع. بحلول الآن ربما تتوق لمعرفة كيفية استخدام " "المراجع للعودة إلى بياناتك المفقودة منذ زمن طويل. هناك عدة طرق أساسية." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<سلمية بسيطة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Simple Scalar" msgstr "سلمية بسيطة" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Anywhere you'd put an identifier (or chain of identifiers) as part of a " "variable or subroutine name, you can replace the identifier with a simple " "scalar variable containing a reference of the correct type:" msgstr "" "في أي مكان تضع فيه معرفًا (أو سلسلة من المعرفات) كجزء من اسم متغير أو دالة " "فرعية، يمكنك استبدال المعرف بمتغير سلمي بسيط يحتوي على مرجع من النوع الصحيح:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $bar = $$scalarref;\n" "\\& push(@$arrayref, $filename);\n" "\\& $$arrayref[0] = \"January\";\n" "\\& $$hashref{\"KEY\"} = \"VALUE\";\n" "\\& &$coderef(1,2,3);\n" "\\& print $globref \"output\\en\";\n" msgstr "" "\\& $bar = $$scalarref;\n" "\\& push(@$arrayref, $filename);\n" "\\& $$arrayref[0] = \"January\";\n" "\\& $$hashref{\"KEY\"} = \"VALUE\";\n" "\\& &$coderef(1,2,3);\n" "\\& print $globref \"output\\en\";\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "It's important to understand that we are specifically I dereferencing " "\\&CW<$arrayref[0]> or CW<$hashref{\"KEY\"}> there. The dereference of the " "scalar variable happens I it does any key lookups. Anything more " "complicated than a simple scalar variable must use methods 2 or 3 below. " "However, a \"simple scalar\" includes an identifier that itself uses method " "1 recursively. Therefore, the following prints \"howdy\"." msgstr "" "من المهم فهم أننا لا نقوم بالتحديد بفك إسناد مرجعي لـ \\&CW<$arrayref[0]> أو " "CW<$hashref{\"KEY\"}> هناك. فك إسناد المتغير السلمي يحدث I<قبل> إجراء أي " "عمليات بحث عن مفاتيح. وأي شيء أكثر تعقيدًا من متغير سلمي بسيط يجب أن يستخدم " "الطريقتين 2 أو 3 أدناه. ومع ذلك، فإن \"السلمية البسيطة\" تشمل معرفًا يستخدم " "هو نفسه الطريقة 1 بشكل متكرر. لذلك، يطبع ما يلي \"howdy\"." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $refrefref = \\e\\e\\e\"howdy\";\n" "\\& print $$$$refrefref;\n" msgstr "" "\\& $refrefref = \\e\\e\\e\"howdy\";\n" "\\& print $$$$refrefref;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<كتلة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Block" msgstr "كتلة" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Anywhere you'd put an identifier (or chain of identifiers) as part of a " "variable or subroutine name, you can replace the identifier with a BLOCK " "returning a reference of the correct type. In other words, the previous " "examples could be written like this:" msgstr "" "في أي مكان تضع فيه معرفًا (أو سلسلة من المعرفات) كجزء من اسم متغير أو روتين " "فرعي، يمكنك استبدال المعرف بكتلة (BLOCK) تعيد مرجعًا من النوع الصحيح. بمعنى " "آخر، يمكن كتابة الأمثلة السابقة على النحو التالي:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $bar = ${$scalarref};\n" "\\& push(@{$arrayref}, $filename);\n" "\\& ${$arrayref}[0] = \"January\";\n" "\\& ${$hashref}{\"KEY\"} = \"VALUE\";\n" "\\& &{$coderef}(1,2,3);\n" "\\& $globref-Eprint(\"output\\en\"); # iff IO::Handle is loaded\n" msgstr "" "\\& $bar = ${$scalarref};\n" "\\& push(@{$arrayref}, $filename);\n" "\\& ${$arrayref}[0] = \"January\";\n" "\\& ${$hashref}{\"KEY\"} = \"VALUE\";\n" "\\& &{$coderef}(1,2,3);\n" "\\& $globref-Eprint(\"output\\en\"); # فقط إذا حُمّلت IO::Handle\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Admittedly, it's a little silly to use the curlies in this case, but the " "BLOCK can contain any arbitrary expression, in particular, subscripted " "expressions:" msgstr "" "باعتراف الجميع، من السخف قليلاً استخدام الأقواس المتعرجة في هذه الحالة، ولكن " "يمكن للكتلة (BLOCK) أن تحتوي على أي تعبير اختياري، ولا سيما التعبيرات " "المذيلة (subscripted expressions):" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& &{ $dispatch{$index} }(1,2,3); # call correct routine\n" msgstr "\\& &{ $dispatch{$index} }(1,2,3); # استدعِ الروتين الصحيح\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Because of being able to omit the curlies for the simple case of CW<$$x>, " "people often make the mistake of viewing the dereferencing symbols as proper " "operators, and wonder about their precedence. If they were, though, you " "could use parentheses instead of braces. That's not the case. Consider the " "difference below; case 0 is a short-hand version of case 1, \\&I case 2:" msgstr "" "بسبب القدرة على حذف الأقواس المتعرجة في الحالة البسيطة لـ CW<$$x>، غالبًا ما " "يخطئ الناس في اعتبار رموز فك المرجعية (dereferencing) كمعاملات حقيقية، " "ويتساءلون عن أسبقيتها. لو كانت كذلك، لأمكنك استخدام الأقواس العادية بدلاً من " "الأقواس المتعرجة. الأمر ليس كذلك. انظر إلى الفرق أدناه؛ الحالة 0 هي نسخة " "مختصرة من الحالة 1، I<وليس> الحالة 2:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $$hashref{\"KEY\"} = \"VALUE\"; # CASE 0\n" "\\& ${$hashref}{\"KEY\"} = \"VALUE\"; # CASE 1\n" "\\& ${$hashref{\"KEY\"}} = \"VALUE\"; # CASE 2\n" "\\& ${$hashref-E{\"KEY\"}} = \"VALUE\"; # CASE 3\n" msgstr "" "\\& $$hashref{\"KEY\"} = \"VALUE\"; # الحالة 0\n" "\\& ${$hashref}{\"KEY\"} = \"VALUE\"; # الحالة 1\n" "\\& ${$hashref{\"KEY\"}} = \"VALUE\"; # الحالة 2\n" "\\& ${$hashref-E{\"KEY\"}} = \"VALUE\"; # الحالة 3\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Case 2 is also deceptive in that you're accessing a variable called " "CW<%hashref>, not dereferencing through CW<$hashref> to the hash it's " "presumably referencing. That would be case 3." msgstr "" "الحالة 2 خادعة أيضًا من حيث أنك تصل إلى متغير يسمى CW<%hashref>، بدلاً من فك " "المرجعية عبر CW<$hashref> إلى الهش الذي يُفترض أنه يشير إليه. سيكون ذلك هو " "الحالة 3." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<تدوين السهم>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Arrow Notation" msgstr "تدوين السهم" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Subroutine calls and lookups of individual array elements arise often enough " "that it gets cumbersome to use method 2. As a form of syntactic sugar, the " "examples for method 2 may be written:" msgstr "" "تحدث استدعاءات الروتين الفرعي والبحث عن عناصر المصفوفة الفردية بشكل متكرر " "لدرجة أنه يصبح من المرهق استخدام الطريقة 2. كشكل من أشكال التجميل النحوي، " "يمكن كتابة أمثلة الطريقة 2 كما يلي:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $arrayref-E[0] = \"January\"; # Array element\n" "\\& $hashref-E{\"KEY\"} = \"VALUE\"; # Hash element\n" "\\& $coderef-E(1,2,3); # Subroutine call\n" msgstr "" "\\& $arrayref-E[0] = \"January\"; # عنصر مصفوفة\n" "\\& $hashref-E{\"KEY\"} = \"VALUE\"; # عنصر هش\n" "\\& $coderef-E(1,2,3); # استدعاء روتين فرعي\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The left side of the arrow can be any expression returning a reference, " "including a previous dereference. Note that CW<$array[$x]> is I the " "same thing as CW<\\*(C`$array-E[$x]\\*(C'> here:" msgstr "" "يمكن أن يكون الجانب الأيسر من السهم أي تعبير يعيد مرجعًا، بما في ذلك عملية فك " "مرجعية سابقة. لاحظ أن CW<$array[$x]> I<ليس> نفس الشيء مثل CW<\\*(C`$array-" "E[$x]\\*(C'> هنا:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $array[$x]-E{\"foo\"}-E[0] = \"January\";\n" msgstr "\\& $array[$x]-E{\"foo\"}-E[0] = \"January\";\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "This is one of the cases we mentioned earlier in which references could " "spring into existence when in an lvalue context. Before this statement, " "CW<$array[$x]> may have been undefined. If so, it's automatically defined " "with a hash reference so that we can look up \\&CW<\\*(C`{\"foo\"}\\*(C'> in " "it. Likewise CW<\\*(C`$array[$x]-E{\"foo\"}\\*(C'> will automatically " "get defined with an array reference so that we can look up " "CW<\\*(C`[0]\\*(C'> in it. This process is called I." msgstr "" "هذه إحدى الحالات التي ذكرناها سابقًا حيث يمكن للمراجع أن تنبثق إلى الوجود " "عندما تكون في سياق القيمة اليسارية (lvalue). قبل هذه العبارة، قد يكون " "CW<$array[$x]> غير معرف. إذا كان الأمر كذلك، فإنه يُعرف آليًا بمرجع هش حتى " "نتمكن من البحث عن CW<\\*(C`{\"foo\"}\\*(C'> بداخله. وبالمثل، سيُعرف " "CW<\\*(C`$array[$x]-E{\"foo\"}\\*(C'> آليًا بمرجع مصفوفة حتى نتمكن من " "البحث عن CW<\\*(C`[0]\\*(C'> بداخله. تسمى هذه العملية I<التنشيط التلقائي> " "(autovivification)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "One more thing here. The arrow is optional I brackets subscripts, " "so you can shrink the above down to" msgstr "" "شيء واحد آخر هنا. السهم اختياري I<بين> المذيلات المربعة، لذا يمكنك تقليص ما " "سبق إلى" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $array[$x]{\"foo\"}[0] = \"January\";\n" msgstr "\\& $array[$x]{\"foo\"}[0] = \"January\";\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Which, in the degenerate case of using only ordinary arrays, gives you " "multidimensional arrays just like C's:" msgstr "" "والذي، في الحالة المبسطة لاستخدام المصفوفات العادية فقط، يمنحك مصفوفات " "متعددة الأبعاد تمامًا مثل لغة C:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $score[$x][$y][$z] += 42;\n" msgstr "\\& $score[$x][$y][$z] += 42;\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Well, okay, not entirely like C's arrays, actually. C doesn't know how to " "grow its arrays on demand. Perl does." msgstr "" "حسنًا، ليس تمامًا مثل مصفوفات C في الواقع. لغة C لا تعرف كيف تزيد حجم " "مصفوفاتها عند الطلب، بينما تفعل لغة بيرل ذلك." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<الكائنات>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Objects" msgstr "الكائنات" #. type: Plain text #: debian-trixie debian-unstable msgid "" "If a reference happens to be a reference to an object, then there are " "probably methods to access the things referred to, and you should probably " "stick to those methods unless you're in the class package that defines the " "object's methods. In other words, be nice, and don't violate the object's " "encapsulation without a very good reason. Perl does not enforce " "encapsulation. We are not totalitarians here. We do expect some basic " "civility though." msgstr "" "إذا صادف أن المرجع هو مرجع لكائن، فمن المحتمل وجود طرق للوصول إلى الأشياء " "المشار إليها، ويجب عليك على الأرجح الالتزام بتلك الطرق ما لم تكن في حزمة " "الفئة (class) التي تحدد طرق الكائن. بعبارة أخرى، كن لطيفًا، ولا تنتهك تغليف " "(encapsulation) الكائن دون سبب وجيه للغاية. لغة بيرل لا تفرض التغليف، فنحن " "لسنا شموليين هنا، لكننا نتوقع بعض الكياسة الأساسية." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "I<استخدامات متنوعة>" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Miscellaneous Usage" msgstr "استخدامات متنوعة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Using a string or number as a reference produces a symbolic reference, as " "explained above. Using a reference as a number produces an integer " "representing its storage location in memory. The only useful thing to be " "done with this is to compare two references numerically to see whether they " "refer to the same location." msgstr "" "استخدام سلسلة نصية أو رقم كمرجع ينتج مرجعًا رمزيًا، كما هو موضح أعلاه. استخدام " "المرجع كرقم ينتج عددًا صحيحًا يمثل موقع تخزينه في الذاكرة. الشيء المفيد الوحيد " "الذي يمكن فعله بهذا هو مقارنة مرجعين عدديًا لمعرفة ما إذا كانا يشيران إلى نفس " "الموقع." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, numeric context" msgstr "مرجع، سياق عددي" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& if ($ref1 == $ref2) { # cheap numeric compare of references\n" "\\& print \"refs 1 and 2 refer to the same thing\\en\";\n" "\\& }\n" msgstr "" "\\& if ($ref1 == $ref2) { # مقارنة عددية بسيطة للمراجع\n" "\\& print \"المرجعان 1 و 2 يشيران إلى نفس الشيء\\en\";\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Using a reference as a string produces both its referent's type, including " "any package blessing as described in perlobj, as well as the numeric address " "expressed in hex. The B operator returns just the type of thing the " "reference is pointing to, without the address. See \"ref\" in perlfunc for " "details and examples of its use." msgstr "" "استخدام المرجع كسلسلة نصية ينتج نوع المشار إليه، بما في ذلك أي بركة " "(blessing) للحزمة كما هو موضح في perlobj، بالإضافة إلى العنوان العددي المعبر " "عنه بنظام ست عشري. يعيد المعامل B نوع الشيء الذي يشير إليه المرجع " "فقط، دون العنوان. انظر \"ref\" في perlfunc لمزيد من التفاصيل وأمثلة على " "استخدامه." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, string context" msgstr "مرجع، سياق نصي" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B operator may be used to associate the object a reference " "points to with a package functioning as an object class. See perlobj." msgstr "" "يمكن استخدام معامل B لربط الكائن الذي يشير إليه المرجع بحزمة تعمل " "كفئة (class) كائن. انظر perlobj." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A typeglob may be dereferenced the same way a reference can, because the " "dereference syntax always indicates the type of reference desired. So " "CW<\\*(C`${*foo}\\*(C'> and CW<\\*(C`${\\e$foo}\\*(C'> both indicate the " "same scalar variable." msgstr "" "يمكن فك مرجعية typeglob بنفس الطريقة التي يفك بها المرجع، لأن بنية فك " "المرجعية تشير دائمًا إلى نوع المرجع المطلوب. لذا فإن CW<\\*(C`${*foo}\\*(C'> " "و CW<\\*(C`${\\e$foo}\\*(C'> كلاهما يشيران إلى نفس المتغير السلمي (scalar)." #. type: Plain text #: debian-trixie debian-unstable msgid "Here's a trick for interpolating a subroutine call into a string:" msgstr "إليك خدعة لإقحام استدعاء روتين فرعي داخل سلسلة نصية:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print \"My sub returned @{[mysub(1,2,3)]} that time.\\en\";\n" msgstr "\\& print \"أعاد الروتين الفرعي @{[mysub(1,2,3)]} تلك المرة.\\en\";\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "The way it works is that when the CW<\\*(C`@{...}\\*(C'> is seen in the " "double-quoted string, it's evaluated as a block. The block creates a " "reference to an anonymous array containing the results of the call to " "CW<\\*(C`mysub(1,2,3)\\*(C'>. So the whole block returns a reference to an " "array, which is then dereferenced by CW<\\*(C`@{...}\\*(C'> and stuck into " "the double-quoted string. This chicanery is also useful for arbitrary " "expressions:" msgstr "" "طريقة عملها هي أنه عندما تظهر CW<\\*(C`@{...}\\*(C'> في سلسلة نصية بين " "علامتي اقتباس مزدوجتين، يتم تقييمها ككتلة (block). تنشئ الكتلة مرجعًا لمصفوفة " "مجهولة تحتوي على نتائج استدعاء CW<\\*(C`mysub(1,2,3)\\*(C'>. وبذلك تعيد " "الكتلة بأكملها مرجعًا إلى مصفوفة، ثم يتم فك مرجعيتها بواسطة " "CW<\\*(C`@{...}\\*(C'> وإقحامها في السلسلة النصية. هذه المناورة مفيدة أيضًا " "للتعبيرات الاختيارية:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print \"That yields @{[$n + 5]} widgets\\en\";\n" msgstr "\\& print \"ينتج عن ذلك @{[$n + 5]} من الأدوات\\en\";\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Similarly, an expression that returns a reference to a scalar can be " "dereferenced via CW<\\*(C`${...}\\*(C'>. Thus, the above expression may be " "written as:" msgstr "" "وبالمثل، يمكن فك مرجعية تعبير يعيد مرجعًا إلى متغير سلمي (scalar) عبر " "CW<\\*(C`${...}\\*(C'>. وبالتالي، يمكن كتابة التعبير أعلاه كما يلي:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print \"That yields ${\\e($n + 5)} widgets\\en\";\n" msgstr "\\& print \"ينتج عن ذلك ${\\e($n + 5)} من الأدوات\\en\";\n" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Circular References" msgstr "مراجع دائرية" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "circular reference reference, circular" msgstr "مرجع دائري، مرجع دائري" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "It is possible to create a \"circular reference\" in Perl, which can lead to " "memory leaks. A circular reference occurs when two references contain a " "reference to each other, like this:" msgstr "" "من الممكن إنشاء \"مرجع دائري\" في بيرل، مما قد يؤدي إلى تسرب في الذاكرة. " "يحدث المرجع الدائري عندما يحتوي مرجعان على مرجع لبعضهما البعض، على هذا النحو:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& my $foo = {};\n" "\\& my $bar = { foo =E $foo };\n" "\\& $foo-E{bar} = $bar;\n" msgstr "" "\\& my $foo = {};\n" "\\& my $bar = { foo =E $foo };\n" "\\& $foo-E{bar} = $bar;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "You can also create a circular reference with a single variable:" msgstr "يمكنك أيضًا إنشاء مرجع دائري باستخدام متغير واحد:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& my $foo;\n" "\\& $foo = \\e$foo;\n" msgstr "" "\\& my $foo;\n" "\\& $foo = \\e$foo;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "In this case, the reference count for the variables will never reach 0, and " "the references will never be garbage-collected. This can lead to memory " "leaks." msgstr "" "في هذه الحالة، لن يصل عدد المراجع للمتغيرات أبدًا إلى 0، ولن تُجمع المراجع " "أبدًا بواسطة جامع القمامة (garbage collector). يمكن أن يؤدي هذا إلى تسرب في " "الذاكرة." #. type: Plain text #: debian-trixie debian-unstable msgid "" "Because objects in Perl are implemented as references, it's possible to have " "circular references with objects as well. Imagine a TreeNode class where " "each node references its parent and child nodes. Any node with a parent will " "be part of a circular reference." msgstr "" "نظرًا لأن الكائنات في بيرل تُنفذ كمراجع، فمن الممكن وجود مراجع دائرية مع " "الكائنات أيضًا. تخيل فئة TreeNode حيث يشير كل عقدة إلى عقدها الأب والأبناء. " "أي عقدة لها أب ستكون جزءًا من مرجع دائري." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "You can break circular references by creating a \"weak reference\". A weak " "reference does not increment the reference count for a variable, which means " "that the object can go out of scope and be destroyed. You can weaken a " "reference with the CW<\\*(C`weaken\\*(C'> function exported by the Scalar::" "Util module, or available as CW<\\*(C`builtin::weaken\\*(C'> directly in " "Perl version 5.35.7 or later." msgstr "" "يمكنك كسر المراجع الدائرية عن طريق إنشاء \"مرجع ضعيف\". المرجع الضعيف لا " "يزيد عدد المراجع للمتغير، مما يعني أن الكائن يمكن أن يخرج عن النطاق ويتم " "تدميره. يمكنك إضعاف مرجع باستخدام وظيفة CW<\\*(C`weaken\\*(C'> المصدرة " "بواسطة وحدة Scalar::Util، أو المتوفرة كـ CW<\\*(C`builtin::weaken\\*(C'> " "مباشرة في إصدار بيرل 5.35.7 أو أحدث." #. type: Plain text #: debian-trixie debian-unstable msgid "Here's how we can make the first example safer:" msgstr "إليك كيف يمكننا جعل المثال الأول أكثر أمانًا:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& use Scalar::Util \\*(Aqweaken\\*(Aq;\n" "\\&\n" "\\& my $foo = {};\n" "\\& my $bar = { foo =E $foo };\n" "\\& $foo-E{bar} = $bar;\n" "\\&\n" "\\& weaken $foo-E{bar};\n" msgstr "" "\\& use Scalar::Util \\*(Aqweaken\\*(Aq;\n" "\\&\n" "\\& my $foo = {};\n" "\\& my $bar = { foo =E $foo };\n" "\\& $foo-E{bar} = $bar;\n" "\\&\n" "\\& weaken $foo-E{bar};\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The reference from CW<$foo> to CW<$bar> has been weakened. When the " "\\&CW<$bar> variable goes out of scope, it will be garbage-collected. The " "next time you look at the value of the CW<\\*(C`$foo-E{bar}\\*(C'> key, " "it will be CW<\\*(C`undef\\*(C'>." msgstr "" "أُضعف المرجع من CW<$foo> إلى CW<$bar>. عندما يخرج المتغير CW<$bar> عن النطاق، " "سيُجمع بواسطة جامع القمامة. في المرة القادمة التي تنظر فيها إلى قيمة مفتاح " "CW<\\*(C`$foo-E{bar}\\*(C'>، ستكون CW<\\*(C`undef\\*(C'>." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This action at a distance can be confusing, so you should be careful with " "your use of weaken. You should weaken the reference in the variable that " "will go out of scope I. That way, the longer-lived variable will " "contain the expected reference until it goes out of scope." msgstr "" "يمكن أن يكون هذا الفعل عن بُعد مربكًا، لذا يجب أن تكون حذرًا في استخدامك لـ " "weaken. يجب عليك إضعاف المرجع في المتغير الذي سيخرج عن النطاق I<أولاً>. وبهذه " "الطريقة، سيحتوي المتغير الأطول عمرًا على المرجع المتوقع حتى يخرج هو عن النطاق." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Symbolic references" msgstr "مراجع رمزية" #. type: Plain text #: debian-trixie debian-unstable msgid "" "We said that references spring into existence as necessary if they are " "undefined, but we didn't say what happens if a value used as a reference is " "already defined, but I a hard reference. If you use it as a " "reference, it'll be treated as a symbolic reference. That is, the value of " "the scalar is taken to be the I of a variable, rather than a direct " "link to a (possibly) anonymous value." msgstr "" "قلنا إن المراجع تنبثق إلى الوجود حسب الضرورة إذا كانت غير معرفة، لكننا لم " "نقل ما يحدث إذا كانت القيمة المستخدمة كمرجع معرفة بالفعل، ولكنها I<ليست> " "مرجعًا صلبًا (hard reference). إذا استخدمتها كمرجع، فسيتم التعامل معها كمرجع " "رمزي. أي أن قيمة المتغير السلمي تُعتبر I<اسم> متغير، بدلاً من كونها رابطًا " "مباشرًا لقيمة مجهولة (ربما)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "People frequently expect it to work like this. So it does." msgstr "كثيرًا ما يتوقع الناس أن تعمل بهذه الطريقة. وهي كذلك بالفعل." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $name = \"foo\";\n" "\\& $$name = 1; # Sets $foo\n" "\\& ${$name} = 2; # Sets $foo\n" "\\& ${$name x 2} = 3; # Sets $foofoo\n" "\\& $name-E[0] = 4; # Sets $foo[0]\n" "\\& @$name = (); # Clears @foo\n" "\\& &$name(); # Calls &foo()\n" "\\& $pack = \"THAT\";\n" "\\& ${\"${pack}::$name\"} = 5; # Sets $THAT::foo without eval\n" msgstr "" "\\& $name = \"foo\";\n" "\\& $$name = 1; # يضبط $foo\n" "\\& ${$name} = 2; # يضبط $foo\n" "\\& ${$name x 2} = 3; # يضبط $foofoo\n" "\\& $name-E[0] = 4; # يضبط $foo[0]\n" "\\& @$name = (); # يمسح @foo\n" "\\& &$name(); # يستدعي &foo()\n" "\\& $pack = \"THAT\";\n" "\\& ${\"${pack}::$name\"} = 5; # يضبط $THAT::foo بدون eval\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "This is powerful, and slightly dangerous, in that it's possible to intend " "(with the utmost sincerity) to use a hard reference, and accidentally use a " "symbolic reference instead. To protect against that, you can say" msgstr "" "هذا أمر قوي، وخطير قليلاً، من حيث أنه من الممكن أن تنوي (بمنتهى الصدق) " "استخدام مرجع صلب، وتستخدم بالخطأ مرجعًا رمزيًا بدلاً منه. للحماية من ذلك، يمكنك " "قول" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& use strict \\*(Aqrefs\\*(Aq;\n" msgstr "\\& use strict \\*(Aqrefs\\*(Aq;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "and then only hard references will be allowed for the rest of the enclosing " "block. An inner block may countermand that with" msgstr "" "وبعد ذلك لن يُسمح إلا بالمراجع الصلبة فيما تبقى من الكتلة المحيطة. ويمكن " "لكتلة داخلية أن تلغي ذلك بـ" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& no strict \\*(Aqrefs\\*(Aq;\n" msgstr "\\& no strict \\*(Aqrefs\\*(Aq;\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Only package variables (globals, even if localized) are visible to symbolic " "references. Lexical variables (declared with B) aren't in a symbol " "table, and thus are invisible to this mechanism. For example:" msgstr "" "متغيرات الحزمة فقط (العالمية، حتى لو كانت محلية) هي المرئية للمراجع الرمزية. " "المتغيرات اللفظية (المصرح عنها بـ B) ليست في جدول رموز، وبالتالي فهي " "غير مرئية لهذه الآلية. على سبيل المثال:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& local $value = 10;\n" "\\& $ref = \"value\";\n" "\\& {\n" "\\& my $value = 20;\n" "\\& print $$ref;\n" "\\& }\n" msgstr "" "\\& local $value = 10;\n" "\\& $ref = \"value\";\n" "\\& {\n" "\\& my $value = 20;\n" "\\& print $$ref;\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This will still print 10, not 20. Remember that B affects package " "variables, which are all \"global\" to the package." msgstr "" "سيظل هذا يطبع 10، وليس 20. تذكر أن B تؤثر على متغيرات الحزمة، والتي " "تكون جميعها \"عالمية\" بالنسبة للحزمة." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Not-so-symbolic references" msgstr "مراجع ليست رمزية تمامًا" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Brackets around a symbolic reference can simply serve to isolate an " "identifier or variable name from the rest of an expression, just as they " "always have within a string. For example," msgstr "" "يمكن للأقواس حول المرجع الرمزي أن تعمل ببساطة على عزل معرف أو اسم متغير عن " "بقية التعبير، تمامًا كما كانت تفعل دائمًا داخل السلسلة النصية. على سبيل المثال،" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $push = \"pop on \";\n" "\\& print \"${push}over\";\n" msgstr "" "\\& $push = \"pop on \";\n" "\\& print \"${push}over\";\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "has always meant to print \"pop on over\", even though push is a reserved " "word. This is generalized to work the same without the enclosing double " "quotes, so that" msgstr "" "كانت تعني دائمًا طباعة \"pop on over\"، على الرغم من أن push كلمة محجوزة. تم " "تعميم هذا ليعمل بنفس الطريقة بدون علامات الاقتباس المزدوجة المحيطة، بحيث أن" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print ${push} . \"over\";\n" msgstr "\\& print ${push} . \"over\";\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "and even" msgstr "وحتى" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print ${ push } . \"over\";\n" msgstr "\\& print ${ push } . \"over\";\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "will have the same effect. This construct is I considered to be a " "symbolic reference when you're using strict refs:" msgstr "" "سيكون له نفس التأثير. هذا البناء I<لا> يعتبر مرجعًا رمزيًا عندما تستخدم strict " "refs:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& use strict \\*(Aqrefs\\*(Aq;\n" "\\& ${ bareword }; # Okay, means $bareword.\n" "\\& ${ \"bareword\" }; # Error, symbolic reference.\n" msgstr "" "\\& use strict \\*(Aqrefs\\*(Aq;\n" "\\& ${ bareword }; # حسنًا، تعني $bareword.\n" "\\& ${ \"bareword\" }; # خطأ، مرجع رمزي.\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Similarly, because of all the subscripting that is done using single words, " "the same rule applies to any bareword that is used for subscripting a hash. " "So now, instead of writing" msgstr "" "وبالمثل، نظرًا لكل عمليات التذييل (subscripting) التي تتم باستخدام كلمات " "مفردة، تنطبق نفس القاعدة على أي كلمة مجردة (bareword) تُستخدم لتذييل الهش. " "لذا الآن، بدلاً من كتابة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $hash{ \"aaa\" }{ \"bbb\" }{ \"ccc\" }\n" msgstr "\\& $hash{ \"aaa\" }{ \"bbb\" }{ \"ccc\" }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "you can write just" msgstr "يمكنك كتابة فقط" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $hash{ aaa }{ bbb }{ ccc }\n" msgstr "\\& $hash{ aaa }{ bbb }{ ccc }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "and not worry about whether the subscripts are reserved words. In the rare " "event that you do wish to do something like" msgstr "" "ولا تقلق بشأن ما إذا كانت المذيلات كلمات محجوزة. في الحالة النادرة التي ترغب " "فيها فعلاً في القيام بشيء مثل" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $hash{ shift }\n" msgstr "\\& $hash{ shift }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "you can force interpretation as a reserved word by adding anything that " "makes it more than a bareword:" msgstr "" "يمكنك فرض التفسير ككلمة محجوزة بإضافة أي شيء يجعلها أكثر من كلمة مجردة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $hash{ shift() }\n" "\\& $hash{ +shift }\n" "\\& $hash{ shift @_ }\n" msgstr "" "\\& $hash{ shift() }\n" "\\& $hash{ +shift }\n" "\\& $hash{ shift @_ }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The CW<\\*(C`use warnings\\*(C'> pragma or the B<-w> switch will warn you if " "it interprets a reserved word as a string. But it will no longer warn you " "about using lowercase words, because the string is effectively quoted." msgstr "" "سيقوم pragma الاستخدام CW<\\*(C`use warnings\\*(C'> أو مفتاح B<-w> بتحذيرك " "إذا فسر كلمة محجوزة كسلسلة نصية. لكنه لن يحذرك بعد الآن بشأن استخدام كلمات " "صغيرة، لأن السلسلة تكون مقتبسة فعليًا." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Pseudo-hashes: Using an array as a hash" msgstr "أشباه الهش: استخدام مصفوفة كهش" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "pseudo-hash pseudo hash pseudohash" msgstr "أشباه الهش، شبه هش، شبه هش" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Pseudo-hashes have been removed from Perl. The 'fields' pragma remains " "available." msgstr "أُزيلت أشباه الهش من بيرل. لا يزال pragma 'fields' متاحًا." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Function Templates" msgstr "قوالب الدوال" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "scope, lexical closure lexical lexical scope subroutine, nested sub, nested subroutine, local sub, local" msgstr "نطاق، إغلاق لفظي لفظي نطاق لفظي روتين فرعي، روتين فرعي متداخل، روتين فرعي متداخل، روتين فرعي محلي، روتين فرعي محلي" #. type: Plain text #: debian-trixie debian-unstable msgid "" "As explained above, an anonymous function with access to the lexical " "variables visible when that function was compiled, creates a closure. It " "retains access to those variables even though it doesn't get run until " "later, such as in a signal handler or a Tk callback." msgstr "" "كما هو موضح أعلاه، فإن الدالة المجهولة التي لها حق الوصول إلى المتغيرات " "اللفظية المرئية عند تجميع تلك الدالة، تنشئ إغلاقًا (closure). وهي تحتفظ " "بالوصول إلى تلك المتغيرات حتى لو لم يتم تشغيلها إلا لاحقًا، كما هو الحال في " "معالج الإشارات أو رد نداء Tk." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Using a closure as a function template allows us to generate many functions " "that act similarly. Suppose you wanted functions named after the colors " "that generated HTML font changes for the various colors:" msgstr "" "يسمح لنا استخدام الإغلاق كقالب دالة بتوليد العديد من الدوال التي تعمل بشكل " "متشابه. لنفترض أنك أردت دوالاً مسماة بأسماء الألوان تقوم بتوليد تغييرات خطوط " "HTML لمختلف الألوان:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& print \"Be \", red(\"careful\"), \"with that \", green(\"light\");\n" msgstr "\\& print \"Be \", red(\"careful\"), \"with that \", green(\"light\");\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "The B and B functions would be similar. To create these, " "we'll assign a closure to a typeglob of the name of the function we're " "trying to build." msgstr "" "ستكون دالتا B و B متشابهتين. لإنشاء هذه، سنقوم بتعيين إغلاق " "لـ typeglob باسم الدالة التي نحاول بناءها." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& @colors = qw(red blue green yellow orange purple violet);\n" "\\& for my $name (@colors) {\n" "\\& no strict \\*(Aqrefs\\*(Aq; # allow symbol table manipulation\n" "\\& *$name = *{uc $name} = sub { \"EFONT COLOR=\\*(Aq$name\\*(AqE@_E/FONTE\" };\n" "\\& }\n" msgstr "" "\\& @colors = qw(red blue green yellow orange purple violet);\n" "\\& for my $name (@colors) {\n" "\\& no strict \\*(Aqrefs\\*(Aq; # السماح بالتلاعب بجدول الرموز\n" "\\& *$name = *{uc $name} = sub { \"EFONT COLOR=\\*(Aq$name\\*(AqE@_E/FONTE\" };\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "Now all those different functions appear to exist independently. You can " "call B, B, B, B, B, etc. This " "technique saves on both compile time and memory use, and is less error-prone " "as well, since syntax checks happen at compile time. It's critical that any " "variables in the anonymous subroutine be lexicals in order to create a " "proper closure. That's the reasons for the CW<\\*(C`my\\*(C'> on the loop " "iteration variable." msgstr "" "الآن تبدو كل تلك الدوال المختلفة موجودة بشكل مستقل. يمكنك استدعاء B و " "B و B و B و B وما إلى ذلك. توفر هذه التقنية " "كلاً من وقت التجميع واستخدام الذاكرة، وهي أقل عرضة للخطأ أيضًا، لأن فحص البنية " "يتم في وقت التجميع. من الضروري أن تكون أي متغيرات في الروتين الفرعي المجهول " "لفظية (lexicals) من أجل إنشاء إغلاق سليم. وهذا هو سبب وجود " "CW<\\*(C`my\\*(C'> على متغير تكرار الحلقة." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This is one of the only places where giving a prototype to a closure makes " "much sense. If you wanted to impose scalar context on the arguments of " "these functions (probably not a wise idea for this particular example), you " "could have written it this way instead:" msgstr "" "هذا أحد الأماكن القليلة التي يكون فيها إعطاء نموذج مبدئي (prototype) للإغلاق " "منطقيًا. إذا أردت فرض سياق سلمي (scalar context) على وسائط هذه الدوال (ربما " "ليست فكرة حكيمة لهذا المثال بالذات)، كان بإمكانك كتابتها بهذه الطريقة بدلاً " "من ذلك:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& *$name = sub ($) { \"EFONT COLOR=\\*(Aq$name\\*(AqE$_[0]E/FONTE\" };\n" msgstr "\\& *$name = sub ($) { \"EFONT COLOR=\\*(Aq$name\\*(AqE$_[0]E/FONTE\" };\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "However, since prototype checking happens at compile time, the assignment " "above happens too late to be of much use. You could address this by putting " "the whole loop of assignments within a BEGIN block, forcing it to occur " "during compilation." msgstr "" "ومع ذلك، بما أن فحص النموذج المبدئي يتم في وقت التجميع، فإن التعيين أعلاه " "يحدث بعد فوات الأوان ليكون ذا فائدة كبيرة. يمكنك معالجة ذلك بوضع حلقة " "التعيينات بأكملها داخل كتلة BEGIN، مما يجبرها على الحدوث أثناء التجميع." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Access to lexicals that change over time--like those in the " "CW<\\*(C`for\\*(C'> loop above, basically aliases to elements from the " "surrounding lexical scopes-- only works with anonymous subs, not with named " "subroutines. Generally said, named subroutines do not nest properly and " "should only be declared in the main package scope." msgstr "" "الوصول إلى المتغيرات اللفظية التي تتغير بمرور الوقت - مثل تلك الموجودة في " "حلقة CW<\\*(C`for\\*(C'> أعلاه، وهي أساسًا أسماء مستعارة لعناصر من النطاقات " "اللفظية المحيطة - لا يعمل إلا مع الروتينات الفرعية المجهولة، وليس مع " "الروتينات الفرعية المسماة. بشكل عام، لا تتداخل الروتينات الفرعية المسماة " "بشكل صحيح ويجب التصريح عنها فقط في نطاق الحزمة الرئيس." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This is because named subroutines are created at compile time so their " "lexical variables get assigned to the parent lexicals from the first " "execution of the parent block. If a parent scope is entered a second time, " "its lexicals are created again, while the nested subs still reference the " "old ones." msgstr "" "هذا لأن الروتينات الفرعية المسماة تُنشأ في وقت التجميع، لذا يتم تعيين " "متغيراتها اللفظية إلى المتغيرات اللفظية للأب من أول تنفيذ لكتلة الأب. إذا " "دُخل نطاق الأب مرة ثانية، تُنشأ متغيراته اللفظية مرة أخرى، بينما تظل الروتينات " "الفرعية المتداخلة تشير إلى القديمة." #. type: Plain text #: debian-trixie debian-unstable msgid "" "Anonymous subroutines get to capture each time you execute the " "CW<\\*(C`sub\\*(C'> operator, as they are created on the fly. If you are " "accustomed to using nested subroutines in other programming languages with " "their own private variables, you'll have to work at it a bit in Perl. The " "intuitive coding of this type of thing incurs mysterious warnings about " "\"will not stay shared\" due to the reasons explained above. For example, " "this won't work:" msgstr "" "تتمكن الروتينات الفرعية المجهولة من الالتقاط في كل مرة تنفذ فيها معامل " "CW<\\*(C`sub\\*(C'>، حيث يتم إنشاؤها على الطاير. إذا كنت معتادًا على استخدام " "الروتينات الفرعية المتداخلة في لغات برمجة أخرى مع متغيراتها الخاصة، فسيتعين " "عليك العمل بجهد أكبر قليلاً في بيرل. الترميز البديهي لهذا النوع من الأشياء " "يؤدي إلى تحذيرات غامضة حول \"will not stay shared\" (لن تبقى مشتركة) بسبب " "الأسباب الموضحة أعلاه. على سبيل المثال، هذا لن يعمل:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& sub inner { return $x * 19 } # WRONG\n" "\\& return $x + inner();\n" "\\& }\n" msgstr "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& sub inner { return $x * 19 } # خطأ\n" "\\& return $x + inner();\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "A work-around is the following:" msgstr "الحل البديل هو ما يلي:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& local *inner = sub { return $x * 19 };\n" "\\& return $x + inner();\n" "\\& }\n" msgstr "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& local *inner = sub { return $x * 19 };\n" "\\& return $x + inner();\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Now B can only be called from within B, because of the " "temporary assignments of the anonymous subroutine. But when it does, it has " "normal access to the lexical variable CW<$x> from the scope of \\&B " "at the time outer is invoked." msgstr "" "الآن لا يمكن استدعاء B إلا من داخل B، بسبب التعيينات " "المؤقتة للروتين الفرعي المجهول. ولكن عندما يحدث ذلك، يكون له حق الوصول " "الطبيعي إلى المتغير اللفظي CW<$x> من نطاق B في الوقت الذي يتم فيه " "استدعاء outer." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This has the interesting effect of creating a function local to another " "function, something not normally supported in Perl." msgstr "" "لهذا تأثير مثير للاهتمام يتمثل في إنشاء دالة محلية لدالة أخرى، وهو أمر لا " "يدعمه بيرل عادةً." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Postfix Dereference Syntax" msgstr "صيغة فك المراجع اللاحقة (Postfix)" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Beginning in v5.20.0, a postfix syntax for using references is available. " "It behaves as described in \"Using References\", but instead of a prefixed " "sigil, a postfixed sigil-and-star is used." msgstr "" "بدءًا من الإصدار v5.20.0، أصبحت صيغة اللاحقة (postfix) لاستخدام المراجع " "متاحة. وهي تعمل كما هو موصوف في \"استخدام المراجع\"، ولكن بدلاً من استخدام " "رمز (sigil) سابِق، يُستخدم رمز ونجمة لاحقين." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "For example:" msgstr "على سبيل المثال:" #. type: Plain text #: debian-trixie debian-unstable #, no-wrap msgid "" "\\& $r = \\e@a;\n" "\\& @b = $r-E@*; # equivalent to @$r or @{ $r }\n" "\\&\n" "\\& $r = [ 1, [ 2, 3 ], 4 ];\n" "\\& $r-E[1]-E@*; # equivalent to @{ $r-E[1] }\n" msgstr "" "\\& $r = \\e@a;\n" "\\& @b = $r-E@*; # يكافئ @$r أو @{ $r }\n" "\\&\n" "\\& $r = [ 1, [ 2, 3 ], 4 ];\n" "\\& $r-E[1]-E@*; # يكافئ @{ $r-E[1] }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "In Perl 5.20 and 5.22, this syntax must be enabled with CW. As of Perl 5.24, no feature declarations are " "required to make it available." msgstr "" "في إصداري بيرل 5.20 و 5.22، يجب تفعيل هذه الصيغة باستخدام CW. وبدءًا من بيرل 5.24، لا يلزم التصريح عن أي ميزة " "لجعلها متاحة." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Postfix dereference should work in all circumstances where block (circumfix) " "dereference worked, and should be entirely equivalent. This syntax allows " "dereferencing to be written and read entirely left-to-right. The following " "equivalencies are defined:" msgstr "" "ينبغي أن يعمل فك المراجع اللاحق في جميع الظروف التي يعمل فيها فك المراجع " "الكتلي (المحيط)، ويجب أن يكون مكافئًا له تمامًا. تسمح هذه الصيغة بكتابة وقراءة " "فك المراجع بالكامل من اليسار إلى اليمين. عُرّفت المكافئات التالية:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $sref-E$*; # same as ${ $sref }\n" "\\& $aref-E@*; # same as @{ $aref }\n" "\\& $aref-E$#*; # same as $#{ $aref }\n" "\\& $href-E%*; # same as %{ $href }\n" "\\& $cref-E&*; # same as &{ $cref }\n" "\\& $gref-E**; # same as *{ $gref }\n" msgstr "" "\\& $sref-E$*; # يماثل ${ $sref }\n" "\\& $aref-E@*; # يماثل @{ $aref }\n" "\\& $aref-E$#*; # يماثل $#{ $aref }\n" "\\& $href-E%*; # يماثل %{ $href }\n" "\\& $cref-E&*; # يماثل &{ $cref }\n" "\\& $gref-E**; # يماثل *{ $gref }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Note especially that CW<\\*(C`$cref-E&*\\*(C'> is I equivalent to " "CW<$cref-E()>, and can serve different purposes." msgstr "" "لاحظ بشكل خاص أن CW<\\*(C`$cref-E&*\\*(C'> I<ليس> مكافئًا لـ CW<$cref-" "E()>، ويمكن أن يخدم أغراضًا مختلفة." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Glob elements can be extracted through the postfix dereferencing feature:" msgstr "يمكن استخراج عناصر النوع العام (Glob) عبر ميزة فك المراجع اللاحقة:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $gref-E*{SCALAR}; # same as *{ $gref }{SCALAR}\n" msgstr "\\& $gref-E*{SCALAR}; # يماثل *{ $gref }{SCALAR}\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Postfix array and scalar dereferencing I be used in interpolating " "strings (double quotes or the CW<\\*(C`qq\\*(C'> operator), but only if the " "\\&CW<\\*(C`postderef_qq\\*(C'> feature is enabled. Interpolation of postfix " "array highest index access (CW<\\*(C`-E$#*\\*(C'>) is also supported " "when the CW<\\*(C`postderef_qq\\*(C'> feature is enabled." msgstr "" "I<يمكن> استخدام فك مراجع المصفوفات والمتغيرات اللاحقة في استكمال السلاسل " "النصية (علامات الاقتباس المزدوجة أو معامل CW<\\*(C`qq\\*(C'>)، ولكن فقط في " "حال تفعيل ميزة \\&CW<\\*(C`postderef_qq\\*(C'>. كما يُدعم استكمال الوصول إلى " "أعلى فهرس للمصفوفة اللاحقة (CW<\\*(C`-E$#*\\*(C'>) عند تفعيل ميزة " "CW<\\*(C`postderef_qq\\*(C'>." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Postfix Reference Slicing" msgstr "تشريح المراجع اللاحقة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Value slices of arrays and hashes may also be taken with postfix " "dereferencing notation, with the following equivalencies:" msgstr "" "يمكن أيضًا أخذ شرائح القيم للمصفوفات والمجموعات المترابطة (hashes) باستخدام " "تدوين فك المراجع اللاحق، مع المكافئات التالية:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $aref-E@[ ... ]; # same as @$aref[ ... ]\n" "\\& $href-E@{ ... }; # same as @$href{ ... }\n" msgstr "" "\\& $aref-E@[ ... ]; # يماثل @$aref[ ... ]\n" "\\& $href-E@{ ... }; # يماثل @$href{ ... }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Postfix key/value pair slicing, added in 5.20.0 and documented in the Key/" "Value Hash Slices section of perldata, also behaves as expected:" msgstr "" "تشريح أزواج المفاتيح/القيم اللاحق، الذي أُضيف في 5.20.0 ووُثق في قسم Key/Value " "Hash Slices من perldata، يعمل أيضًا كما هو متوقع:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $aref-E%[ ... ]; # same as %$aref[ ... ]\n" "\\& $href-E%{ ... }; # same as %$href{ ... }\n" msgstr "" "\\& $aref-E%[ ... ]; # يماثل %$aref[ ... ]\n" "\\& $href-E%{ ... }; # يماثل %$href{ ... }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "As with postfix array, postfix value slice dereferencing I be used in " "interpolating strings (double quotes or the CW<\\*(C`qq\\*(C'> operator), " "but only if the CW<\\*(C`postderef_qq\\*(C'> feature is enabled." msgstr "" "كما هو الحال مع المصفوفة اللاحقة، I<يمكن> استخدام فك مراجع تشريح القيم " "اللاحق في استكمال السلاسل النصية (علامات الاقتباس المزدوجة أو معامل " "CW<\\*(C`qq\\*(C'>)، ولكن فقط في حال تفعيل ميزة CW<\\*(C`postderef_qq\\*(C'>." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Assigning to References" msgstr "الإسناد إلى المراجع" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Beginning in v5.22.0, the referencing operator can be assigned to. It " "performs an aliasing operation, so that the variable name referenced on the " "left-hand side becomes an alias for the thing referenced on the right-hand " "side:" msgstr "" "بدءًا من v5.22.0، يمكن الإسناد إلى معامل المراجعة. وهو يؤدي عملية استعارة " "(aliasing)، بحيث يصبح اسم المتغير المشار إليه في الجانب الأيسر مستعارًا للشيء " "المشار إليه في الجانب الأيمن:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\e$x = \\e$y; # $x and $y now point to the same scalar\n" "\\& \\e&foo = \\e&bar; # foo() now means bar()\n" msgstr "" "\\& \\e$x = \\e$y; # يشير $x و $y الآن إلى نفس المتغير\n" "\\& \\e&foo = \\e&bar; # تعني foo() الآن bar()\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This syntax must be enabled with CW<\\*(C`use feature " "\\*(Aqrefaliasing\\*(Aq\\*(C'>. It is experimental, and will warn by " "default unless CW is " "in effect." msgstr "" "يجب تفعيل هذه الصيغة باستخدام CW<\\*(C`use feature " "\\*(Aqrefaliasing\\*(Aq\\*(C'>. وهي تجريبية، وستُصدر تحذيرًا بشكل مبدئي ما لم " "يُفعّل CW." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "These forms may be assigned to, and cause the right-hand side to be " "evaluated in scalar context:" msgstr "" "يمكن الإسناد إلى هذه الأشكال، وتؤدي إلى تقييم الجانب الأيمن في سياق مفرد " "(scalar):" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\e$scalar\n" "\\& \\e@array\n" "\\& \\e%hash\n" "\\& \\e&sub\n" "\\& \\emy $scalar\n" "\\& \\emy @array\n" "\\& \\emy %hash\n" "\\& \\estate $scalar # or @array, etc.\n" "\\& \\eour $scalar # etc.\n" "\\& \\elocal $scalar # etc.\n" "\\& \\elocal our $scalar # etc.\n" "\\& \\e$some_array[$index]\n" "\\& \\e$some_hash{$key}\n" "\\& \\elocal $some_array[$index]\n" "\\& \\elocal $some_hash{$key}\n" "\\& condition ? \\e$this : \\e$that[0] # etc.\n" msgstr "" "\\& \\e$scalar\n" "\\& \\e@array\n" "\\& \\e%hash\n" "\\& \\e&sub\n" "\\& \\emy $scalar\n" "\\& \\emy @array\n" "\\& \\emy %hash\n" "\\& \\estate $scalar # أو @array، إلخ.\n" "\\& \\eour $scalar # إلخ.\n" "\\& \\elocal $scalar # إلخ.\n" "\\& \\elocal our $scalar # إلخ.\n" "\\& \\e$some_array[$index]\n" "\\& \\e$some_hash{$key}\n" "\\& \\elocal $some_array[$index]\n" "\\& \\elocal $some_hash{$key}\n" "\\& condition ? \\e$this : \\e$that[0] # إلخ.\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Slicing operations and parentheses cause the right-hand side to be evaluated " "in list context:" msgstr "" "تؤدي عمليات التشريح والأقواس إلى تقييم الجانب الأيمن في سياق قائمة (list):" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\e@array[5..7]\n" "\\& (\\e@array[5..7])\n" "\\& \\e(@array[5..7])\n" "\\& \\e@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq}\n" "\\& (\\e@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq})\n" "\\& \\e(@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq})\n" "\\& (\\e$scalar)\n" "\\& \\e($scalar)\n" "\\& \\e(my $scalar)\n" "\\& \\emy($scalar)\n" "\\& (\\e@array)\n" "\\& (\\e%hash)\n" "\\& (\\e&sub)\n" "\\& \\e(&sub)\n" "\\& \\e($foo, @bar, %baz)\n" "\\& (\\e$foo, \\e@bar, \\e%baz)\n" msgstr "" "\\& \\e@array[5..7]\n" "\\& (\\e@array[5..7])\n" "\\& \\e(@array[5..7])\n" "\\& \\e@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq}\n" "\\& (\\e@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq})\n" "\\& \\e(@hash{\\*(Aqfoo\\*(Aq,\\*(Aqbar\\*(Aq})\n" "\\& (\\e$scalar)\n" "\\& \\e($scalar)\n" "\\& \\e(my $scalar)\n" "\\& \\emy($scalar)\n" "\\& (\\e@array)\n" "\\& (\\e%hash)\n" "\\& (\\e&sub)\n" "\\& \\e(&sub)\n" "\\& \\e($foo, @bar, %baz)\n" "\\& (\\e$foo, \\e@bar, \\e%baz)\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Each element on the right-hand side must be a reference to a datum of the " "right type. Parentheses immediately surrounding an array (and possibly also " "CW<\\*(C`my\\*(C'>/CW<\\*(C`state\\*(C'>/CW<\\*(C`our\\*(C'>/" "CW<\\*(C`local\\*(C'>) will make each element of the array an alias to the " "corresponding scalar referenced on the right-hand side:" msgstr "" "يجب أن يكون كل عنصر في الجانب الأيمن مرجعًا لبيانات من النوع الصحيح. الأقواس " "التي تحيط بمصفوفة مباشرة (وربما أيضًا CW<\\*(C`my\\*(C'>/" "CW<\\*(C`state\\*(C'>/CW<\\*(C`our\\*(C'>/CW<\\*(C`local\\*(C'>) ستجعل كل " "عنصر في المصفوفة مستعارًا للمتغير المقابل المشار إليه في الجانب الأيمن:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\e(@x) = \\e(@y); # @x and @y now have the same elements\n" "\\& \\emy(@x) = \\e(@y); # likewise\n" "\\& \\e(my @x) = \\e(@y); # likewise\n" "\\& push @x, 3; # but now @x has an extra element that @y lacks\n" "\\& \\e(@x) = (\\e$x, \\e$y, \\e$z); # @x now contains $x, $y, and $z\n" msgstr "" "\\& \\e(@x) = \\e(@y); # أصبح لـ @x و @y نفس العناصر الآن\n" "\\& \\emy(@x) = \\e(@y); # وبالمثل\n" "\\& \\e(my @x) = \\e(@y); # وبالمثل\n" "\\& push @x, 3; # ولكن الآن @x بها عنصر إضافي تفتقر إليه @y\n" "\\& \\e(@x) = (\\e$x, \\e$y, \\e$z); # تحتوي @x الآن على $x و $y و $z\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Combining that form with CW<\\*(C`local\\*(C'> and putting parentheses " "immediately around a hash are forbidden (because it is not clear what they " "should do):" msgstr "" "يُحظر دمج هذا الشكل مع CW<\\*(C`local\\*(C'> ووضع أقواس مباشرة حول المجموعات " "المترابطة (hashes) (لأنه من غير الواضح ما الذي ينبغي أن تفعله):" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\elocal(@array) = foo(); # WRONG\n" "\\& \\e(%hash) = bar(); # WRONG\n" msgstr "" "\\& \\elocal(@array) = foo(); # خطأ\n" "\\& \\e(%hash) = bar(); # خطأ\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Assignment to references and non-references may be combined in lists and " "conditional ternary expressions, as long as the values on the right-hand " "side are the right type for each element on the left, though this may make " "for obfuscated code:" msgstr "" "يمكن دمج الإسناد إلى المراجع وغير المراجع في القوائم والتعبيرات الثلاثية " "الشرطية، طالما أن القيم في الجانب الأيمن هي من النوع الصحيح لكل عنصر في " "اليسار، وإن كان هذا قد يجعل الكود غامضًا:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& (my $tom, \\emy $dick, \\emy @harry) = (\\e1, \\e2, [1..3]);\n" "\\& # $tom is now \\e1\n" "\\& # $dick is now 2 (read-only)\n" "\\& # @harry is (1,2,3)\n" "\\&\n" "\\& my $type = ref $thingy;\n" "\\& ($type ? $type eq \\*(AqARRAY\\*(Aq ? \\e@foo : \\e$bar : $baz) = $thingy;\n" msgstr "" "\\& (my $tom, \\emy $dick, \\emy @harry) = (\\e1, \\e2, [1..3]);\n" "\\& # $tom هو الآن \\e1\n" "\\& # $dick هو الآن 2 (للقراءة فقط)\n" "\\& # @harry هي (1,2,3)\n" "\\&\n" "\\& my $type = ref $thingy;\n" "\\& ($type ? $type eq \\*(AqARRAY\\*(Aq ? \\e@foo : \\e$bar : $baz) = $thingy;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A reference assignment in list context returns a list of references to each " "left-hand value. So for example" msgstr "" "إسناد المراجع في سياق قائمة يعيد قائمة من المراجع لكل قيمة في الجانب الأيسر. " "فعلى سبيل المثال" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& @b = ((\\e$l1, \\e$l2, \\e(@a)) = (\\e$r1, \\e$r2, $\\er3, \\e$4));\n" msgstr "\\& @b = ((\\e$l1, \\e$l2, \\e(@a)) = (\\e$r1, \\e$r2, $\\er3, \\e$4));\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "is equivalent to" msgstr "يكافئ" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& (\\e$l1, \\e$l2, \\e(@a)) = (\\e$r1, \\e$r2, $\\er3, \\e$4);\n" "\\& @b = (\\e$l1, \\e$l2, \\e$a[0], \\e$a[1]);\n" msgstr "" "\\& (\\e$l1, \\e$l2, \\e(@a)) = (\\e$r1, \\e$r2, $\\er3, \\e$4);\n" "\\& @b = (\\e$l1, \\e$l2, \\e$a[0], \\e$a[1]);\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The CW<\\*(C`foreach\\*(C'> loop can also take a reference constructor for " "its loop variable, though the syntax is limited to one of the following, " "with an optional CW<\\*(C`my\\*(C'>, CW<\\*(C`state\\*(C'>, or " "CW<\\*(C`our\\*(C'> after the backslash:" msgstr "" "يمكن لحلقة CW<\\*(C`foreach\\*(C'> أيضًا أن تأخذ منشئ مرجع لمتغير الحلقة " "الخاص بها، وإن كانت الصيغة تقتصر على أحد ما يلي، مع إمكانية استخدام " "CW<\\*(C`my\\*(C'> أو CW<\\*(C`state\\*(C'> أو CW<\\*(C`our\\*(C'> بعد الخط " "المائل العكسي:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\e$s\n" "\\& \\e@a\n" "\\& \\e%h\n" "\\& \\e&c\n" msgstr "" "\\& \\e$s\n" "\\& \\e@a\n" "\\& \\e%h\n" "\\& \\e&c\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "No parentheses are permitted. This feature is particularly useful for " "arrays-of-arrays, or arrays-of-hashes:" msgstr "" "لا يُسمح باستخدام الأقواس. هذه الميزة مفيدة بشكل خاص لمصفوفات المصفوفات، أو " "مصفوفات المجموعات المترابطة (arrays-of-hashes):" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& foreach \\emy @a (@array_of_arrays) {\n" "\\& frobnicate($a[0], $a[-1]);\n" "\\& }\n" "\\&\n" "\\& foreach \\emy %h (@array_of_hashes) {\n" "\\& $h{gelastic}++ if $h{type} eq \\*(Aqfunny\\*(Aq;\n" "\\& }\n" msgstr "" "\\& foreach \\emy @a (@array_of_arrays) {\n" "\\& frobnicate($a[0], $a[-1]);\n" "\\& }\n" "\\&\n" "\\& foreach \\emy %h (@array_of_hashes) {\n" "\\& $h{gelastic}++ if $h{type} eq \\*(Aqfunny\\*(Aq;\n" "\\& }\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "\\&B Aliasing does not work correctly with closures. If you try to " "alias lexical variables from an inner subroutine or CW<\\*(C`eval\\*(C'>, " "the aliasing will only be visible within that inner sub, and will not affect " "the outer subroutine where the variables are declared. This bizarre " "behavior is subject to change." msgstr "" "\\&B<تنبيه:> الاستعارة (Aliasing) لا تعمل بشكل صحيح مع الإغلاقات (closures). " "إذا حاولت استعارة متغيرات معجمية من دالة فرعية داخلية أو " "CW<\\*(C`eval\\*(C'>، فسيكون الاستعارة مرئيًا فقط داخل تلك الدالة الفرعية، " "ولن يؤثر على الدالة الخارجية التي صُرّح عن المتغيرات فيها. هذا السلوك الغريب " "عرضة للتغيير." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Declaring a Reference to a Variable" msgstr "التصريح عن مرجع لمتغير" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Beginning in v5.26.0, the referencing operator can come after " "CW<\\*(C`my\\*(C'>, \\&CW<\\*(C`state\\*(C'>, CW<\\*(C`our\\*(C'>, or " "CW<\\*(C`local\\*(C'>. This syntax must be enabled with CW<\\*(C`use " "feature \\*(Aqdeclared_refs\\*(Aq\\*(C'>. It is experimental, and will warn " "by default unless CW<\\*(C`no warnings \\*(Aqexperimental::" "refaliasing\\*(Aq\\*(C'> is in effect." msgstr "" "بدءًا من v5.26.0، يمكن أن يأتي معامل المراجعة بعد CW<\\*(C`my\\*(C'>، أو " "\\&CW<\\*(C`state\\*(C'>، أو CW<\\*(C`our\\*(C'>، أو CW<\\*(C`local\\*(C'>. " "يجب تفعيل هذه الصيغة باستخدام CW<\\*(C`use feature " "\\*(Aqdeclared_refs\\*(Aq\\*(C'>. وهي تجريبية، وستُصدر تحذيرًا بشكل مبدئي ما " "لم يُفعّل CW<\\*(C`no warnings \\*(Aqexperimental::refaliasing\\*(Aq\\*(C'>." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "This feature makes these:" msgstr "هذه الميزة تجعل هذه:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& my \\e$x;\n" "\\& our \\e$y;\n" msgstr "" "\\& my \\e$x;\n" "\\& our \\e$y;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "equivalent to:" msgstr "تكافئ:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& \\emy $x;\n" "\\& \\eour $x;\n" msgstr "" "\\& \\emy $x;\n" "\\& \\eour $x;\n" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "It is intended mainly for use in assignments to references (see \"Assigning " "to References\", above). It also allows the backslash to be used on just " "some items in a list of declared variables:" msgstr "" "الغرض منها رئيس هو الاستخدام في الإسنادات إلى المراجع (انظر \"الإسناد إلى " "المراجع\" أعلاه). كما أنها تسمح باستخدام الخط المائل العكسي على بعض العناصر " "فقط في قائمة المتغيرات المُصرح عنها:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& my ($foo, \\e@bar, \\e%baz); # equivalent to: my $foo, \\emy(@bar, %baz);\n" msgstr "\\& my ($foo, \\e@bar, \\e%baz); # يكافئ: my $foo, \\emy(@bar, %baz);\n" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "WARNING: Don't use references as hash keys" msgstr "تحذير: لا تستخدم المراجع كمفاتيح لمجموعة مترابطة (hash)" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "reference, string context reference, use as hash key" msgstr "المرجع، مرجع سياق السلسلة، الاستخدام كمفتاح لمجموعة مترابطة" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "You may not (usefully) use a reference as the key to a hash. It will be " "converted into a string:" msgstr "" "لا يمكنك (بشكل مفيد) استخدام مرجع كمفتاح لمجموعة مترابطة. سيتم تحويله إلى " "سلسلة نصية:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\& $x{ \\e$x } = $x;\n" msgstr "\\& $x{ \\e$x } = $x;\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "If you try to dereference the key, it won't do a hard dereference, and you " "won't accomplish what you're attempting. You might want to do something " "more like" msgstr "" "إذا حاولت فك مراجع المفتاح، فلن يؤدي ذلك إلى فك مراجع حقيقي، ولن تحقق ما " "تحاول القيام به. قد ترغب في القيام بشيء أقرب إلى" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "\\& $r = \\e@a;\n" "\\& $x{ $r } = $r;\n" msgstr "" "\\& $r = \\e@a;\n" "\\& $x{ $r } = $r;\n" #. type: Plain text #: debian-trixie debian-unstable msgid "" "And then at least you can use the B, which will be real refs, " "instead of the B, which won't." msgstr "" "وبعد ذلك، يمكنك على الأقل استخدام B، والتي ستكون مراجع حقيقية، " "بدلاً من B، التي لن تكون كذلك." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The standard Tie::RefHash module provides a convenient workaround to this." msgstr "توفر وحدة Tie::RefHash القياسية حلاً مناسبًا لهذا الأمر." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "انظر أيضًا" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Besides the obvious documents, source code can be instructive. Some " "pathological examples of the use of references can be found in the I regression test in the Perl source directory." msgstr "" "بصرف النظر عن الوثائق البديهية، يمكن أن يكون الكود المصدري تعليميًا. يمكن " "العثور على بعض الأمثلة المعقدة لاستخدام المراجع في اختبار التراجع I في دليل مصدر بيرل." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "See also perldsc and perllol for how to use references to create complex " "data structures, and perlootut and perlobj for how to use them to create " "objects." msgstr "" "انظر أيضًا perldsc و perllol لمعرفة كيفية استخدام المراجع لإنشاء هياكل بيانات " "معقدة، و perlootut و perlobj لمعرفة كيفية استخدامها لإنشاء كائنات." #. type: TH #: debian-unstable #, no-wrap msgid "2025-11-16" msgstr "16 نوفمبر 2025" #. type: TH #: fedora-44 opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "2026-03-09" msgstr "9 مارس 2026" #. type: TH #: fedora-44 opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "perl v5.42.1" msgstr "بيرل v5.42.1" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Symbolic references are names of variables or other objects, just as a " "symbolic link in a Unix filesystem contains merely the name of a file. The " "CW<*glob> notation is something of a symbolic reference. (Symbolic " "references are sometimes called \"soft references\", but please don\\*(Aqt " "call them that; references are confusing enough without useless synonyms.)" msgstr "" "المراجع الرمزية هي أسماء لمتغيرات أو كائنات أخرى، تمامًا كما يحتوي الارتباط " "الرمزي في نظام ملفات Unix على مجرد اسم ملف. تدوين CW<*glob> هو نوع من " "المراجع الرمزية. (تُسمى المراجع الرمزية أحيانًا \"مراجع لينة\"، ولكن يُرجى عدم " "تسميتها كذلك؛ فالمراجع مربكة بما يكفي دون مرادفات عديمة الفائدة)." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "References are easy to use in Perl. There is just one overriding principle: " "in general, Perl does no implicit referencing or dereferencing. When a " "scalar is holding a reference, it always behaves as a simple scalar. It " "doesn\\*(Aqt magically start being an array or hash or subroutine; you have " "to tell it explicitly to do so, by dereferencing it." msgstr "" "المراجع سهلة الاستخدام في بيرل. هناك مبدأ رئيس واحد فقط: بشكل عام، لا يقوم " "بيرل بأي مراجعة أو فك مراجع ضمني. عندما يحمل متغير مفرد مرجعًا، فإنه يتصرف " "دائمًا كمتغير مفرد بسيط. ولا يبدأ سحريًا في أن يكون مصفوفة أو مجموعة مترابطة " "أو دالة فرعية؛ عليك إخباره صراحةً بالقيام بذلك، عن طريق فك مراجعة المتغير." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "By using the backslash operator on a variable, subroutine, or value. (This " "works much like the & (address-of) operator in C.) This typically creates " "I reference to a variable, because there\\*(Aqs already a reference " "to the variable in the symbol table. But the symbol table reference might " "go away, and you\\*(Aqll still have the reference that the backslash " "returned. Here are some examples:" msgstr "" "باستخدام معامل الخط المائل العكسي على متغير أو دالة فرعية أو قيمة. (هذا يعمل " "بشكل مشابه جدًا لمعامل & (عنوان الـ) في لغة C.) يؤدي هذا عادةً إلى إنشاء مرجع " "I<آخر> لمتغير، لأن هناك بالفعل مرجعًا للمتغير في جدول الرموز. ولكن قد يختفي " "مرجع جدول الرموز، وسيظل لديك المرجع الذي أعاده الخط المائل العكسي. فيما يلي " "بعض الأمثلة:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "It isn\\*(Aqt possible to create a true reference to an IO handle " "(filehandle or dirhandle) using the backslash operator. The most you can " "get is a reference to a typeglob, which is actually a complete symbol table " "entry. But see the explanation of the CW<*foo{THING}> syntax below. " "However, you can still use type globs and globrefs as though they were IO " "handles." msgstr "" "ليس من الممكن إنشاء مرجع حقيقي لمقبض إدخال/إخراج (IO handle) (مقبض ملف أو " "مقبض دليل) باستخدام معامل الخط المائل العكسي. أقصى ما يمكنك الحصول عليه هو " "مرجع لـ typeglob، وهو في الواقع إدخال كامل في جدول الرموز. ولكن انظر شرح " "صيغة CW<*foo{THING}> أدناه. ومع ذلك، لا يزال بإمكانك استخدام type globs و " "globrefs كما لو كانت مقابض إدخال/إخراج." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Here we\\*(Aqve created a reference to an anonymous array of three elements " "whose final element is itself a reference to another anonymous array of " "three elements. (The multidimensional syntax described later can be used to " "access this. For example, after the above, CW<\\*(C`$arrayref-E[2]" "[1]\\*(C'> would have the value \"b\".)" msgstr "" "لقد أنشأنا هنا مرجعًا لمصفوفة مجهولة مكونة من ثلاثة عناصر، وعنصرها الأخير هو " "نفسه مرجع لمصفوفة مجهولة أخرى مكونة من ثلاثة عناصر. (يمكن استخدام الصيغة " "متعددة الأبعاد الموصوفة لاحقًا للوصول إلى ذلك. على سبيل المثال، بعد ما سبق، " "ستكون قيمة CW<\\*(C`$arrayref-E[2][1]\\*(C'> هي \"b\".)" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Taking a reference to an enumerated list is not the same as using square " "brackets--instead it\\*(Aqs the same as creating a list of references!" msgstr "" "أخذ مرجع لقائمة معدودة ليس مثل استخدام الأقواس المربعة -- بدلاً من ذلك، هو " "نفس إنشاء قائمة من المراجع!" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Because curly brackets (braces) are used for several other things including " "BLOCKs, you may occasionally have to disambiguate braces at the beginning of " "a statement by putting a CW<\\*(C`+\\*(C'> or a CW<\\*(C`return\\*(C'> in " "front so that Perl realizes the opening brace isn\\*(Aqt starting a BLOCK. " "The economy and mnemonic value of using curlies is deemed worth this " "occasional extra hassle." msgstr "" "نظرًا لأن الأقواس المتعرجة (braces) تُستخدم لأشياء أخرى متعددة بما في ذلك " "الكتل (BLOCKs)، فقد تضطر أحيانًا إلى إزالة اللبس عن الأقواس في بداية الجملة " "بوضع CW<\\*(C`+\\*(C'> أو CW<\\*(C`return\\*(C'> في المقدمة حتى يدرك بيرل أن " "القوس الافتتاحي لا يبدأ كتلة (BLOCK). وتُعتبر القيمة الاقتصادية والتذكارية " "لاستخدام الأقواس المتعرجة تستحق هذا العناء الإضافي العرضي." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Note the semicolon. Except for the code inside not being immediately " "executed, a CW<\\*(C`sub {}\\*(C'> is not so much a declaration as it is an " "operator, like CW<\\*(C`do{}\\*(C'> or CW<\\*(C`eval{}\\*(C'>. (However, no " "matter how many times you execute that particular line (unless you\\*(Aqre " "in an \\&CW), CW<$coderef> will still have a reference to the " "I anonymous subroutine.)" msgstr "" "لاحظ الفاصلة المنقوطة. باستثناء أن الكود الموجود بالداخل لا يُنفذ على الفور، " "فإن CW<\\*(C`sub {}\\*(C'> لا يُعد تصريحًا بقدر ما هو معامل، مثل " "CW<\\*(C`do{}\\*(C'> أو CW<\\*(C`eval{}\\*(C'>. (ومع ذلك، بغض النظر عن عدد " "مرات تنفيذ هذا السطر المحدد (ما لم تكن في \\&CW)، سيظل لدى " "CW<$coderef> مرجع لنفس الدالة الفرعية المجهولة I<نفسها>.)" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Anonymous subroutines act as closures with respect to B variables, " "that is, variables lexically visible within the current scope. Closure is a " "notion out of the Lisp world that says if you define an anonymous function " "in a particular lexical context, it pretends to run in that context even " "when it\\*(Aqs called outside the context." msgstr "" "تعمل الدوال الفرعية المجهولة كإغلاقات (closures) فيما يتعلق بمتغيرات " "B، أي المتغيرات المرئية معجميًا ضمن النطاق الحالي. الإغلاق هو مفهوم من " "عالم Lisp يقول إنه إذا عرفت دالة مجهولة في سياق معجمي معين، فإنها تتظاهر " "بالعمل في ذلك السياق حتى عندما تُستدعى خارج السياق." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "In human terms, it\\*(Aqs a funny way of passing arguments to a subroutine " "when you define it as well as when you call it. It\\*(Aqs useful for " "setting up little bits of code to run later, such as callbacks. You can " "even do object-oriented stuff with it, though Perl already provides a " "different mechanism to do that--see perlobj." msgstr "" "بالمصطلحات البشرية، إنها طريقة مضحكة لتمرير الوسائط إلى دالة فرعية عند " "تعريفها وكذلك عند استدعائها. وهي مفيدة لإعداد أجزاء صغيرة من الكود لتعمل " "لاحقًا، مثل ردود النداء (callbacks). يمكنك حتى القيام بأشياء موجهة للكائنات " "بها، على الرغم من أن بيرل يوفر بالفعل آلية مختلفة للقيام بذلك -- انظر " "perlobj." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "You might also think of closure as a way to write a subroutine template " "without using B. Here\\*(Aqs a small example of how closures work:" msgstr "" "قد تفكر أيضًا في الإغلاق كطريقة لكتابة قالب دالة فرعية دون استخدام B. " "إليك مثال صغير لكيفية عمل الإغلاقات:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Note particularly that CW<$x> continues to refer to the value passed into " "B I \"my CW<$x>\" having gone out of scope by the time " "the anonymous subroutine runs. That\\*(Aqs what a closure is all about." msgstr "" "لاحظ بشكل خاص أن CW<$x> يستمر في الإشارة إلى القيمة الممررة إلى " "B I<على الرغم من> خروج \"my CW<$x>\" من النطاق بحلول وقت تشغيل " "الدالة الفرعية المجهولة. هذا هو جوهر الإغلاق." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "References are often returned by special subroutines called constructors. " "Perl objects are just references to a special type of object that happens to " "know which package it\\*(Aqs associated with. Constructors are just special " "subroutines that know how to create that association. They do so by " "starting with an ordinary reference, and it remains an ordinary reference " "even while it\\*(Aqs also being an object. Constructors are often named " "CW. You I call them indirectly:" msgstr "" "غالبًا ما تُعاد المراجع بواسطة دوال فرعية خاصة تسمى المنشئات (constructors). " "كائنات بيرل هي مجرد مراجع لنوع خاص من الكائنات التي تعرف بالصدفة الحزمة " "المرتبطة بها. المنشئات هي مجرد دوال فرعية خاصة تعرف كيفية إنشاء هذا " "الارتباط. وهي تفعل ذلك من خلال البدء بمرجع عادي، ويظل مرجعًا عاديًا حتى عندما " "يكون كائنًا أيضًا. غالبًا ما تُسمى المنشئات CW. I<يمكنك> استدعاؤها بشكل " "غير مباشر:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "But that can produce ambiguous syntax in certain cases, so it\\*(Aqs often " "better to use the direct method invocation approach:" msgstr "" "ولكن يمكن أن ينتج عن ذلك صيغة غامضة في حالات معينة، لذا غالبًا ما يكون من " "الأفضل استخدام نهج استدعاء الطريقة المباشر:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "References of the appropriate type can spring into existence if you " "dereference them in a context that assumes they exist. Because we " "haven\\*(Aqt talked about dereferencing yet, we can\\*(Aqt show you any " "examples yet." msgstr "" "يمكن للمراجع من النوع المناسب أن تظهر للوجود إذا قمت بفك مراجعها في سياق " "يفترض وجودها. ولأننا لم نتحدث عن فك المراجع بعد، فلا يمكننا عرض أي أمثلة لك " "بعد." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "\\&CW<*foo{THING}> returns undef if that particular THING hasn\\*(Aqt been " "used yet, except in the case of scalars. CW<*foo{SCALAR}> returns a " "reference to an anonymous scalar if CW<$foo> hasn\\*(Aqt been used yet. " "This might change in a future release." msgstr "" "يعيد \\&CW<*foo{THING}> القيمة undef إذا لم يُستخدم هذا الـ THING المعين بعد، " "باستثناء حالة المتغيرات المفردة (scalars). يعيد CW<*foo{SCALAR}> مرجعًا " "لمتغير مفرد مجهول إذا لم يُستخدم CW<$foo> بعد. قد يتغير هذا في إصدار مستقبلي." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "\\&CW<*foo{IO}> is an alternative to the CW<*HANDLE> mechanism given in " "\"Typeglobs and Filehandles\" in perldata for passing filehandles into or " "out of subroutines, or storing into larger data structures. Its " "disadvantage is that it won\\*(Aqt create a new filehandle for you. Its " "advantage is that you have less risk of clobbering more than you want to " "with a typeglob assignment. (It still conflates file and directory handles, " "though.) However, if you assign the incoming value to a scalar instead of a " "typeglob as we do in the examples below, there\\*(Aqs no risk of that " "happening." msgstr "" "\\&CW<*foo{IO}> هو بديل لآلية CW<*HANDLE> الواردة في \"Typeglobs and " "Filehandles\" في perldata لتمرير مقابض الملفات إلى الدوال الفرعية أو منها، " "أو تخزينها في هياكل بيانات أكبر. عيبه هو أنه لن ينشئ مقبض ملف جديد لك. " "وميزته هي أن هناك خطرًا أقل لإتلاف أكثر مما تريد باستخدام إسناد typeglob. " "(ومع ذلك، فإنه لا يزال يخلط بين مقابض الملفات والدلائل.) ولكن إذا أسندت " "القيمة الواردة إلى متغير مفرد بدلاً من typeglob كما نفعل في الأمثلة أدناه، " "فلا يوجد خطر لحدوث ذلك." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "That\\*(Aqs it for creating references. By now you\\*(Aqre probably dying " "to know how to use references to get back to your long-lost data. There are " "several basic methods." msgstr "" "هذا كل ما في الأمر بخصوص إنشاء المراجع. بحلول الآن، ربما تتوق لمعرفة كيفية " "استخدام المراجع لاستعادة بياناتك المفقودة منذ زمن طويل. هناك عدة طرق أساسية." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Anywhere you\\*(Aqd put an identifier (or chain of identifiers) as part of a " "variable or subroutine name, you can replace the identifier with a simple " "scalar variable containing a reference of the correct type:" msgstr "" "في أي مكان تضع فيه معرفًا (أو سلسلة من المعرفات) كجزء من اسم متغير أو دالة " "فرعية، يمكنك استبدال المعرف بمتغير مفرد بسيط يحتوي على مرجع من النوع الصحيح:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "It\\*(Aqs important to understand that we are specifically I " "dereferencing \\&CW<$arrayref[0]> or CW<$hashref{\"KEY\"}> there. The " "dereference of the scalar variable happens I it does any key " "lookups. Anything more complicated than a simple scalar variable must use " "methods 2 or 3 below. However, a \"simple scalar\" includes an identifier " "that itself uses method 1 recursively. Therefore, the following prints " "\"howdy\"." msgstr "" "من المهم فهم أننا لا نقوم بفك مراجع \\&CW<$arrayref[0]> أو " "CW<$hashref{\"KEY\"}> هناك تحديدًا. يحدث فك مراجع المتغير المفرد I<قبل> " "القيام بأي عمليات بحث عن المفاتيح. وأي شيء أكثر تعقيدًا من متغير مفرد بسيط " "يجب أن يستخدم الطريقة 2 أو 3 أدناه. ومع ذلك، فإن \"المتغير المفرد البسيط\" " "يشمل المعرف الذي يستخدم الطريقة 1 بشكل تكراري. لذلك، فإن ما يلي يطبع " "\"howdy\"." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Anywhere you\\*(Aqd put an identifier (or chain of identifiers) as part of a " "variable or subroutine name, you can replace the identifier with a BLOCK " "returning a reference of the correct type. In other words, the previous " "examples could be written like this:" msgstr "" "في أي مكان تضع فيه معرفًا (أو سلسلة من المعرفات) كجزء من اسم متغير أو دالة " "فرعية، يمكنك استبدال المعرف بكتلة (BLOCK) تعيد مرجعًا من النوع الصحيح. بمعنى " "آخر، يمكن كتابة الأمثلة السابقة على النحو التالي:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Admittedly, it\\*(Aqs a little silly to use the curlies in this case, but " "the BLOCK can contain any arbitrary expression, in particular, subscripted " "expressions:" msgstr "" "باعتراف الجميع، من السخف قليلاً استخدام الأقواس المتعرجة في هذه الحالة، ولكن " "يمكن أن تحتوي الكتلة (BLOCK) على أي تعبير عشوائي، لا سيما التعبيرات المفهرسة:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Because of being able to omit the curlies for the simple case of CW<$$x>, " "people often make the mistake of viewing the dereferencing symbols as proper " "operators, and wonder about their precedence. If they were, though, you " "could use parentheses instead of braces. That\\*(Aqs not the case. " "Consider the difference below; case 0 is a short-hand version of case 1, " "\\&I case 2:" msgstr "" "بسبب القدرة على حذف الأقواس المتعرجة في الحالة البسيطة لـ CW<$$x>، غالبًا ما " "يخطئ الناس في اعتبار رموز فك المراجع معاملات حقيقية، ويتساءلون عن أسبقيتها. " "لو كانت كذلك، لكان بإمكانك استخدام الأقواس العادية بدلاً من الأقواس المتعرجة. " "الأمر ليس كذلك. تأمل الفرق أدناه؛ الحالة 0 هي نسخة مختصرة من الحالة 1، " "\\&I<وليس> الحالة 2:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Case 2 is also deceptive in that you\\*(Aqre accessing a variable called " "CW<%hashref>, not dereferencing through CW<$hashref> to the hash it\\*(Aqs " "presumably referencing. That would be case 3." msgstr "" "الحالة 2 مخادعة أيضًا من حيث أنك تصل إلى متغير يسمى CW<%hashref>، وليس فك " "المراجع عبر CW<$hashref> إلى المجموعة المترابطة التي يفترض أنه يشير إليها. " "سيكون ذلك هو الحالة 3." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "This is one of the cases we mentioned earlier in which references could " "spring into existence when in an lvalue context. Before this statement, " "CW<$array[$x]> may have been undefined. If so, it\\*(Aqs automatically " "defined with a hash reference so that we can look up " "\\&CW<\\*(C`{\"foo\"}\\*(C'> in it. Likewise CW<\\*(C`$array[$x]-" "E{\"foo\"}\\*(C'> will automatically get defined with an array reference " "so that we can look up CW<\\*(C`[0]\\*(C'> in it. This process is called " "I." msgstr "" "هذه إحدى الحالات التي ذكرناها سابقًا حيث يمكن للمراجع أن تنبثق إلى الوجود " "عندما تكون في سياق القيمة اليسارية (lvalue). قبل هذه العبارة، قد يكون " "CW<$array[$x]> غير معرف. إذا كان الأمر كذلك، فإنه يُعرف آليًا بمرجع هش حتى " "نتمكن من البحث عن CW<\\*(C`{\"foo\"}\\*(C'> بداخله. وبالمثل، سيُعرف " "CW<\\*(C`$array[$x]-E{\"foo\"}\\*(C'> آليًا بمرجع مصفوفة حتى نتمكن من " "البحث عن CW<\\*(C`[0]\\*(C'> بداخله. تسمى هذه العملية I<التنشيط التلقائي> " "(autovivification)." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Which, in the degenerate case of using only ordinary arrays, gives you " "multidimensional arrays just like C\\*(Aqs:" msgstr "" "والذي يمنحك، في الحالة البسيطة لاستخدام المصفوفات العادية فقط، مصفوفات " "متعددة الأبعاد تمامًا مثل لغة C:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Well, okay, not entirely like C\\*(Aqs arrays, actually. C doesn\\*(Aqt " "know how to grow its arrays on demand. Perl does." msgstr "" "حسنًا، ليس تمامًا مثل مصفوفات C في الواقع. لا تعرف لغة C كيفية تنمية مصفوفاتها " "عند الطلب. أما بيرل فيعرف." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If a reference happens to be a reference to an object, then there are " "probably methods to access the things referred to, and you should probably " "stick to those methods unless you\\*(Aqre in the class package that defines " "the object\\*(Aqs methods. In other words, be nice, and don\\*(Aqt violate " "the object\\*(Aqs encapsulation without a very good reason. Perl does not " "enforce encapsulation. We are not totalitarians here. We do expect some " "basic civility though." msgstr "" "إذا صادف أن يكون المرجع مرجعًا لكائن، فمن المحتمل أن تكون هناك طرق للوصول إلى " "الأشياء المشار إليها، ويجب عليك على الأرجح الالتزام بتلك الطرق ما لم تكن في " "حزمة الفئة (class package) التي تعرف طرق الكائن. بعبارة أخرى، كن لطيفًا ولا " "تنتهك تغليف الكائن دون سبب وجيه للغاية. لا يفرض بيرل التغليف. نحن لسنا " "استبداديين هنا. لكننا نتوقع بعض الكياسة الأساسية." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Using a reference as a string produces both its referent\\*(Aqs type, " "including any package blessing as described in perlobj, as well as the " "numeric address expressed in hex. The B operator returns just the " "type of thing the reference is pointing to, without the address. See " "\"ref\" in perlfunc for details and examples of its use." msgstr "" "ينتج عن استخدام المرجع كسلسلة نصية كل من نوع المرجع إليه، بما في ذلك أي " "مباركة حزمة (package blessing) كما هو موصوف في perlobj، بالإضافة إلى العنوان " "العددي المعبر عنه بالقيم الست عشرية. يعيد معامل B فقط نوع الشيء الذي " "يشير إليه المرجع، بدون العنوان. انظر \"ref\" في perlfunc لمزيد من التفاصيل " "وأمثلة على استخدامه." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "Here\\*(Aqs a trick for interpolating a subroutine call into a string:" msgstr "إليك حيلة لاستكمال استدعاء دالة فرعية داخل سلسلة نصية:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The way it works is that when the CW<\\*(C`@{...}\\*(C'> is seen in the " "double-quoted string, it\\*(Aqs evaluated as a block. The block creates a " "reference to an anonymous array containing the results of the call to " "CW<\\*(C`mysub(1,2,3)\\*(C'>. So the whole block returns a reference to an " "array, which is then dereferenced by CW<\\*(C`@{...}\\*(C'> and stuck into " "the double-quoted string. This chicanery is also useful for arbitrary " "expressions:" msgstr "" "طريقة عملها هي أنه عندما تظهر CW<\\*(C`@{...}\\*(C'> في السلسلة المقتبسة " "اقتباسًا مزدوجًا، فإنها تُقيم ككتلة. تنشئ الكتلة مرجعًا لمصفوفة مجهولة تحتوي على " "نتائج الاستدعاء لـ CW<\\*(C`mysub(1,2,3)\\*(C'>. لذا فإن الكتلة بأكملها تعيد " "مرجعًا لمصفوفة، والتي تُفك مراجعها بعد ذلك بواسطة CW<\\*(C`@{...}\\*(C'> وتُدرج " "في السلسلة المقتبسة مزدوجًا. هذه الحيلة مفيدة أيضًا للتعبيرات العشوائية:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Because objects in Perl are implemented as references, it\\*(Aqs possible to " "have circular references with objects as well. Imagine a TreeNode class " "where each node references its parent and child nodes. Any node with a " "parent will be part of a circular reference." msgstr "" "نظرًا لأن الكائنات في بيرل تُنفذ كمراجع، فمن الممكن وجود مراجع دائرية مع " "الكائنات أيضًا. تخيل فئة TreeNode حيث يشير كل عقدة إلى عقدها الأب والأبناء. " "أي عقدة لها أب ستكون جزءًا من مرجع دائري." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "Here\\*(Aqs how we can make the first example safer:" msgstr "إليك كيف يمكننا جعل المثال الأول أكثر أمانًا:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "We said that references spring into existence as necessary if they are " "undefined, but we didn\\*(Aqt say what happens if a value used as a " "reference is already defined, but I a hard reference. If you " "use it as a reference, it\\*(Aqll be treated as a symbolic reference. That " "is, the value of the scalar is taken to be the I of a variable, rather " "than a direct link to a (possibly) anonymous value." msgstr "" "قلنا إن المراجع تظهر للوجود حسب الضرورة إذا كانت غير محددة، لكننا لم نقل " "ماذا يحدث إذا كانت القيمة المستخدمة كمرجع محددة بالفعل، ولكنها I<ليست> مرجعًا " "حقيقيًا (hard reference). إذا استخدمتها كمرجع، فستُعامل كمرجع رمزي. أي أن قيمة " "المتغير المفرد تُعتبر I<اسم> المتغير، بدلاً من كونها رابطًا مباشرًا لقيمة " "(مجهولة المصدر ربما)." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "This is powerful, and slightly dangerous, in that it\\*(Aqs possible to " "intend (with the utmost sincerity) to use a hard reference, and accidentally " "use a symbolic reference instead. To protect against that, you can say" msgstr "" "هذا أمر قوي، وخطير قليلاً، من حيث أنه من الممكن أن تنوي (بأقصى درجات الإخلاص) " "استخدام مرجع حقيقي، وتستخدم عن طريق الخطأ مرجعًا رمزيًا بدلاً منه. للحماية من " "ذلك، يمكنك قول" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Only package variables (globals, even if localized) are visible to symbolic " "references. Lexical variables (declared with B) aren\\*(Aqt in a " "symbol table, and thus are invisible to this mechanism. For example:" msgstr "" "متغيرات الحزمة فقط (المتغيرات العامة، حتى لو كانت محلية) هي المرئية للمراجع " "الرمزية. المتغيرات المعجمية (المصرح عنها باستخدام B) ليست في جدول " "الرموز، وبالتالي فهي غير مرئية لهذه الآلية. فعلى سبيل المثال:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "will have the same effect. This construct is I considered to be a " "symbolic reference when you\\*(Aqre using strict refs:" msgstr "" "سيكون له نفس التأثير. هذا البناء I<لا> يعتبر مرجعًا رمزيًا عندما تستخدم strict " "refs:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Pseudo-hashes have been removed from Perl. The fields pragma remains " "available." msgstr "" "أُزيلت التجزئات الوهمية (Pseudo-hashes) من بيرل. وما تزال الميزة الإرشادية " "(pragma) للحقول متاحة." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "As explained above, an anonymous function with access to the lexical " "variables visible when that function was compiled, creates a closure. It " "retains access to those variables even though it doesn\\*(Aqt get run until " "later, such as in a signal handler or a Tk callback." msgstr "" "كما شُرح أعلاه، تُنشئ الدالة المجهولة التي تملك صلاحية الوصول إلى المتغيرات " "المعجمية المرئية وقت تصريف تلك الدالة ما يُسمى «غلقة» (closure). حيث تحتفظ " "بصلاحية الوصول إلى تلك المتغيرات حتى وإن لم تُنفذ إلا لاحقًا، كما هو الحال في " "معالج إشارات أو استدعاء Tk راجع." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The B and B functions would be similar. To create these, " "we\\*(Aqll assign a closure to a typeglob of the name of the function " "we\\*(Aqre trying to build." msgstr "" "ستكون الدالتان B و B مماثلتين. ولإنشائهما، سنخصص «غلقة» إلى " "typeglob يحمل اسم الدالة التي نحاول بناءها." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Now all those different functions appear to exist independently. You can " "call B, B, B, B, B, etc. This " "technique saves on both compile time and memory use, and is less error-prone " "as well, since syntax checks happen at compile time. It\\*(Aqs critical " "that any variables in the anonymous subroutine be lexicals in order to " "create a proper closure. That\\*(Aqs the reasons for the CW<\\*(C`my\\*(C'> " "on the loop iteration variable." msgstr "" "الآن تبدو كل تلك الدوال المختلفة وكأنها موجودة بشكل مستقل. يمكنك استدعاء " "B و B و B و B و B، وما إلى ذلك. توفر " "هذه التقنية في كل من وقت التصريف واستهلاك الذاكرة، وهي أقل عرضة للأخطاء " "أيضًا، نظرًا لأن فحص الصياغة يحدث وقت التصريف. ومن الضروري أن تكون أي متغيرات " "في الروتين الفرعي المجهول معجمية من أجل إنشاء «غلقة» سليمة. وهذا هو السبب " "وراء استخدام CW<\\*(C`my\\*(C'> في متغير تكرار الحلقة." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Anonymous subroutines get to capture each time you execute the " "CW<\\*(C`sub\\*(C'> operator, as they are created on the fly. If you are " "accustomed to using nested subroutines in other programming languages with " "their own private variables, you\\*(Aqll have to work at it a bit in Perl. " "The intuitive coding of this type of thing incurs mysterious warnings about " "\"will not stay shared\" due to the reasons explained above. For example, " "this won\\*(Aqt work:" msgstr "" "تتمكن الروتينات الفرعية المجهولة من الالتقاط في كل مرة تُنفذ فيها عامل " "CW<\\*(C`sub\\*(C'>، حيث تُنشأ آليًا. إذا كنت معتادًا على استخدام الروتينات " "الفرعية المتداخلة في لغات برمجة أخرى بمتغيراتها الخاصة، فسيتعين عليك بذل جهد " "إضافي في بيرل. إن الكتابة البديهية لهذا النوع من الأشياء تتسبب في تحذيرات " "غامضة حول «لن تظل مشتركة» (will not stay shared) للأسباب الموضحة أعلاه. على " "سبيل المثال، هذا لن يعمل:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "\\& $r = \\e@a;\n" "\\& @b = $r-E@*; # equivalent to @$r or @{ $r }\n" "\\&\n" "\\& $r = [ 1, [ 2, 3 ], 4 ];\n" "\\& $r-E[1]-E@*; # equivalent to @{ $r-E[1] }\n" "\\&\n" "\\& $aref-E@* = (1, 2, 3); # same as @{ $aref } = (1, 2, 3)\n" msgstr "" "\\& $r = \\e@a;\n" "\\& @b = $r-E@*; # مكافئ لـ @$r أو @{ $r }\n" "\\&\n" "\\& $r = [ 1, [ 2, 3 ], 4 ];\n" "\\& $r-E[1]-E@*; # مكافئ لـ @{ $r-E[1] }\n" "\\&\n" "\\& $aref-E@* = (1, 2, 3); # مماثل لـ @{ $aref } = (1, 2, 3)\n" #. type: SH #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "WARNING: Don\\*(Aqt use references as hash keys" msgstr "تحذير: لا تستخدم المراجع كمفاتيح للتجزئة" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If you try to dereference the key, it won\\*(Aqt do a hard dereference, and " "you won\\*(Aqt accomplish what you\\*(Aqre attempting. You might want to do " "something more like" msgstr "" "إذا حاولت إلغاء مرجعية المفتاح، فلن يُنفذ إلغاء مرجعية حقيقي، ولن تحقق ما " "تحاول القيام به. قد ترغب في القيام بشيء أقرب إلى" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "And then at least you can use the B, which will be real refs, " "instead of the B, which won\\*(Aqt." msgstr "" "وعندها على الأقل يمكنك استخدام B، والتي ستكون مراجع حقيقية، بدلاً " "من B، التي لن تكون كذلك." #. type: TH #: fedora-rawhide #, no-wrap msgid "2026-03-30" msgstr "30 مارس 2026" #. type: TH #: fedora-rawhide #, no-wrap msgid "perl v5.42.2" msgstr "بيرل v5.40.2" #. type: TH #: mageia-cauldron #, no-wrap msgid "2025-06-24" msgstr "24 يونيو 2025" #. type: TH #: mageia-cauldron #, no-wrap msgid "perl v5.42.0" msgstr "بيرل v5.42.0"