fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. sub new {
  5. my ( $name ) = @_;
  6.  
  7. return sub {
  8. print "$name, we are glad to see you!\nSo... how do you think, what do we want to tell you now?\nYes, you right!\n";
  9. print "Welcome onboard, $name!!!\n";
  10. };
  11. }
  12.  
  13. my @mysubs = map { &new("$_") } 'Alex','Mike';
  14.  
  15. $_->() for @mysubs;
Success #stdin #stdout 0s 6000KB
stdin
Standard input is empty
stdout
Alex, we are glad to see you!
So... how do you think, what do we want to tell you now?
Yes, you right!
Welcome onboard, Alex!!!
Mike, we are glad to see you!
So... how do you think, what do we want to tell you now?
Yes, you right!
Welcome onboard, Mike!!!