#!/usr/bin/perl
print "Input string: ";
$line = <stdin>;
$line = reverse ($line);
print $line;
参考来源:
https://zhidao.baidu.com/question/41336877.html