# Polish translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # Przemek Borys , 1999. # Wojtek Kotwica , 2000. # Robert Luberda , 2003. msgid "" msgstr "" "Project-Id-Version: manpages-l10n\n" "POT-Creation-Date: 2026-06-05 06:34+0200\n" "PO-Revision-Date: 2003-05-29 18:03+0200\n" "Last-Translator: Robert Luberda \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. #-#-#-#-# 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" #. #-#-#-#-# 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 lipca 2025 r." #. type: TH #: debian-trixie debian-unstable #, no-wrap msgid "perl v5.40.1" msgstr "perl 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 "Instrukcja programisty Perla" #. type: SH #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "NAZWA" #. 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 - odwołania i zagnieżdżone struktury danych w Perlu" #. 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 "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NOTE" msgstr "UWAGA" #. 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 "" "To jest pełna dokumentacja dotycząca wszelkich aspektów odwołań. Krótszy, " "wprowadzający wstęp to najistotniejszych cech znajdziesz w podręczniku " "I(1)." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "OPIS" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| 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 \\*(L\"hard\\*(R\" 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." 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 "" "Przed wersją 5 Perla przedstawianie złożonych struktur danych było trudne, " "gdyż wszystkie odwołania musiały być symboliczne \\*(-- a nawet wtedy ciężko " "było odnosić się do zmiennej zamiast do pozycji w tablicy symboli. Obecnie " "Perl nie tylko ułatwia posługiwanie się symbolicznymi odwołaniami do " "zmiennych, ale także pozwala na użycie \\*(L\"stałych\\*(R\" odwołań (hard " "references) do dowolnego kawałka danych lub kodu. Stałe dowiązanie może być " "przechowywane w dowolnym skalarze. Ponieważ tablice i tablice asocjacyjne " "(hasze) zawierają skalary, to możesz teraz łatwo budować tablice tablic, " "tablice haszy, hasze tablic, tablice haszy funkcji i tak dalej." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| 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 " #| "\\&\\*(L\"Two-Phased Garbage Collection\\*(R\" in perlobj 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 \\*(L\"blessed\\*(R\" into a class " #| "package.)" 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 "" "Odwołania stałe są sprytne \\*(-- utrzymują za ciebie liczniki odwołań, " "automatycznie zwalniając rzecz, do której odnosi się odwołanie, jeśli jej " "licznik odwołań zejdzie do zera. (Uwaga: liczniki odwołań dla wartości w " "strukturach danych odnoszących się do samych na siebie (self-referential) " "lub strukturach cyklicznych mogą nie schodzić do zera bez pewnej drobnej " "pomocy; patrz sekcja I w podręczniku " "I(1), zawierająca bardziej szczegółowy opis.) Jeśli taka rzecz " "jest obiektem, to obiekt jest niszczony. Więcej o obiektach znajdziesz w " "podręczniku I(1). (W pewnym sensie, wszystko w Perlu jest obiektem, " "ale zwykle rezerwujemy to słowo dla odwołań do obiektów, które zostały " "oficjalnie \"pobłogosławione\" (\\*(L\"blessed\\*(R\") [tj.zakwalifikowane " "jako obiekty] w pakiecie klasy.)" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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 \\*(L\"soft references\\*(R\", but please " #| "don't call them that; references are confusing enough without useless " #| "synonyms.)" 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 "" "Odwołania symboliczne są nazwami zmiennych lub innych obiektów; zupełnie tak " "jak dowiązania symboliczne (symbolic links) w uniksowym systemie plików " "zawierają wyłącznie nazwę pliku. Notacja CW<*glob> jest rodzajem odwołania " "symbolicznego. (Odwołania symboliczne nazywane są czasami \\*(L\"soft " "references\\*(R\" [odwołaniami miękkimi, w przeciwieństwie do \"hard r.\"-" "\"twardych\"], ale proszę nie nazywaj ich tak; odwołania są wystarczająco " "zbijające z pantałyku bez zbędnych synonimów.)" #. 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 #, fuzzy #| 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 \\*(L\"reference\\*(R\" is used " #| "without an adjective, as in the following paragraph, it is usually " #| "talking about a hard reference." 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 "" "W przeciwieństwie do nich, odwołania stałe przypominają dowiązania stałe " "(hard links) uniksowego systemu plików: służą do udostępniania obiektu bez " "zwracania uwagi na to, jaka jest jego (inna) nazwa. Tam, gdzie użyto słowa " "\\*(L\"odwołanie\\*(R\" bez przymiotnika, jak w poniższym akapicie, mówi się " "zwykle o odwołaniu stałym." #. 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 #, fuzzy #| msgid "" #| "References are easy to use in Perl. There is just one overriding " #| "principle: 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." 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 "" "W Perlu odwołania są łatwe w użyciu. Jest tylko jedna nadrzędna zasada: Perl " "nie wykonuje niejawnego odwoływania bądź dereferowania odwołań. " "[Dereferencing: odniesienie się z powrotem do obiektu, rzeczy na którą " "wskazuje odwołanie]. Gdy skalar przechowuje odwołanie, to zawsze zachowuje " "się jak zwykły skalar. Nie zaczyna magicznie być tablicą, haszem czy " "procedurą; musisz wprost nakazać takie zachowanie, wykonując dereferencję." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Making References" msgstr "Tworzenie odwołań" #. 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 "Odwołania mogą być tworzone na kilka sposobów." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "backslash" msgid "\\ backslash" msgstr "odwrotny ukośnik (backslash)" #. 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 "" "Przez zastosowanie operatora odwróconego ukośnika do zmiennej, procedury lub " "wartości. (Działa to bardzo podobnie do operatora & (zwracającego adres) w " "języku C.) Zauważ, że konstrukcja ta tworzy I<\\s-1KOLEJNE\\s0> odwołanie do " "zmiennej, gdyż w tablicy symboli istnieje już odwołanie do tej zmiennej. " "Jednak odwołanie z tablicy symboli może zniknąć, a nadal będziesz mieć " "odwołanie, które zwrócił odwrócony ukośnik. Oto kilka przykładów:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $scalarref = \\e$foo; \\& $arrayref = \\e@ARGV; \\& $hashref = \\e%ENV; \\& $coderef = \\e&handler; \\& $globref = \\e*foo;" 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; \\& $arrayref = \\e@ARGV; \\& $hashref = \\e%ENV; \\& $coderef = \\e&handler; \\& $globref = \\e*foo;" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "It isn't possible to create a true reference to an \\s-1IO\\s0 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 \\s-1IO\\s0 handles." 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 "" "Przy użyciu operatora odwróconego ukośnika nie jest możliwe utworzenie " "prawdziwego odwołania do uchwytu \\s-1IO\\s0 (uchwytu pliku lub katalogu). " "Możesz co najwyżej uzyskać odwołanie do typeglob będącego faktycznie pełnym " "wpisem w tablicy symboli. (Przeczytaj jednak poniżej objaśnienie składni " "CW<*foo{COŚ}>.) Mimo to, możesz nadal używać typeglob i odwołań do nich " "jakby były one uchwytami \\s-1IO\\s0." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 "" "Odwołanie do anonimowej tablicy można stworzyć posługując się nawiasami " "kwadratowymi:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $arrayref = [1, 2, ['a', 'b', 'c']];" msgid "\\& $arrayref = [1, 2, [\\*(Aqa\\*(Aq, \\*(Aqb\\*(Aq, \\*(Aqc\\*(Aq]];\n" msgstr "\\& $arrayref = [1, 2, ['a', 'b', 'c']];" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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 \\*(L\"b\\*(R\".)" 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 "" "Utworzyliśmy odwołanie do anonimowej tablicy trzech elementów, której " "ostatni element jest z kolei odwołaniem do innej anonimowej tablicy trzech " "elementów. (Dostęp do niej umożliwi opisana dalej składnia tablic " "wielowymiarowych. Na przykład, dla powyższego przykładu CW<$arrayref-" "E[2][1]> zwraca wartość \\*(L\"b\\*(R\".)" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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!" 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 "" "Zauważ, że stworzenie odwołania do listy wyliczanej nie jest tym samym, co " "użycie nawiasów kwadratowych. Jest to natomiast tym samym, co stworzenie " "listy odwołań!" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& @list = (\\e$a, \\e@b, \\e%c); \\& @list = \\e($a, @b, %c); # same thing!" msgid "" "\\& @list = (\\e$x, \\e@y, \\e%z);\n" "\\& @list = \\e($x, @y, %z); # same thing!\n" msgstr "\\& @list = (\\e$a, \\e@b, \\e%c); \\& @list = \\e($a, @b, %c); # to samo!" #. 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 "" "W przypadku szczególnym, CW<\\*(C`\\e(@foo)\\*(C'> zwraca listę odwołań do " "zawartości CW<@foo>, nie zaś odwołanie do samej CW<@foo>. Podobnie jest dla " "CW<%foo>, z wyjątkiem tego, że odwołania-klucze odnoszą się do kopii (gdyż " "klucze są łańcuchami znakowymi, a nie dowolnymi skalarami)." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 "" "Odwołanie do anonimowej tablicy asocjacyjnej (hasza) można utworzyć używając " "nawiasów klamrowych:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $hashref = { \\& 'Adam' =E 'Eve', \\& 'Clyde' =E 'Bonnie', \\& };" msgid "" "\\& $hashref = {\n" "\\& \\*(AqAdam\\*(Aq =E \\*(AqEve\\*(Aq,\n" "\\& \\*(AqClyde\\*(Aq =E \\*(AqBonnie\\*(Aq,\n" "\\& };\n" msgstr "\\& $hashref = { \\& 'Adam' =E 'Eve', \\& 'Clyde' =E 'Bonnie', \\& };" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| 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 I or I) are " #| "executable statements, not compile-time declarations." 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 "" "Powyższe konstruktory anonimowych haszy i tablic można swobodnie łączyć. " "Umożliwia to otrzymywanie dowolnie skomplikowanych struktur. Opisana " "składnia wielowymiarowych tablic/haszy działa także dla nich. Wartości w " "powyższym przykładzie były literałami, ale równie dobrze mogłyby być " "zmiennymi czy wyrażeniami, gdyż perlowe operatory przypisania (nawet " "wewnątrz I czy I) są wykonywalnymi instrukcjami, a nie " "jedynie deklaracjami dla fazy kompilacji." #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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 \\s-1BLOCK\\s0. The economy and mnemonic value of using " #| "curlies is deemed worth this occasional extra hassle." 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 "" "Ponieważ nawiasy klamrowe służą do kilku innych rzeczy, a także do tworzenia " "BLOKów, możesz być czasem zmuszony do uniknięcia dwuznaczności tych nawiasów " "na początku instrukcji. Wystarczy wówczas umieszczenie przed nimi CW<\\*(C`+" "\\*(C'> lub CW<\\*(C`return\\*(C'>, by Perl zorientował się, że otwierający " "nawias klamrowy nie rozpoczyna \\s-1BLOK\\s0u. Oszczędność i zalety " "mnemoniczne użycia nawiasów klamrowych warte są takiego sporadycznego " "zamieszania." #. 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 "" "Na przykład, jeśli chciałbyś, by funkcja tworzyła nowy hasz i zwracała " "odwołanie do niego, to masz takie możliwości:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& sub hashem { { @_ } } # silently wrong \\& sub hashem { +{ @_ } } # ok \\& sub hashem { return { @_ } } # ok" msgid "" "\\& sub hashem { { @_ } } # silently wrong\n" "\\& sub hashem { +{ @_ } } # ok\n" "\\& sub hashem { return { @_ } } # ok\n" msgstr "\\& sub hashem { { @_ } } # źle, ale bez komunikatu o błędzie \\& sub hashem { +{ @_ } } # ok \\& sub hashem { return { @_ } } # ok" #. 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 "" "Z drugiej strony, jeśli chcesz drugiego znaczenia nawiasów (blok), zrób tak:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& sub showem { { @_ } } # ambiguous (currently ok, but may change) \\& sub showem { {; @_ } } # ok \\& sub showem { { return @_ } } # ok" msgid "" "\\& sub showem { { @_ } } # ambiguous (currently ok,\n" "\\& # but may change)\n" "\\& sub showem { {; @_ } } # ok\n" "\\& sub showem { { return @_ } } # ok\n" msgstr "\\& sub showem { { @_ } } # dwuznaczne (obecnie ok, ale może się zmienić) \\& sub showem { {; @_ } } # ok \\& sub showem { { return @_ } } # ok" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "The leading CW<\\*(C`+{\\*(C'> and CW<\\*(C`{;\\*(C'> always serve to " #| "disambiguate the expression to mean either the \\s-1HASH\\s0 reference, " #| "or the \\s-1BLOCK\\s0." 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 "" "Zwróć uwagę, że początkowe CW<\\*(C`+{\\*(C'> i CW<\\*(C`{;\\*(C'> zawsze " "służą do wykluczenia dwuznaczności wyrażenia, aby znaczyło albo odwołanie do " "\\s-1HASZ\\s0a albo \\s-1BLOK\\s0." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 "" "Można utworzyć odwołanie do anonimowej procedury używając " "\\&CW<\\*(C`sub\\*(C'> bez nazwy procedury:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $coderef = sub { print \"Boink!\\en\" };" msgid "\\& $coderef = sub { print \"Boink!\\en\" };\n" msgstr "\\& $coderef = sub { print \"Bums!\\en\" };" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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<\\*(C`eval(\"...\")\\*(C'>), CW<$coderef> will " #| "still have a reference to the I anonymous subroutine.)" 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 "" "Zwróć uwagę na obecność średnika. Poza faktem, że wewnętrzny kod nie jest " "wykonywany natychmiast, CW<\\*(C`sub {}\\*(C'> jest bardziej operatorem niż " "deklaracją, podobnie zresztą jak CW<\\*(C`do{}\\*(C'> czy CW<\\*(C`eval{}" "\\*(C'>. (Jednak, niezależnie od tego, ile razy wykonasz powyższą linię " "(chyba że jesteś wewnątrz \\&CW<\\*(C`eval(\"...\")\\*(C'>), CW<$coderef> " "wciąż będzie zawierać odwołanie do I anonimowej procedury.)" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "Anonymous subroutines act as closures with respect to I 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." 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 "" "Procedury anonimowe działają jak zamknięcia (closures) w odniesieniu do " "zmiennych I, to znaczy, zmiennych widocznych leksykalnie w bieżącym " "zakresie. Zamknięcie jest pojęciem ze świata Lispa, mówiącym, że jeśli " "zdefiniujesz anonimową funkcję w konkretnym kontekście leksykalnym, to " "będzie ona działać w tym kontekście nawet jeśli została wywołana poza nim." #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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." 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 "" "Mówiąc po ludzku, jest to zabawny sposób przesyłania argumentów do procedury " "zarówno gdy ją definiujesz jak i wtedy gdy ją wywołujesz. Przydaje się to do " "tworzenia małych fragmentów kodu do późniejszego uruchamiania, jak np. " "wywołania wsteczne (callbacks). Przy ich pomocy możesz robić nawet rzeczy " "zorientowane obiektowo, choć Perl zapewnia już odmienny mechanizm operowania " "obiektami \\*(--patrz podręcznik B(1)." #. type: Plain text #: debian-trixie debian-unstable #, fuzzy 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 "" "Możesz również myśleć o zamknięciach jak o sposobie pisania szablonów bez " "używania eval. (Faktycznie, w wersji 5.000, eval było I metodą " "uzyskania zamknięć. Jeśli posługujesz się zamknięciami, możesz potrzebować " "\\*(L\"require 5.001\\*(R\".) A to mały przykład tego, jak działają " "zamknięcia:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& sub newprint { \\& my $x = shift; \\& return sub { my $y = shift; print \"$x, $y!\\en\"; }; \\& } \\& $h = newprint(\"Howdy\"); \\& $g = newprint(\"Greetings\");" 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 { \\& my $x = shift; \\& return sub { my $y = shift; print \"$x, $y!\\en\"; }; \\& } \\& $h = newprint(\"Howdy\"); \\& $g = newprint(\"Greetings\");" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "This prints" msgstr "Drukuje to" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& Howdy, world! \\& Greetings, earthlings!" msgid "" "\\& Howdy, world!\n" "\\& Greetings, earthlings!\n" msgstr "\\& Howdy, world! \\& Greetings, earthlings!" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "Note particularly that CW<$x> continues to refer to the value passed into " #| "I I \\*(L\"my CW<$x>\\*(R\" having gone out of scope " #| "by the time the anonymous subroutine runs. That's what a closure is all " #| "about." 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 "" "Zwróć uwagę szczególnie na to, że CW<$x> nadal odnosi się do wartości " "przesłanej do I, I zmienna \\*(L\"my CW<$x>\\*(R\" " "pozornie wyszła poza swój zakres, w momencie gdy wywołano anonimową " "procedurę. O to właśnie chodzi w zamknięciu." #. 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 "" "Przy okazji: odnosi się do tylko do zmiennych leksykalnych. Zmienne " "dynamiczne działają nadal tak jak zawsze. Zamknięcie nie jest czymś, o co " "musiałaby się martwić większość programistów Perla." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 #, fuzzy #| 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 I and called indirectly:" 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 "" "Odwołania często zwracane są przez specjalne procedury zwane " "konstruktorami. Obiekty w Perlu są po prostu odwołaniami do specjalnego " "rodzaju obiektu, który wie z którym pakietem jest związany. Konstruktory są " "specjalnymi procedurami, które wiedzą jak utworzyć to powiązanie. Robią to " "zaczynając od zwykłego odwołania, i pozostaje ono zwykłym odwołaniem nawet " "wtedy gdy jest równocześnie obiektem. Konstuktory często nazywane są " "I i wywoływane nie wprost:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $objref = new Doggie (Tail =E 'short', Ears =E 'long');" msgid "\\& $objref = new Doggie( Tail =E \\*(Aqshort\\*(Aq, Ears =E \\*(Aqlong\\*(Aq );\n" msgstr "\\& $objref = new Psisko (Ogon =E 'krótki', Uszy =E 'długie');" #. 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 "" #. 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 "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" 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: 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 "" "Odwołania odpowiedniego typu mogą być powoływane do istnienia jeśli " "dereferencjonujesz je w kontekście zakładającym, że istnieją. Ponieważ " "jeszcze nie mówiliśmy o dereferencji, nie możemy na razie pokazać przykładów." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "*foo{THING} *" msgstr "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Typeglob Slots" msgstr "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "A reference can be created by using a special syntax, lovingly known as " #| "the *foo{\\s-1THING\\s0} syntax. *foo{\\s-1THING\\s0} returns a " #| "reference to the \\s-1THING\\s0 slot in *foo (which is the symbol table " #| "entry which holds everything known as foo)." 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 "" "Odwołanie może być utworzone przy pomocy specjalnej składni, uroczo zwanej " "składnią *foo{\\s-1COŚ\\s0}. *foo{\\s-1COŚ\\s0} zwraca odwołanie do " "przegródki \\s-1COŚ\\s0 w *foo (które jest pozycją w tablicy symboli " "przechowującą wszystko znane jako foo.)" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $scalarref = *foo{SCALAR}; \\& $arrayref = *ARGV{ARRAY}; \\& $hashref = *ENV{HASH}; \\& $coderef = *handler{CODE}; \\& $ioref = *STDIN{IO}; \\& $globref = *foo{GLOB};" 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}; \\& $arrayref = *ARGV{ARRAY}; \\& $hashref = *ENV{HASH}; \\& $coderef = *handler{CODE}; \\& $ioref = *STDIN{IO}; \\& $globref = *foo{GLOB};" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "All of these are self-explanatory except for CW<*foo{IO}>. It returns " #| "the \\s-1IO\\s0 handle, used for file handles (\\*(L\"open\\*(R\" in " #| "perlfunc), sockets (\\*(L\"socket\\*(R\" in perlfunc and " #| "\\*(L\"socketpair\\*(R\" in perlfunc), and directory handles " #| "(\\*(L\"opendir\\*(R\" in perlfunc). For compatibility with previous " #| "versions of Perl, CW<*foo{FILEHANDLE}> is a synonym for CW<*foo{IO}>, " #| "though it is deprecated as of 5.8.0. If deprecation warnings are in " #| "effect, it will warn of its use." 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 "" "Wszystkie powyższe wyrażenia są oczywiste, z wyjątkiem *foo{\\s-1IO\\s0}. " "Zwraca ono uchwyt \\s-1IO\\s0, używany jako uchwyt pliku (patrz opis " "CW w podręczniku I(1)), gniazdo (opis CW oraz " "CW w I(1)) lub uchwyt katalogu (CW w " "I(1)). Dla zgodności z poprzednimi wersjami Perla, " "*foo{\\s-1UCHWYTPLIKU\\s0} jest synonimem *foo{\\s-1IO\\s0}." #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "\\&CW<*foo{THING}> returns undef if that particular \\s-1THING\\s0 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." 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 "" "*foo{\\s-1COŚ\\s0} zwraca undef jeśli dane \\s-1COŚ\\s0 jeszcze nie było " "używane, z wyjątkiem dla skalarów. Jeśli nie używano jeszcze CW<$foo>, " "*foo{\\s-1SKALAR\\s0} zwraca odwołanie do anonimowego skalara. W przyszłych " "wersjach może się to zmienić." #. 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 "" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "\\&CW<*foo{IO}> is an alternative to the CW<*HANDLE> mechanism given in " #| "\\&\\*(L\"Typeglobs and Filehandles\\*(R\" 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." 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 "" "*foo{\\s-1IO\\s0} jest alternatywą dla mechanizmu \\e*\\s-1UCHWYTU\\s0 " "opisanego w sekcji I podręcznika I(1), " "a służącego do przesyłania uchwytów plików do i z procedur lub " "przechowywania w większych strukturach danych. Jego wadą jest to, że nie " "utworzy za Ciebie nowego uchwytu pliku. Zaletą zaś, że nie ryzykujesz więcej " "niż zamierzałeś przy przypisaniem typeglob, choć jeśli wykonasz przypisanie " "do skalara zamiast do typeglob, to też dobrze." #. 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 "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Using References" msgstr "Użycie odwołań" #. 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 "" "To tyle o tworzeniu odwołań. Teraz pewnie nie możesz się doczekać wiedzy jak " "posługiwać się odwołaniami, by móc wrócić do swych leżących odłogiem " "danych. Oto kilka podstawowych sposobów." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 "" "Wszędzie, gdzie postawiłbyś identyfikator (lub łańcuch identyfikatorów) " "jako część nazwy zmiennej czy procedury, możesz zastąpić identyfikator " "prostą zmienną skalarną zawierającą odwołanie poprawnego typu:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $bar = $$scalarref; \\& push(@$arrayref, $filename); \\& $$arrayref[0] = \"January\"; \\& $$hashref{\"KEY\"} = \"VALUE\"; \\& &$coderef(1,2,3); \\& print $globref \"output\\en\";" 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; \\& push(@$arrayref, $nazwapliku); \\& $$arrayref[0] = \"styczeń\"; \\& $$hashref{\"KLUCZ\"} = \"WARTOŚĆ\"; \\& &$coderef(1,2,3); \\& print $globref \"wynik\\en\";" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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 \\*(L\"simple scalar\\*(R\" " #| "includes an identifier that itself uses method 1 recursively. Therefore, " #| "the following prints \\*(L\"howdy\\*(R\"." 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 "" "Ważne jest, by zrozumieć, że nie I<\\s-1NIE\\s0> wykonujemy tu specjalnie " "dereferencji CW<$arrayref[0]> czy CW<$hashref{\"KLUCZ\"}>. Dereferencja " "zmiennej skalarnej odbywa się I<\\s-1PRZED\\s0> przeszukaniem klucza " "(indeksu tablicy). Wszystko bardziej skomplikowane niż dereferencja prostej " "zmiennej skalarnej wymaga użycia niżej opisanych metod 2 lub 3. Jednak " "określenie \\*(L\"prosty skalar\\*(R\" obejmuje też identyfikator, który sam " "używa rekurencyjnie metody 1. Zatem poniższe drukuje \\*(L\"witaj\\*(R\"." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $refrefref = \\e\\e\\e\"howdy\"; \\& print $$$$refrefref;" msgid "" "\\& $refrefref = \\e\\e\\e\"howdy\";\n" "\\& print $$$$refrefref;\n" msgstr "\\& $refrefref = \\e\\e\\e\"witaj\"; \\& print $$$$refrefref;" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "I" msgid "I" msgstr "I" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "B(2)" msgid "Block" msgstr "B(2)" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| 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 " #| "\\&\\s-1BLOCK\\s0 returning a reference of the correct type. In other " #| "words, the previous examples could be written like this:" 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 "" "Wszędzie, gdzie postawiłbyś identyfikator (lub łańcuch identyfikatorów) " "jako część nazwy zmiennej czy procedury, możesz zastąpić identyfikator " "\\s-1BLOK\\s0iem zwracającym odwołanie poprawnego typu. Inaczej mówiąc, " "poprzednie przykłady mogą zostać zapisane tak:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $bar = ${$scalarref}; \\& push(@{$arrayref}, $filename); \\& ${$arrayref}[0] = \"January\"; \\& ${$hashref}{\"KEY\"} = \"VALUE\"; \\& &{$coderef}(1,2,3); \\& $globref-Eprint(\"output\\en\"); # iff IO::Handle is loaded" 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}; \\& push(@{$arrayref}, $nazwapliku); \\& ${$arrayref}[0] = \"January\"; \\& ${$hashref}{\"KLUCZ\"} = \"WARTOŚĆ\"; \\& &{$coderef}(1,2,3); \\& $globref-Eprint(\"output\\en\"); # jeśli załadowano IO::Handle" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "Admittedly, it's a little silly to use the curlies in this case, but the " #| "\\s-1BLOCK\\s0 can contain any arbitrary expression, in particular, " #| "subscripted expressions:" 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 "" "Niewątpliwie, użycie nawiasów klamrowych w tym przypadku nie jest zbyt " "mądre, ale \\s-1BLOK\\s0 może zawierać dowolne wyrażenie, w szczególności " "wyrażenia indeksowane:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& &{ $dispatch{$index} }(1,2,3); # call correct routine" msgid "\\& &{ $dispatch{$index} }(1,2,3); # call correct routine\n" msgstr "\\& &{ $dispatch{$index} }(1,2,3); # wywołaj właściwą obsługę" #. 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 "" "Z powodu możliwości pomijania nawiasów klamrowych dla prostych przypadków " "CW<$$x>, ludzie często popełniają błąd postrzegania symboli dereferencji " "jako prawdziwych operatorów i zastanawiają się nad ich priorytetem. Gdyby " "nimi były, mógłbyś używać zwykłych nawiasów zamiast klamrowych. Tak jednak " "nie jest. Rozważ poniższą różnicę: przypadek 0 jest skróconą wersją " "przypadku 1, I<\\s-1NIE\\s0> przypadku 2:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $$hashref{\"KEY\"} = \"VALUE\"; # CASE 0 \\& ${$hashref}{\"KEY\"} = \"VALUE\"; # CASE 1 \\& ${$hashref{\"KEY\"}} = \"VALUE\"; # CASE 2 \\& ${$hashref-E{\"KEY\"}} = \"VALUE\"; # CASE 3" 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{\"KLUCZ\"} = \"WARTOŚĆ\"; # CASE 0 \\& ${$hashref}{\"KLUCZ\"} = \"LUCZ\"; # przypadek 1 \\& ${$hashref{\"KLUCZ\"}} = \"WARTOŚĆ\"; # przypadek 2 \\& ${$hashref-E{\"KLUCZ\"}} = \"WARTOŚĆ\"; # przypadek 3" #. 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 "" "Przypadek 2 jest również mylący, gdyż odnosi się do zmiennej o nazwie " "CW<%hashref>, nie zaś dereferencjonuje poprzez CW<$hashref> hasza, na który " "wydawałoby się wskazuje skalar. To robi przypadek 3." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "I" msgstr "" #. 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 "" "Wywołania procedur i poszukiwanie poszczególnych elementów tablic pojawiają " "się wystarczająco często, by zastosowanie do nich metody 2 stało się " "niewygodne. Jako formę \"osłodzenia składni\", przykłady z metody 2 można " "zapisać:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $arrayref-E[0] = \"January\"; # Array element \\& $hashref-E{\"KEY\"} = \"VALUE\"; # Hash element \\& $coderef-E(1,2,3); # Subroutine call" 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] = \"styczeń\"; # element tablicy \\& $hashref-E{\"KLUCZ\"} = \"WARTOŚĆ\"; # element hasza \\& $coderef-E(1,2,3); # wywołanie procedury" #. 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 "" "Lewa strona strzałki może być dowolnym wyrażeniem zwracającym odwołanie, " "łącznie z uprzednią dereferencją. [Ułatwia to operowanie odwołaniami do " "zmiennych zawierających kolejne odwołania, jak poniżej]. Zauważ, że " "CW<$array[$x]> I<\\s-1NIE\\s0> jest tu tym samym co CW<$array-E[$x]>:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array[$x]-E{\"foo\"}-E[0] = \"January\";" msgid "\\& $array[$x]-E{\"foo\"}-E[0] = \"January\";\n" msgstr "\\& $array[$x]-E{\"foo\"}-E[0] = \"styczeń\";" #. 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 "" "Jest to jeden z przypadków wspomnianych wcześniej, gdzie odwołania " "zaistnieją, gdy zostaną użyte w kontekście l-wartości. Przed tą instrukcją, " "element CW<$array[$x]> mógł być niezdefiniowany. W takim przypadku, jest on " "definiowany automatycznie z nadaniem mu wartości -- odwołania do hasza, tak " "że możemy poszukiwać w haszu elementu o kluczu CW<\"foo\">. Podobnie klucz " "CW<$array[$x]-E{\"foo\"}> zostanie automatycznie zdefiniowany z " "równoczesnym nadaniem wartości -- odwołania do tablicy, zatem będzie można w " "niej odnaleźć CW<[0]>. Proces ten zwany jest I " "(automatyczne ożywianie)." #. 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 "" "Jeszcze jedno. I<\\s-1POMIĘDZY\\s0> indeksami umieszczonymi w nawiasach " "klamrowych strzałka jest opcjonalna, zatem możemy skrócić powyższy zapis do:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array[$x]{\"foo\"}[0] = \"January\";" msgid "\\& $array[$x]{\"foo\"}[0] = \"January\";\n" msgstr "\\& $array[$x]{\"foo\"}[0] = \"styczeń\";" #. 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 "" "Co, w szczególnym przypadku działania tylko na zwykłych tablicach, daje " "tablice wielowymiarowe z zapisem jak w C:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $score[$x][$y][$z] += 42;" msgid "\\& $score[$x][$y][$z] += 42;\n" msgstr "\\& $score[$x][$y][$z] += 42;" #. 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 "" "No dobrze, tak naprawdę, nie całkiem jak tablice w C. C nie wie, jak " "poszerzać tablice na żądanie. Perl to potrafi." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "B" msgid "I" msgstr "B" #. 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 "" "Jeżeli odwołanie jest odwołaniem do obiektu, to prawdopodobnie istnieją " "metody dostępu do wskazywanych przez nie rzeczy, i powinieneś zapewne z nich " "skorzystać, chyba że jesteś w pakiecie klasy definiującej metody tego " "obiektu i pracujesz nad nimi. Inaczej mówiąc, bądź tak dobry i nie naruszaj " "hermetyzacji bez istotnego powodu. Perl nie wymusza hermetyzacji. Nie " "jesteśmy tu totalitarystami. Oczekujemy jednak zachowania podstawowych " "zasad uprzejmości." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "Miscellaneous" msgid "I" msgstr "Różne" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "Miscellaneous" msgid "Miscellaneous Usage" msgstr "Różne" #. 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 "" #. 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 "" #. 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 #, fuzzy #| msgid "" #| "The I operator may be used to associate the object a reference " #| "points to with a package functioning as an object class. See perlobj." 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 "" "Operator I może być używany do powiązania obiektu, na który " "wskazuje odwołanie, z pakietem funkcjonującym jako klasa obiektowa. Zobacz " "podręcznik I(1)." #. 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 może być dereferencjowane w ten sam sposób jak odwołanie, gdyż " "składnia dereferencji zawsze wskazuje na pożądany rodzaj odwołania. Zatem " "CW<\\*(C`${*foo}\\*(C'> i CW<\\*(C`${\\e$foo}\\*(C'> wskazują na tę samą " "zmienną skalarną." #. type: Plain text #: debian-trixie debian-unstable msgid "Here's a trick for interpolating a subroutine call into a string:" msgstr "A oto sztuczka do interpolacji wywołania procedury w łańcuchu:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print \"My sub returned @{[mysub(1,2,3)]} that time.\\en\";" msgid "\\& print \"My sub returned @{[mysub(1,2,3)]} that time.\\en\";\n" msgstr "\\& print \"Procedura mysub tym razem zwróciła @{[mysub(1,2,3)]} that time.\\en\";" #. 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 "" "Działa to w tak, że gdy CW<\\*(C`@{...}\\*(C'> znalezione zostanie wewnątrz " "łańcucha w cudzysłowach to zostanie potraktowane jako blok. Blok ten tworzy " "odwołanie do jednoelementowej anonimowej tablicy zawierającej wynik " "wywołania CW<\\*(C`mysub(1,2,3)\\*(C'> [odwołanie to utworzone będzie dzięki " "nawiasom kwadratowym]. Zatem cały blok zwraca odwołanie do tablicy, która " "następnie podlega dereferencji powodowanej przez CW<\\*(C`@{...}\\*(C'>. Jej " "wartość, jako umieszczona w łańcuchu w cudzysłowach podlega interpolacji w " "napis. Takie szykany przydają się także w dowolnych wyrażeniach:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print \"That yields @{[$n + 5]} widgets\\en\";" msgid "\\& print \"That yields @{[$n + 5]} widgets\\en\";\n" msgstr "\\& print \"That yields @{[$n + 5]} widgets\\en\";" #. 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 "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print \"That yields @{[$n + 5]} widgets\\en\";" msgid "\\& print \"That yields ${\\e($n + 5)} widgets\\en\";\n" msgstr "\\& print \"That yields @{[$n + 5]} widgets\\en\";" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "Using References" msgid "Circular References" msgstr "Użycie odwołań" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Symbolic references" msgstr "Odwołania symboliczne" #. 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 "" "Powiedzieliśmy, że niezdefiniowane cele odwołania w razie potrzeby " "zaistnieją [podczas dereferencji]. Nie mówiliśmy jednak, co się dzieje, gdy " "wartość użyta jako odwołanie jest już zdefiniowana, ale I<\\s-1NIE \\s0JEST> " "odwołaniem stałym. Jeżeli użyjesz odwołania w takim przypadku, to będzie ono " "potraktowane jak odwołanie symboliczne. To znaczy, wartością skalara " "zostanie I<\\s-1NAZWA\\s0> zmiennej a nie bezpośrednie dowiązanie do (być " "może anonimowej) wartości." #. 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 "" "Niektórzy często spodziewają się, że działa to jakoś tak. I rzeczywiście." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $name = \"foo\"; \\& $$name = 1; # Sets $foo \\& ${$name} = 2; # Sets $foo \\& ${$name x 2} = 3; # Sets $foofoo \\& $name-E[0] = 4; # Sets $foo[0] \\& @$name = (); # Clears @foo \\& &$name(); # Calls &foo() (as in Perl 4) \\& $pack = \"THAT\"; \\& ${\"${pack}::$name\"} = 5; # Sets $THAT::foo without eval" 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\"; \\& $$name = 1; # ustawia $foo \\& ${$name} = 2; # ustawia $foo \\& ${$name x 2} = 3; # ustawia $foofoo \\& $name-E[0] = 4; # ustawia $foo[0] \\& @$name = (); # czyści @foo \\& &$name(); # wywołuje &foo() (jak w Perl 4) \\& $pack = \"THAT\"; \\& ${\"${pack}::$name\"} = 5; # ustawia $THAT::foo bez rozwinięcia(eval))" #. 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 "" "Jest to bardzo silne narzędzie, ale nieco niebezpieczne, gdyż możliwe jest, " "ze szczerym zamiarem użycia odwołania stałego, przypadkowe użycie " "symbolicznego. Możesz się przed tym uchronić pisząc:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& use strict 'refs';" msgid "\\& use strict \\*(Aqrefs\\*(Aq;\n" msgstr "\\& use strict 'refs';" #. 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 "" "a dla reszty otaczającego bloku będą dozwolone tylko odwołania stałe. " "Wewnętrzny blok może się temu sprzeciwić przy pomocy" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& no strict 'refs';" msgid "\\& no strict \\*(Aqrefs\\*(Aq;\n" msgstr "\\& no strict 'refs';" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "Only package variables (globals, even if localized) are visible to " #| "symbolic references. Lexical variables (declared with I) aren't in " #| "a symbol table, and thus are invisible to this mechanism. For example:" 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 "" "Dla odwołań symbolicznych widoczne są tylko zmienne pakietu (globalne, nawet " "jeśli lokalnie). Zmienne leksykalne (deklarowane przy pomocy I) nie " "zawierają się w tablicy symboli, zatem są niewidoczne dla tego mechanizmu. " "Na przykład:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& local $value = 10; \\& $ref = \"value\"; \\& { \\& my $value = 20; \\& print $$ref; \\& }" msgid "" "\\& local $value = 10;\n" "\\& $ref = \"value\";\n" "\\& {\n" "\\& my $value = 20;\n" "\\& print $$ref;\n" "\\& }\n" msgstr "\\& local $wartosc = 10; \\& $ref = \"wartosc\"; \\& { \\& my $wartosc = 20; \\& print $$ref; \\& }" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "This will still print 10, not 20. Remember that I affects " #| "package variables, which are all \\*(L\"global\\*(R\" to the package." msgid "" "This will still print 10, not 20. Remember that B affects package " "variables, which are all \"global\" to the package." msgstr "" "Nadal będzie drukować 10, a nie 20. Pamiętaj, że I działa na " "zmienne pakietu, które dla samego pakietu wszystkie są " "\\*(L\"globalne\\*(R\"." #. 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 "Odwołania niezbyt symboliczne" #. 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 #, fuzzy, no-wrap #| msgid "\\& $push = \"pop on \"; \\& print \"${push}over\";" msgid "" "\\& $push = \"pop on \";\n" "\\& print \"${push}over\";\n" msgstr "\\& $push = \"pop on \"; \\& print \"${push}over\";" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "has always meant to print \\*(L\"pop on over\\*(R\", even though push is " #| "a reserved word. This has been generalized to work the same outside of " #| "quotes, so that" 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 "" "miało zawsze znaczenie wydrukowania \\*(L\"pop on over\\*(R\", bez względu " "na fakt, że \"push\" jest słowem zarezerwowanym. Zostało to uogólnione tak, " "by działać również poza cudzysłowami, zatem" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print ${push} . \"over\";" msgid "\\& print ${push} . \"over\";\n" msgstr "\\& print ${push} . \"over\";" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "and even" msgstr "a nawet" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print ${ push } . \"over\";" msgid "\\& print ${ push } . \"over\";\n" msgstr "\\& print ${ push } . \"over\";" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "will have the same effect. (This would have been a syntax error in Perl " #| "5.000, though Perl 4 allowed it in the spaceless form.) This construct " #| "is I considered to be a symbolic reference when you're using strict " #| "refs:" msgid "" "will have the same effect. This construct is I considered to be a " "symbolic reference when you're using strict refs:" msgstr "" "mają ten sam rezultat. (Spowodowałoby to błąd składni w Perlu 5.000, choć " "Perl 4 dopuszcza coś takiego w postaci bez odstępów.) Zauważ, że konstrukcja " "ta I nie jest uważana za odwołanie symboliczne gdy używasz strict refs:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& use strict 'refs'; \\& ${ bareword }; # Okay, means $bareword. \\& ${ \"bareword\" }; # Error, symbolic reference." msgid "" "\\& use strict \\*(Aqrefs\\*(Aq;\n" "\\& ${ bareword }; # Okay, means $bareword.\n" "\\& ${ \"bareword\" }; # Error, symbolic reference.\n" msgstr "\\& use strict 'refs'; \\& ${ bareword }; # dobrze, znaczy $bareword. \\& ${ \"bareword\" }; # błąd, odwołanie symboliczne." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "Similarly, because of all the subscripting that is done using single " #| "words, we've applied the same rule to any bareword that is used for " #| "subscripting a hash. So now, instead of writing" 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 "" "Podobnie, z powodu wszelkiego indeksowania przy pomocy pojedynczych słów, " "zastosowaliśmy tę samą regułę do każdego z gołych słów użytego do " "indeksowania hasza. Zatem teraz, zamiast" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array{ \"aaa\" }{ \"bbb\" }{ \"ccc\" }" msgid "\\& $hash{ \"aaa\" }{ \"bbb\" }{ \"ccc\" }\n" msgstr "\\& $array{ \"aaa\" }{ \"bbb\" }{ \"ccc\" }" #. 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 "możesz napisać po prostu" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array{ aaa }{ bbb }{ ccc }" msgid "\\& $hash{ aaa }{ bbb }{ ccc }\n" msgstr "\\& $array{ aaa }{ bbb }{ ccc }" #. 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 "" "i nie martwić się o to, czy indeksy są słowami zarezerwowanymi. W tych " "rzadkich przypadkach, gdy chcesz zrobić coś w rodzaju" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array{ shift }" msgid "\\& $hash{ shift }\n" msgstr "\\& $array{ shift }" #. 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 "" "możesz wymusić interpretację słowa jako zarezerwowanego dodając cokolwiek, " "co zrobi zeń więcej niż gołe słowo:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $array{ shift() } \\& $array{ +shift } \\& $array{ shift @_ }" msgid "" "\\& $hash{ shift() }\n" "\\& $hash{ +shift }\n" "\\& $hash{ shift @_ }\n" msgstr "\\& $array{ shift() } \\& $array{ +shift } \\& $array{ shift @_ }" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy 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 "" "Przełącznik B<-w> będzie Cię ostrzegał, jeśli zinterpretuje słowo " "zarezerwowane jako łańcuch. Nie będzie jednak ostrzegał o użyciu słów " "pisanych małymi literami, gdyż łańcuch jest faktycznie cytowany." #. 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 "Pseudo-hasze: używanie tablicy jak hasza" #. 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 "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Function Templates" msgstr "Szablony funkcji" #. 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 #, fuzzy #| msgid "" #| "As explained above, a closure is an anonymous function with access to the " #| "lexical variables visible when that function was compiled. 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." 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 "" "Jak wyjaśniono powyżej, zamknięcie jest anonimową funkcją z dostępem do " "zmiennych leksykalnych widocznych podczas jej kompilacji. Zachowuje ona " "dostęp do tych zmiennych nawet wtedy, gdy jest wykonywana później, tak jak " "funkcja obsługi sygnału (signal handler) czy wywołanie wsteczne Tk." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| 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 \\s-1HTML\\s0 font changes for the various " #| "colors:" 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 "" "Posługiwanie się zamknięciem jako szablonem funkcji umożliwia tworzenie " "wielu podobnie działających funkcji. Załóżmy, że potrzebujesz funkcji o " "nazwach pochodzących od różnych kolorów zmieniających czcionkę \\s-1HTML\\s0." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& print \"Be \", red(\"careful\"), \"with that \", green(\"light\");" msgid "\\& print \"Be \", red(\"careful\"), \"with that \", green(\"light\");\n" msgstr "\\& print \"Be \", red(\"uważaj\"), \"na to \", green(\"światło\");" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "The I and I 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." 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 "" "Funkcje I i I będą bardzo podobne. By je stworzyć, " "przypiszemy zamknięcie do typeglob nazwy funkcji, którą próbujemy " "skonstruować." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& @colors = qw(red blue green yellow orange purple violet); \\& for my $name (@colors) { \\& no strict 'refs'; # allow symbol table manipulation \\& *$name = *{uc $name} = sub { \"EFONT COLOR='$name'E@_E/FONTE\" }; \\& }" 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); \\& for my $nazwa (@kolory) { \\& no strict 'refs'; # pozwól na operowanie tablicą symboli \\& *$nazwa = *{uc $nazwa} = sub { \"EFONT COLOR='$nazwa'E@_E/FONTE\" }; \\& }" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "Now all those different functions appear to exist independently. You can " #| "call I, \\s-1I, I, \\s-1I, " #| "I, 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." 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 "" "Teraz wszystkie te funkcje będą istnieć niezależnie od siebie. Możesz " "wywoływać I, I<\\s-1RED\\s0()>, I, I<\\s-1BLUE\\s0()>, " "I, etc. Technika ta zarówno skraca czas kompilacji jak i zmniejsza " "zużycie pamięci, jest też mniej narażona na błędy, gdyż kontrola składni " "odbywa się podczas kompilacji. Istotne jest, by wszelkie zmienne w " "anonimowej procedurze były zmiennymi leksykalnymi by stworzyć poprawne " "zamknięcie. Z tego powodu użyto CW dla zmiennej sterującej pętli." #. 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 "" "Jest to jedno z jedynych miejsc, gdzie dostarczenie prototypu do zamknięcia " "ma sens. Jeśli chciałbyś narzucić kontekst skalarny dla argumentów " "powyższych, przykładowych funkcji (pewnie nie najlepszy pomysł w tym " "przypadku), możesz zapisać to inaczej:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& *$name = sub ($) { \"EFONT COLOR='$name'E$_[0]E/FONTE\" };" msgid "\\& *$name = sub ($) { \"EFONT COLOR=\\*(Aq$name\\*(AqE$_[0]E/FONTE\" };\n" msgstr "\\& *$name = sub ($) { \"EFONT COLOR='$name'E$_[0]E/FONTE\" };" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| 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 \\s-1BEGIN\\s0 block, " #| "forcing it to occur during compilation." 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 "" "Jednakże, ponieważ sprawdzanie protypów odbywa się podczas kompilacji, " "powyższe przypisanie zostanie wykonane za późno, by było przydatne. Mógłbyś " "to obejść przez włożenie całej pętli przypisań do wnętrza bloku " "\\s-1BEGIN\\s0u, wymuszając wykonanie go w czasie kompilacji." #. 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 "" #. 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 #, fuzzy #| msgid "" #| "Access to lexicals that change over type\\*(--like those in the " #| "CW<\\*(C`for\\*(C'> loop above\\*(--only works with closures, not general " #| "subroutines. In the general case, then, named subroutines do not nest " #| "properly, although anonymous ones do. 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''. For example, this won't work:" 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 "" "Dostęp do zmiennych leksykalnych zmieniających typ \\*(-- jak te w pętli " "CW powyższego przykładu\\*(-- działa wyłącznie z zamknięciami, a nie z " "procedurami w ogóle. Zatem w przypadku ogólnym, procedury nazwane nie " "zagnieżdżają się prawidłowo, choć robią to procedury anonimowe. Jeśli " "nawykłeś do używania zagnieżdżonych procedur z własnymi prywatnymi zmiennymi " "w innych językach programowania, to w Perlu będziesz musiał nad trochę " "popracować. Intuicyjna metoda kodowania tego typu rzeczy spowoduje " "tajemnicze ostrzeżenia ``will not stay shared'\\*(R' (nie pozostanie " "wspólne). To, na przykład, nie zadziała:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& sub outer { \\& my $x = $_[0] + 35; \\& sub inner { return $x * 19 } # WRONG \\& return $x + inner(); \\& }" msgid "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& sub inner { return $x * 19 } # WRONG\n" "\\& return $x + inner();\n" "\\& }\n" msgstr "\\& sub zewn { \\& my $x = $_[0] + 35; \\& sub wewn { return $x * 19 } # ŹLE \\& return $x + wewn(); \\& }" #. 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 "Obejście jest następujące:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& sub outer { \\& my $x = $_[0] + 35; \\& local *inner = sub { return $x * 19 }; \\& return $x + inner(); \\& }" msgid "" "\\& sub outer {\n" "\\& my $x = $_[0] + 35;\n" "\\& local *inner = sub { return $x * 19 };\n" "\\& return $x + inner();\n" "\\& }\n" msgstr "\\& sub zewn { \\& my $x = $_[0] + 35; \\& local *wewn = sub { return $x * 19 }; \\& return $x + wewn(); \\& }" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "Now I can only be called from within I, because of the " #| "temporary assignments of the closure (anonymous subroutine). But when it " #| "does, it has normal access to the lexical variable CW<$x> from the scope " #| "of I." 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 "" "Teraz I może być wywołana tylko z wnętrza I, z powodu " "tymczasowego przypisania zamknięcia (procedury anonimowej). Ale kiedy jest " "wywoływana, to ma zwykły dostęp do zmiennej leksykalnej CW<$x> z zakresu " "procedury I." #. 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 "" "Ma to interesujący skutek tworzenia funkcji lokalnych względem innych " "funkcji, co normalnie nie jest obsługiwane w Perlu." #. 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 "" #. 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 "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "For example:" msgstr "Na przykład:" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "Using References" msgid "Assigning to References" msgstr "Użycie odwołań" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "is equivalent to" msgstr "jest równoznaczne z" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. 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 "" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "is equivalent to" msgid "equivalent to:" msgstr "jest równoznaczne z" #. 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 "" #. 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 "" #. 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 "" #. 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 "" "Nie możesz (w użyteczny sposób) posłużyć się odwołaniem jako kluczem hasza. " "Zostanie ono zamienione na łańcuch:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $x{ \\e$a } = $a;" msgid "\\& $x{ \\e$x } = $x;\n" msgstr "\\& $x{ \\e$a } = $a;" #. 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 "" "Jeśli spróbujesz zdereferencjonować klucz, nie otrzymasz odwołania stałego a " "łańcuch i nie uzyskasz tego, co próbowałeś. W zamian można napisać coś " "podobnego do:" #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, no-wrap #| msgid "\\& $r = \\e@a; \\& $x{ $r } = $r;" msgid "" "\\& $r = \\e@a;\n" "\\& $x{ $r } = $r;\n" msgstr "\\& $r = \\e@a; \\& $x{ $r } = $r;" #. type: Plain text #: debian-trixie debian-unstable #, fuzzy #| msgid "" #| "And then at least you can use the I, which will be real refs, " #| "instead of the I, which won't." msgid "" "And then at least you can use the B, which will be real refs, " "instead of the B, which won't." msgstr "" "a następnie użyć I, co zwróci rzeczywiste odwołania, zamiast " "użycia I, gdyż klucze odwołaniami nie będą." #. 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 "" "Standardowy moduł Tie::RefHash umożliwia wygodny sposób obejścia tego " "problemu." #. type: IX #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "ZOBACZ TAKŻE" #. 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 "" "Poza oczywistą dokumentacją, pouczająca może być analiza kodu źródłowego. " "Kilka raczej patologicznych przykładów użycia odwołań znajdziesz w teście " "regresji I w katalogu źródeł Perla." #. type: Plain text #: debian-trixie debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "See also perldsc and perllol for how to use references to create complex " #| "data structures, and perltoot, perlobj, and perlbot for how to use them " #| "to create objects." 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 "" "Zobacz również podręczniki I(1) i I(1), opisujące " "posługiwanie się odwołaniami do tworzenia złożonych struktur danych, oraz " "I(1), I(1) i I(1) opisujące ich użycie do " "tworzenia obiektów." #. type: TH #: debian-unstable #, no-wrap msgid "2025-11-16" msgstr "16 listopada 2025 r." #. type: TH #: fedora-44 opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "2026-03-09" msgstr "9 marca 2026 r." #. type: TH #: fedora-44 opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "perl v5.42.1" msgstr "perl v5.42.1" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 \\*(L\"soft references\\*(R\", but please " #| "don't call them that; references are confusing enough without useless " #| "synonyms.)" 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 "" "Odwołania symboliczne są nazwami zmiennych lub innych obiektów; zupełnie tak " "jak dowiązania symboliczne (symbolic links) w uniksowym systemie plików " "zawierają wyłącznie nazwę pliku. Notacja CW<*glob> jest rodzajem odwołania " "symbolicznego. (Odwołania symboliczne nazywane są czasami \\*(L\"soft " "references\\*(R\" [odwołaniami miękkimi, w przeciwieństwie do \"hard r.\"-" "\"twardych\"], ale proszę nie nazywaj ich tak; odwołania są wystarczająco " "zbijające z pantałyku bez zbędnych synonimów.)" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "References are easy to use in Perl. There is just one overriding " #| "principle: 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." 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 "" "W Perlu odwołania są łatwe w użyciu. Jest tylko jedna nadrzędna zasada: Perl " "nie wykonuje niejawnego odwoływania bądź dereferowania odwołań. " "[Dereferencing: odniesienie się z powrotem do obiektu, rzeczy na którą " "wskazuje odwołanie]. Gdy skalar przechowuje odwołanie, to zawsze zachowuje " "się jak zwykły skalar. Nie zaczyna magicznie być tablicą, haszem czy " "procedurą; musisz wprost nakazać takie zachowanie, wykonując dereferencję." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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:" 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 "" "Przez zastosowanie operatora odwróconego ukośnika do zmiennej, procedury lub " "wartości. (Działa to bardzo podobnie do operatora & (zwracającego adres) w " "języku C.) Zauważ, że konstrukcja ta tworzy I<\\s-1KOLEJNE\\s0> odwołanie do " "zmiennej, gdyż w tablicy symboli istnieje już odwołanie do tej zmiennej. " "Jednak odwołanie z tablicy symboli może zniknąć, a nadal będziesz mieć " "odwołanie, które zwrócił odwrócony ukośnik. Oto kilka przykładów:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "It isn't possible to create a true reference to an \\s-1IO\\s0 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 \\s-1IO\\s0 handles." 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 "" "Przy użyciu operatora odwróconego ukośnika nie jest możliwe utworzenie " "prawdziwego odwołania do uchwytu \\s-1IO\\s0 (uchwytu pliku lub katalogu). " "Możesz co najwyżej uzyskać odwołanie do typeglob będącego faktycznie pełnym " "wpisem w tablicy symboli. (Przeczytaj jednak poniżej objaśnienie składni " "CW<*foo{COŚ}>.) Mimo to, możesz nadal używać typeglob i odwołań do nich " "jakby były one uchwytami \\s-1IO\\s0." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 \\*(L\"b\\*(R\".)" 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 "" "Utworzyliśmy odwołanie do anonimowej tablicy trzech elementów, której " "ostatni element jest z kolei odwołaniem do innej anonimowej tablicy trzech " "elementów. (Dostęp do niej umożliwi opisana dalej składnia tablic " "wielowymiarowych. Na przykład, dla powyższego przykładu CW<$arrayref-" "E[2][1]> zwraca wartość \\*(L\"b\\*(R\".)" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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!" 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 "" "Zauważ, że stworzenie odwołania do listy wyliczanej nie jest tym samym, co " "użycie nawiasów kwadratowych. Jest to natomiast tym samym, co stworzenie " "listy odwołań!" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 \\s-1BLOCK\\s0. The economy and mnemonic value of using " #| "curlies is deemed worth this occasional extra hassle." 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 "" "Ponieważ nawiasy klamrowe służą do kilku innych rzeczy, a także do tworzenia " "BLOKów, możesz być czasem zmuszony do uniknięcia dwuznaczności tych nawiasów " "na początku instrukcji. Wystarczy wówczas umieszczenie przed nimi CW<\\*(C`+" "\\*(C'> lub CW<\\*(C`return\\*(C'>, by Perl zorientował się, że otwierający " "nawias klamrowy nie rozpoczyna \\s-1BLOK\\s0u. Oszczędność i zalety " "mnemoniczne użycia nawiasów klamrowych warte są takiego sporadycznego " "zamieszania." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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<\\*(C`eval(\"...\")\\*(C'>), CW<$coderef> will " #| "still have a reference to the I anonymous subroutine.)" 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 "" "Zwróć uwagę na obecność średnika. Poza faktem, że wewnętrzny kod nie jest " "wykonywany natychmiast, CW<\\*(C`sub {}\\*(C'> jest bardziej operatorem niż " "deklaracją, podobnie zresztą jak CW<\\*(C`do{}\\*(C'> czy CW<\\*(C`eval{}" "\\*(C'>. (Jednak, niezależnie od tego, ile razy wykonasz powyższą linię " "(chyba że jesteś wewnątrz \\&CW<\\*(C`eval(\"...\")\\*(C'>), CW<$coderef> " "wciąż będzie zawierać odwołanie do I anonimowej procedury.)" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Anonymous subroutines act as closures with respect to I 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." 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 "" "Procedury anonimowe działają jak zamknięcia (closures) w odniesieniu do " "zmiennych I, to znaczy, zmiennych widocznych leksykalnie w bieżącym " "zakresie. Zamknięcie jest pojęciem ze świata Lispa, mówiącym, że jeśli " "zdefiniujesz anonimową funkcję w konkretnym kontekście leksykalnym, to " "będzie ona działać w tym kontekście nawet jeśli została wywołana poza nim." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Mówiąc po ludzku, jest to zabawny sposób przesyłania argumentów do procedury " "zarówno gdy ją definiujesz jak i wtedy gdy ją wywołujesz. Przydaje się to do " "tworzenia małych fragmentów kodu do późniejszego uruchamiania, jak np. " "wywołania wsteczne (callbacks). Przy ich pomocy możesz robić nawet rzeczy " "zorientowane obiektowo, choć Perl zapewnia już odmienny mechanizm operowania " "obiektami \\*(--patrz podręcznik B(1)." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy 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 "" "Możesz również myśleć o zamknięciach jak o sposobie pisania szablonów bez " "używania eval. (Faktycznie, w wersji 5.000, eval było I metodą " "uzyskania zamknięć. Jeśli posługujesz się zamknięciami, możesz potrzebować " "\\*(L\"require 5.001\\*(R\".) A to mały przykład tego, jak działają " "zamknięcia:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Note particularly that CW<$x> continues to refer to the value passed into " #| "I I \\*(L\"my CW<$x>\\*(R\" having gone out of scope " #| "by the time the anonymous subroutine runs. That's what a closure is all " #| "about." 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 "" "Zwróć uwagę szczególnie na to, że CW<$x> nadal odnosi się do wartości " "przesłanej do I, I zmienna \\*(L\"my CW<$x>\\*(R\" " "pozornie wyszła poza swój zakres, w momencie gdy wywołano anonimową " "procedurę. O to właśnie chodzi w zamknięciu." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 I and called indirectly:" 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 "" "Odwołania często zwracane są przez specjalne procedury zwane " "konstruktorami. Obiekty w Perlu są po prostu odwołaniami do specjalnego " "rodzaju obiektu, który wie z którym pakietem jest związany. Konstruktory są " "specjalnymi procedurami, które wiedzą jak utworzyć to powiązanie. Robią to " "zaczynając od zwykłego odwołania, i pozostaje ono zwykłym odwołaniem nawet " "wtedy gdy jest równocześnie obiektem. Konstuktory często nazywane są " "I i wywoływane nie wprost:" #. 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 #, fuzzy #| 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." 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 "" "Odwołania odpowiedniego typu mogą być powoływane do istnienia jeśli " "dereferencjonujesz je w kontekście zakładającym, że istnieją. Ponieważ " "jeszcze nie mówiliśmy o dereferencji, nie możemy na razie pokazać przykładów." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "\\&CW<*foo{THING}> returns undef if that particular \\s-1THING\\s0 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." 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 "" "*foo{\\s-1COŚ\\s0} zwraca undef jeśli dane \\s-1COŚ\\s0 jeszcze nie było " "używane, z wyjątkiem dla skalarów. Jeśli nie używano jeszcze CW<$foo>, " "*foo{\\s-1SKALAR\\s0} zwraca odwołanie do anonimowego skalara. W przyszłych " "wersjach może się to zmienić." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "\\&CW<*foo{IO}> is an alternative to the CW<*HANDLE> mechanism given in " #| "\\&\\*(L\"Typeglobs and Filehandles\\*(R\" 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." 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 "" "*foo{\\s-1IO\\s0} jest alternatywą dla mechanizmu \\e*\\s-1UCHWYTU\\s0 " "opisanego w sekcji I podręcznika I(1), " "a służącego do przesyłania uchwytów plików do i z procedur lub " "przechowywania w większych strukturach danych. Jego wadą jest to, że nie " "utworzy za Ciebie nowego uchwytu pliku. Zaletą zaś, że nie ryzykujesz więcej " "niż zamierzałeś przy przypisaniem typeglob, choć jeśli wykonasz przypisanie " "do skalara zamiast do typeglob, to też dobrze." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "To tyle o tworzeniu odwołań. Teraz pewnie nie możesz się doczekać wiedzy jak " "posługiwać się odwołaniami, by móc wrócić do swych leżących odłogiem " "danych. Oto kilka podstawowych sposobów." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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:" 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 "" "Wszędzie, gdzie postawiłbyś identyfikator (lub łańcuch identyfikatorów) " "jako część nazwy zmiennej czy procedury, możesz zastąpić identyfikator " "prostą zmienną skalarną zawierającą odwołanie poprawnego typu:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 \\*(L\"simple scalar\\*(R\" " #| "includes an identifier that itself uses method 1 recursively. Therefore, " #| "the following prints \\*(L\"howdy\\*(R\"." 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 "" "Ważne jest, by zrozumieć, że nie I<\\s-1NIE\\s0> wykonujemy tu specjalnie " "dereferencji CW<$arrayref[0]> czy CW<$hashref{\"KLUCZ\"}>. Dereferencja " "zmiennej skalarnej odbywa się I<\\s-1PRZED\\s0> przeszukaniem klucza " "(indeksu tablicy). Wszystko bardziej skomplikowane niż dereferencja prostej " "zmiennej skalarnej wymaga użycia niżej opisanych metod 2 lub 3. Jednak " "określenie \\*(L\"prosty skalar\\*(R\" obejmuje też identyfikator, który sam " "używa rekurencyjnie metody 1. Zatem poniższe drukuje \\*(L\"witaj\\*(R\"." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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 " #| "\\&\\s-1BLOCK\\s0 returning a reference of the correct type. In other " #| "words, the previous examples could be written like this:" 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 "" "Wszędzie, gdzie postawiłbyś identyfikator (lub łańcuch identyfikatorów) " "jako część nazwy zmiennej czy procedury, możesz zastąpić identyfikator " "\\s-1BLOK\\s0iem zwracającym odwołanie poprawnego typu. Inaczej mówiąc, " "poprzednie przykłady mogą zostać zapisane tak:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Admittedly, it's a little silly to use the curlies in this case, but the " #| "\\s-1BLOCK\\s0 can contain any arbitrary expression, in particular, " #| "subscripted expressions:" 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 "" "Niewątpliwie, użycie nawiasów klamrowych w tym przypadku nie jest zbyt " "mądre, ale \\s-1BLOK\\s0 może zawierać dowolne wyrażenie, w szczególności " "wyrażenia indeksowane:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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:" 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 "" "Z powodu możliwości pomijania nawiasów klamrowych dla prostych przypadków " "CW<$$x>, ludzie często popełniają błąd postrzegania symboli dereferencji " "jako prawdziwych operatorów i zastanawiają się nad ich priorytetem. Gdyby " "nimi były, mógłbyś używać zwykłych nawiasów zamiast klamrowych. Tak jednak " "nie jest. Rozważ poniższą różnicę: przypadek 0 jest skróconą wersją " "przypadku 1, I<\\s-1NIE\\s0> przypadku 2:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Przypadek 2 jest również mylący, gdyż odnosi się do zmiennej o nazwie " "CW<%hashref>, nie zaś dereferencjonuje poprzez CW<$hashref> hasza, na który " "wydawałoby się wskazuje skalar. To robi przypadek 3." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Jest to jeden z przypadków wspomnianych wcześniej, gdzie odwołania " "zaistnieją, gdy zostaną użyte w kontekście l-wartości. Przed tą instrukcją, " "element CW<$array[$x]> mógł być niezdefiniowany. W takim przypadku, jest on " "definiowany automatycznie z nadaniem mu wartości -- odwołania do hasza, tak " "że możemy poszukiwać w haszu elementu o kluczu CW<\"foo\">. Podobnie klucz " "CW<$array[$x]-E{\"foo\"}> zostanie automatycznie zdefiniowany z " "równoczesnym nadaniem wartości -- odwołania do tablicy, zatem będzie można w " "niej odnaleźć CW<[0]>. Proces ten zwany jest I " "(automatyczne ożywianie)." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Which, in the degenerate case of using only ordinary arrays, gives you " #| "multidimensional arrays just like C's:" msgid "" "Which, in the degenerate case of using only ordinary arrays, gives you " "multidimensional arrays just like C\\*(Aqs:" msgstr "" "Co, w szczególnym przypadku działania tylko na zwykłych tablicach, daje " "tablice wielowymiarowe z zapisem jak w C:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Well, okay, not entirely like C's arrays, actually. C doesn't know how " #| "to grow its arrays on demand. Perl does." msgid "" "Well, okay, not entirely like C\\*(Aqs arrays, actually. C doesn\\*(Aqt " "know how to grow its arrays on demand. Perl does." msgstr "" "No dobrze, tak naprawdę, nie całkiem jak tablice w C. C nie wie, jak " "poszerzać tablice na żądanie. Perl to potrafi." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Jeżeli odwołanie jest odwołaniem do obiektu, to prawdopodobnie istnieją " "metody dostępu do wskazywanych przez nie rzeczy, i powinieneś zapewne z nich " "skorzystać, chyba że jesteś w pakiecie klasy definiującej metody tego " "obiektu i pracujesz nad nimi. Inaczej mówiąc, bądź tak dobry i nie naruszaj " "hermetyzacji bez istotnego powodu. Perl nie wymusza hermetyzacji. Nie " "jesteśmy tu totalitarystami. Oczekujemy jednak zachowania podstawowych " "zasad uprzejmości." #. 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 "" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "Here's a trick for interpolating a subroutine call into a string:" msgid "Here\\*(Aqs a trick for interpolating a subroutine call into a string:" msgstr "A oto sztuczka do interpolacji wywołania procedury w łańcuchu:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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:" 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 "" "Działa to w tak, że gdy CW<\\*(C`@{...}\\*(C'> znalezione zostanie wewnątrz " "łańcucha w cudzysłowach to zostanie potraktowane jako blok. Blok ten tworzy " "odwołanie do jednoelementowej anonimowej tablicy zawierającej wynik " "wywołania CW<\\*(C`mysub(1,2,3)\\*(C'> [odwołanie to utworzone będzie dzięki " "nawiasom kwadratowym]. Zatem cały blok zwraca odwołanie do tablicy, która " "następnie podlega dereferencji powodowanej przez CW<\\*(C`@{...}\\*(C'>. Jej " "wartość, jako umieszczona w łańcuchu w cudzysłowach podlega interpolacji w " "napis. Takie szykany przydają się także w dowolnych wyrażeniach:" #. 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 "" #. 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 #, fuzzy #| 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." 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 "" "Powiedzieliśmy, że niezdefiniowane cele odwołania w razie potrzeby " "zaistnieją [podczas dereferencji]. Nie mówiliśmy jednak, co się dzieje, gdy " "wartość użyta jako odwołanie jest już zdefiniowana, ale I<\\s-1NIE \\s0JEST> " "odwołaniem stałym. Jeżeli użyjesz odwołania w takim przypadku, to będzie ono " "potraktowane jak odwołanie symboliczne. To znaczy, wartością skalara " "zostanie I<\\s-1NAZWA\\s0> zmiennej a nie bezpośrednie dowiązanie do (być " "może anonimowej) wartości." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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" 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 "" "Jest to bardzo silne narzędzie, ale nieco niebezpieczne, gdyż możliwe jest, " "ze szczerym zamiarem użycia odwołania stałego, przypadkowe użycie " "symbolicznego. Możesz się przed tym uchronić pisząc:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Only package variables (globals, even if localized) are visible to " #| "symbolic references. Lexical variables (declared with I) aren't in " #| "a symbol table, and thus are invisible to this mechanism. For example:" 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 "" "Dla odwołań symbolicznych widoczne są tylko zmienne pakietu (globalne, nawet " "jeśli lokalnie). Zmienne leksykalne (deklarowane przy pomocy I) nie " "zawierają się w tablicy symboli, zatem są niewidoczne dla tego mechanizmu. " "Na przykład:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "will have the same effect. (This would have been a syntax error in Perl " #| "5.000, though Perl 4 allowed it in the spaceless form.) This construct " #| "is I considered to be a symbolic reference when you're using strict " #| "refs:" msgid "" "will have the same effect. This construct is I considered to be a " "symbolic reference when you\\*(Aqre using strict refs:" msgstr "" "mają ten sam rezultat. (Spowodowałoby to błąd składni w Perlu 5.000, choć " "Perl 4 dopuszcza coś takiego w postaci bez odstępów.) Zauważ, że konstrukcja " "ta I nie jest uważana za odwołanie symboliczne gdy używasz 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 "" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "As explained above, a closure is an anonymous function with access to the " #| "lexical variables visible when that function was compiled. 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." 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 "" "Jak wyjaśniono powyżej, zamknięcie jest anonimową funkcją z dostępem do " "zmiennych leksykalnych widocznych podczas jej kompilacji. Zachowuje ona " "dostęp do tych zmiennych nawet wtedy, gdy jest wykonywana później, tak jak " "funkcja obsługi sygnału (signal handler) czy wywołanie wsteczne Tk." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "The I and I 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." 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 "" "Funkcje I i I będą bardzo podobne. By je stworzyć, " "przypiszemy zamknięcie do typeglob nazwy funkcji, którą próbujemy " "skonstruować." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Now all those different functions appear to exist independently. You can " #| "call I, \\s-1I, I, \\s-1I, " #| "I, 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." 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 "" "Teraz wszystkie te funkcje będą istnieć niezależnie od siebie. Możesz " "wywoływać I, I<\\s-1RED\\s0()>, I, I<\\s-1BLUE\\s0()>, " "I, etc. Technika ta zarówno skraca czas kompilacji jak i zmniejsza " "zużycie pamięci, jest też mniej narażona na błędy, gdyż kontrola składni " "odbywa się podczas kompilacji. Istotne jest, by wszelkie zmienne w " "anonimowej procedurze były zmiennymi leksykalnymi by stworzyć poprawne " "zamknięcie. Z tego powodu użyto CW dla zmiennej sterującej pętli." #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Access to lexicals that change over type\\*(--like those in the " #| "CW<\\*(C`for\\*(C'> loop above\\*(--only works with closures, not general " #| "subroutines. In the general case, then, named subroutines do not nest " #| "properly, although anonymous ones do. 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''. For example, this won't work:" 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 "" "Dostęp do zmiennych leksykalnych zmieniających typ \\*(-- jak te w pętli " "CW powyższego przykładu\\*(-- działa wyłącznie z zamknięciami, a nie z " "procedurami w ogóle. Zatem w przypadku ogólnym, procedury nazwane nie " "zagnieżdżają się prawidłowo, choć robią to procedury anonimowe. Jeśli " "nawykłeś do używania zagnieżdżonych procedur z własnymi prywatnymi zmiennymi " "w innych językach programowania, to w Perlu będziesz musiał nad trochę " "popracować. Intuicyjna metoda kodowania tego typu rzeczy spowoduje " "tajemnicze ostrzeżenia ``will not stay shared'\\*(R' (nie pozostanie " "wspólne). To, na przykład, nie zadziała:" #. 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 "" #. 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 #, fuzzy #| 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" 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 "" "Jeśli spróbujesz zdereferencjonować klucz, nie otrzymasz odwołania stałego a " "łańcuch i nie uzyskasz tego, co próbowałeś. W zamian można napisać coś " "podobnego do:" #. type: Plain text #: fedora-44 fedora-rawhide mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "And then at least you can use the I, which will be real refs, " #| "instead of the I, which won't." msgid "" "And then at least you can use the B, which will be real refs, " "instead of the B, which won\\*(Aqt." msgstr "" "a następnie użyć I, co zwróci rzeczywiste odwołania, zamiast " "użycia I, gdyż klucze odwołaniami nie będą." #. type: TH #: fedora-rawhide #, no-wrap msgid "2026-03-30" msgstr "30 marca 2026 r." #. type: TH #: fedora-rawhide #, no-wrap msgid "perl v5.42.2" msgstr "perl v5.42.2" #. type: TH #: mageia-cauldron #, no-wrap msgid "2025-06-24" msgstr "24 czerwca 2025 r." #. type: TH #: mageia-cauldron #, no-wrap msgid "perl v5.42.0" msgstr "perl v5.42.0"