]> jfr.im git - irc/xchat.git/commitdiff
Plugin shouldn't force strict and warnings on scripts even if it's
authorlsitu <redacted>
Fri, 30 Apr 2010 21:06:24 +0000 (21:06 +0000)
committerlsitu <redacted>
Fri, 30 Apr 2010 21:06:24 +0000 (21:06 +0000)
good idea to have them on.

git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1412 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

plugins/perl/Xchat.pm

index b2b9f4858188be4ba49f16b8f1951c84ca9a8cb5..1c3d166f4bdc49a02e0ea7b1285c8e024d4b2979 100644 (file)
@@ -523,26 +523,24 @@ sub load {
                # Xchat::register
                $scripts{$package}{filename} = $file;
                $scripts{$package}{loaded_at} = Time::HiRes::time();
-               {
-                       no strict; no warnings;
-                       my $full_path = File::Spec->rel2abs( $file );
-                       $source =~ s/^/#line 1 "$full_path"\n\x7Bpackage $package;/;
-
-                       # make sure we add the closing } even if the last line is a comment
-                       if( $source =~ /^#.*\Z/m ) {
-                               $source =~ s/^(?=#.*\Z)/\x7D/m;
-                       } else {
-                               $source =~ s/\Z/\x7D/;
-                       }
 
-                       _do_eval( $source );
+               my $full_path = File::Spec->rel2abs( $file );
+               $source =~ s/^/#line 1 "$full_path"\n\x7Bpackage $package;/;
 
-                       unless( exists $scripts{$package}{gui_entry} ) {
-                               $scripts{$package}{gui_entry} =
-                                       Xchat::Internal::register(
-                                               "", "unknown", "", $file
-                                       );
-                       }
+               # make sure we add the closing } even if the last line is a comment
+               if( $source =~ /^#.*\Z/m ) {
+                       $source =~ s/^(?=#.*\Z)/\x7D/m;
+               } else {
+                       $source =~ s/\Z/\x7D/;
+               }
+
+               _do_eval( $source );
+
+               unless( exists $scripts{$package}{gui_entry} ) {
+                       $scripts{$package}{gui_entry} =
+                               Xchat::Internal::register(
+                                       "", "unknown", "", $file
+                               );
                }
                
                if( $@ ) {
@@ -562,6 +560,8 @@ sub load {
 }
 
 sub _do_eval {
+       no strict;
+       no warnings;
        eval $_[0];
 }