Code with STDIN
This function gets some value from the Standard Input and then returns a value based on that. We need to fake data on the STDIN.
package MyEcho;
use strict;
use warnings;
use Exporter qw(import);
our @EXPORT_OK = qw(echo);
sub echo {
my $name = <STDIN>;
return scalar reverse $name;
}
use strict;
use warnings;
use 5.010;
use MyEcho qw(echo);
say echo();
perl -Ilib bin/echo.pl