Error in perl matching
2015-01-04 13:40
127 查看
We got this error by running:
my $str = "reb,cheng";
$str = ~ s/,//;
print $str, "\n";
seems everything is okay, but why?
Here is the error message:
C:\Rebecca\script\perl>perl status_v0.2_clear.pl
Use of uninitialized value $_ in substitution (s///) at status_v0.2_clear.pl line 88, <DATA> line 751.
18446744073709551615
Notice there is a space between “=” and “~”, the correct way should be
NO SPACE between them:
my $str = "reb,cheng";
$str = ~ s/,//;
print $str, "\n";;
then we got:
C:\Rebecca\script\perl>perl status_v0.2_clear.pl
rebcheng
It is executed successfully after removing the space!!
my $str = "reb,cheng";
$str = ~ s/,//;
print $str, "\n";
seems everything is okay, but why?
Here is the error message:
C:\Rebecca\script\perl>perl status_v0.2_clear.pl
Use of uninitialized value $_ in substitution (s///) at status_v0.2_clear.pl line 88, <DATA> line 751.
18446744073709551615
Notice there is a space between “=” and “~”, the correct way should be
NO SPACE between them:
my $str = "reb,cheng";
$str = ~ s/,//;
print $str, "\n";;
then we got:
C:\Rebecca\script\perl>perl status_v0.2_clear.pl
rebcheng
It is executed successfully after removing the space!!
相关文章推荐
- 解决Error (1133): Can’t find any matching row in the user table
- Keil 链接错误 Error: L6406E: No space in execution regions with .ANY selector matching
- .\Opt\TMES.axf: Error: L6406E: No space in execution regions with .ANY selector matching indicate_se
- 解决:whm搬站出现的mysql error message:Can't find any matching row in the user table
- cygwin在Win10下的问题 perl.exe: *** fatal error in forked process - fork: can't reserve memory for parent
- MYSQL连接Error (1133): Can’t find any matching row in the user table错误的解决办法
- KEIL在Build的时候提示Error:L6406E:No space in execution regions with .ANY selector matching 错误
- .\Obj\main.axf: Error: L6406E: No space in execution regions with .ANY selector matching sin_i.o(.co
- .\Obj\main.axf: Error: L6406E: No space in execution regions with .ANY selector matching sin_i.o(.co
- FAILED: Error in semantic analysis: No matching method for class org.apache.hadoop.hive.ql.udf.GetEx
- Keil 链接错误 Error: L6406E: No space in execution regions with .ANY selector matching
- Keil 链接错误 Error: L6406E: No space in execution regions with .ANY selector matching
- Error: L6406E: No space in execution regions with .ANY selector matching
- 解决Error(1133): Can’t find any matching row in the user table
- Error:Failed to resolve: junit:junit:4.12 <a href="open.dependency.in.project.structure">Show in Pro
- Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
- CodeSign error: code signing is required for product type Application in SDK iOS 4.2
- error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMT.
- error: 'for' loop initial declarations are only allowed in C99 mode
- 编译安装libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)