Quick Search:
Oracle PL/SQL Code Library
Find Or Post Oracle Jobs
Oracle Discussion & Chat
 Perl Code: Call subroutine and pass variable by value Jump to:  
Category: >> Perl Code >> Call subroutine and pass variable by value Bookmark and Share

<< lastnext >>

Snippet Name: Call subroutine and pass variable by value

Description: Call a subroutine and pass a variable by value.

Comment: (none)

Language: PERL
Highlight Mode: PERL
Last Modified: March 06th, 2009

$value = "foo";
$newvalue = add_bar($value);
PRINT "$value becomes $newvalue";
SUB add_bar {
    MY ($copy) = @_;
    $copy .= "bar";
    RETURN $copy;
# foo becomes foobar
# the special @_ array will always contain aliases to the 
# variables that are passed in, so it really isn't possible 
# to pass by value.

Oracle Magazine
and Oracle White Papers

SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 50 users online    © 2009 psoug.org

Forgot your password?