$VAR1 = [ " echo ", " ----------", " REPVersion", "", " Version ", " ----------------------------------------------------------------------------------------------------------------------------------------------", " Replication Server/16.0/EBF 27617 SP03 PL03 rs160sp03pl03/Linux AMD64/Linux 2.6.32.59-0.19-default x86_64/2214/OPT64/Tue Dec 19 19:00:15 2017 ", " echo ", " -----------", " REPErrorlog", "", " Log File Name ", " --------------------------------------------------------", " /logdisk/logs/my.log", " echo ", " --------------", " REPSiteVersion", "", " Site Version", " ------------", " 1600302", " echo ", " -----------", " REPRSSDName", "", " RSSD Dataserver RSSD Database ", " ------------------------- ------------------", " SYBASE_APP123_MYRSSD_SERV SYBASE_APP123_RSSD", " ------------", " REPQueueSize", "", " ", " -----------", " 102396", " ", " ---------------", " REPLossDetected", "", " ", " -----------", " 0", " ", " -------------", " REPSSLEnabled", "", " ", " -----------", " 0" ]; ARRAY(0x20794b0) #### my $result = runDBsql($server,$user,$pass); # Cannot modify runDBsql remove_leadspace($result); local $Data::Dumper::Useqq = 1;# In case it is not whitespace but some other character print Dumper($result); print "\n$result\n"; # added for further debugging sub remove_leadspace { return if not defined wantarray; return map { s/^\s+//r } @_ if wantarray; return shift =~ s/^\s+//r; } #### (' REPErrorlog', ' /logdisk/logs/my.log') (' REPSiteVersion', ' 1600302') (' REPRSSDName', ' SYBASE_APP123_MYRSSD_SERV SYBASE_APP123_RSSD') (' REPQueueSize', ' 102396') (' REPLossDetected', ' 0') (' REPSSLEnabled', ' 0')