- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Circular References in Perl
A circular reference in Perl occurs when two references contain a reference to each other. You have to be careful while creating references otherwise a circular reference can lead to memory leaks. Following is an example −
Example
#!/usr/bin/perl my $foo = 100; $foo = \$foo; print "Value of foo is : ", $$foo, "\n";
Output
When the above program is executed, it produces the following result −
Value of foo is : REF(0x9aae38)
- Related Articles
- Create References in Perl
- References to Functions in Perl
- What are circular references in C#?
- How can circular references cause memory leakage in JavaScript?
- References in C++
- Examples of soft references and phantom references?
- PHP References
- Python Weak References
- PHP Spotting References
- PHP Unsetting References
- Pointers vs References in C++
- Types of References in Java
- Back references in Java regular expressions
- What are method references in Java8?
- PHP Objects and references

Advertisements