主题:perl语言问题求助!
小弟刚接触PERL,还没来的急看完书,在公司看代码,碰到一段代码不明白具体功能。往能告知。
#****************************************************************************
# Function name : ccGetAttibuteValue
#----------------------------------------------------------------------------
# Input parameters : a file path, an attribute name
# -------------------
# Output parameters : return the attribute value, or ""
# -------------------
#----------------------------------------------------------------------------
# DESCRIPTION
# Get an element attribute value
#****************************************************************************
sub ccGetAttibuteValue {
my ($file, $att_name) = @_;
my $result = ct_exec("descr -fmt \"%[$att_name]NSa\\n\" $file");
$result = "" if( $? );
chomp( $result );
$result =~ s/\"//g; #- suppress double quotes arround string
return $result;
} # ---- End of ccGetAttibuteValue() ---- #
/////
my $result = ct_exec("descr -fmt \"%[$att_name]NSa\\n\" $file");
$result = "" if( $? );这两句是什么意思?ct_exec()这个函数库函数吗,怎么网上和程序里都找不到,请详细解释一下,万分感谢了!
#****************************************************************************
# Function name : ccGetAttibuteValue
#----------------------------------------------------------------------------
# Input parameters : a file path, an attribute name
# -------------------
# Output parameters : return the attribute value, or ""
# -------------------
#----------------------------------------------------------------------------
# DESCRIPTION
# Get an element attribute value
#****************************************************************************
sub ccGetAttibuteValue {
my ($file, $att_name) = @_;
my $result = ct_exec("descr -fmt \"%[$att_name]NSa\\n\" $file");
$result = "" if( $? );
chomp( $result );
$result =~ s/\"//g; #- suppress double quotes arround string
return $result;
} # ---- End of ccGetAttibuteValue() ---- #
/////
my $result = ct_exec("descr -fmt \"%[$att_name]NSa\\n\" $file");
$result = "" if( $? );这两句是什么意思?ct_exec()这个函数库函数吗,怎么网上和程序里都找不到,请详细解释一下,万分感谢了!