Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Getting a variable name from a reference

by Fool on the Hill (Acolyte)
on Mar 05, 2002 at 12:29 UTC ( [id://149343]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    my %hash2=("B"=>2);
    foreach my $hashref (\%hash1,\%hash2) {
      print "$hashref:",ref($hashref),":",(join ",",sort keys %{$hashref})
    +,"\n";
    
  2. or download this
    HASH(0x2002a3d0):HASH:A
    HASH(0x2002a418):HASH:B
    
  3. or download this
    hash1:A
    hash2:B
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://149343]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found