Changeset 7818
- Timestamp:
- 09/10/09 02:28:20 (2 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/Document/Perl/Beginner.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Document/Perl/Beginner.pm
r7807 r7818 74 74 } 75 75 } 76 76 77 if ( $text =~ /use\s+warning\s*;/ ) { 77 78 $self->{error} = "You need to write use warnings (with an s at the end) and not use warning."; 78 79 return; 79 80 } 81 80 82 if ( $text =~ /map[\s\t\r\n]*\{.+?\}[\s\t\r\n]*\(.+?\)[\s\t\r\n]*\,/ ) { 81 83 $self->{error} = "map (),x uses x also as list value for map."; … … 86 88 if ( $text =~ /package DB[\;\:]/ ) { 87 89 $self->{error} = "This file uses the DB-namespace which is used by the Perl Debugger."; 90 return; 91 } 92 93 if ( $text =~ /\=[\s\t\r\n]*chomp\b/ ) { 94 $self->{error} = "chomp doesn't return the chomped value, it modifies the variable given as argument."; 95 return; 96 } 97 98 if ( $text =~ /map[\s\t\r\n]*\{[\s\t\r\n]*(\$_[\s\t\r\n]*\=\~[\s\t\r\n]*)?s\// ) { 99 $self->{error} = "Substitute (s///) doesn't return the changed value even if map."; 100 return; 101 } 102 103 if ( $text =~ /\(\<\@\w+\>\)/ ) { 104 $self->{error} = "(<\@Foo>) is Perl6 syntax and usually not valid in Perl5: %s"; 105 return; 106 } 107 108 if ( $text =~ /if[\s\t\r\n]*\(?[\$\s\t\r\n\w]+\=[\s\t\r\n\$\w]/ ) { 109 $self->{error} = "A single = in a if-condition is usually a typo, use == or eq to compare."; 110 return; 111 } 112 113 if ( $text =~ /open[\s\t\r\n]*\(?\$?\w+[\s\t\r\n]*(\,.+?)?\,?([\"\'])[^\2]+?\|[^\2]+?\2/ ) { 114 $self->{error} = "Using a | char in open without a | at the beginning or end is usually a typo."; 115 return; 116 } 117 118 if ( $text =~ /open[\s\t\r\n]*\(?\$?\w+[\s\t\r\n]*\,(.+?\,)?([\"\'])\|[^\2]+?\|\2/ ) { 119 $self->{error} = "You can't use open to pipe to and from a command at the same time."; 88 120 return; 89 121 }
Note: See TracChangeset
for help on using the changeset viewer.
