Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Way to do a "scalar ref"?

by ultranerds (Hermit)
on Sep 26, 2011 at 08:32 UTC ( [id://927816]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $test = "foo bar";
    
    print "Test is now: $test \n";
    ...
    sub test {
        $_[0] =~ s/foo/whatever/g;
    }
    
  2. or download this
    my @test_array = qw/foo bar test/;
    print Dumper(@test_array);
    test_array(\@test_array);
    ...
        my $array_ref = $_[0];
        $array_ref->[1] ="whatever";
    }
    
  3. or download this
    my %test_array;
    $test_array{foo} = 1;
    $test_array{bar} = 2;
    ...
        my $array_ref = $_[0];
        $array_ref->{foo} = "whatever";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found