It seems that there is an incorrect behavior when using variables of the same name but different characters:
> my $a="foo"; foo > my @a=1,2 [1 2] > say $a foo # this is what I have expected > my $b = 1,2,3 (1 2 3) > my @b = (0, $b.Slip) [0 1] # I expect to get [0 1 2 3]; (0, |$b) not work either > say $b 1 # I expect $b to be unchanged, (1,2,3), but it is now 1; > say @a [1 2] > say @b [0 1] >
I’m not sure why it @adoesn’t influence $a, whereas it @bdoes $b. Can someone clarify the issue?
@a
$a
@b
$b
Thank!!!
lisprog
In Rakudo Perl 6 there is virtually no relationship between $band @b.
$b . , , , . , , = () , ,.
=
,
, REPL, . , , .
my $b = 1,2,3 , (my $b = 1),2,3, = , ,, , , ,
my $b = 1,2,3
(my $b = 1),2,3
> (my $b = 1),2,3 (1 2 3) > $b 1
$b, :
> my $b = (1,2,3) (1 2 3) > $b (1 2 3)
Source: https://habr.com/ru/post/1682786/More articles:Why doesn't this Java 2D array throw an IndexOutOfBoundException? - javapython pandas read_csv does not recognize \ t in tab delimited file - pythonSymfony conversion form field value - symfonyGet the number of processor cores that share the cache (L1, L2, L3) - c ++How to incorporate function uncertainty into machine learning algorithms? - pythonМаксимизируйте производительность базы данных для очень длинной цифры - performanceHow to ensure this is the generic type specified in my class signature? - javaKotlin remote debugging code via IntelliJ - javaClean architecture - how to access database transactions? - clean-architecturejava.lang.ClassNotFoundException: org.springframework.boot.SpringApplication with maven-jar-plugin - javaAll Articles