如果我$myString用值声明了一个变量'3 '(注意空格).是否有任何函数可以删除返回值的空白区域.有点像SomeFun($myString) 回归'3'(没有白色空间).
#!C:\Perl\bin\perl.exe
use strict;
use warnings;
use Data::Dumper;
my $fh = \*DATA;
print Dumper parse_constant_spec( $fh );
# Parse a constant spec file.
# Pass in a handle to process.
# As long as it acts like a file handle, it will work.
sub parse_constant_spec {
my $fh = shift;
my %spec;
# Until file is done:
# Read in a whole block
while( my $block = read_block($fh) ) {
# …Run Code Online (Sandbox Code Playgroud) perl ×1