Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update perlref.pod to warn $f{B} = $f{A} is only copying a pointer #22036

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

jidanni
Copy link
Member

@jidanni jidanni commented Feb 27, 2024

Else people wonder how do things get injected into their data.

Please edit if needed.

…inter

Else people wonder how do things get injected into their data.

Please edit if needed.
'Adam' => 'Eve',
'Clyde' => 'Bonnie',
};
$folks{B} = $folks{A}; # just pointers to the anonymous hash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a reference, not a pointer.

'Clyde' => 'Bonnie',
};
$folks{B} = $folks{A}; # just pointers to the anonymous hash
%{ $folks{C} } = %{ $folks{A} }; # deep copy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a shallow copy, not a deep copy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's great you folks could put something better into that page than my version.

I even had my first accident today hitting the resolve button.

pod/perlref.pod Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants