Is there any reference (for Perl) concept in Ruby?

Hello Friends, I am wondering there is any similar concept for Ruby to
store a data’s reference like Perl, or something like the pointer in
C/C++?

In Perl:
%coins = ( “Quarter” , 25,
“Dime” , 10,
“Nickel”, 5 );

my $coin_ref = %coins; ## the reference to a hash

or I can simply do it:
$coins = { “Quarter” , 25,
“Dime” , 10,
“Nickel”, 5 };

I would appreciate if you can show me some examples.

The basic idea is that Ruby only has the equivalent of references.
Also,
since everything are references in that analogy, there is no special
syntax
to deal with them (no need for an arrow).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs