1.

Show a simple Perl program to perform reference to functions.

Answer»

Perl is a wonderful language to WRITE simple programs in for various functions. LET’s LOOK at some examples of it:  

 sub DisplayDetails {     my (%details) = @_;        foreach $i (%details) {        print "Item : $i\n";     }  }  %details = ('Name' => 'Gaurav', 'age' => 28);  # Creating a reference to the above function.  $c_ref = \&DisplayDetails;  # This is a function call that uses the reference.  &$c_ref(%details); 



Discussion

No Comment Found