irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

scriptassist.pl "defined(%hash) is deprecated" error #802

Open irssibot opened 13 years ago

irssibot commented 13 years ago

Using scriptassist 2003020803 you get following error:

 Irssi v0.8.15 - http://www.irssi.org

13:41 Looking up irc.freenode.net 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 97. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 207. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 207. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 689. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 690. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 777. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 857. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 defined(%hash) is deprecated at /home/needle/.irssi/scripts/autorun/scriptassist.pl line 1090. 13:41 13:41 I(Maybe you should just omit the defined()?) 13:41 13:41 >> scriptassist 2003020803 loaded: /scriptassist help for help

irssibot commented 13 years ago

Patch attached. This also may apply to following bugs:

770

irssibot commented 13 years ago

scriptassist.diff

*** scriptassist.pl.bugged  2011-04-23 14:47:18.800206683 +0200
--- scriptassist.pl 2011-04-23 15:11:45.338956357 +0200
***************
*** 94,100 ****
      my ($url) = @_;
      no strict "refs";
      # check for a loaded openurl
!     if (defined %{ "Irssi::Script::openurl::" }) {
          &{ "Irssi::Script::openurl::launch_url" }($url);
      } else {
          print CLIENTCRAP "%R>>%n Please install openurl.pl";
--- 94,100 ----
      my ($url) = @_;
      no strict "refs";
      # check for a loaded openurl
!     if (%{ "Irssi::Script::openurl::" }) {
          &{ "Irssi::Script::openurl::launch_url" }($url);
      } else {
          print CLIENTCRAP "%R>>%n Please install openurl.pl";
***************
*** 204,210 ****
      my %result;
      my $xml = get_scripts();
      foreach (@{$scripts}) {
!   next unless (defined $xml->{$_.".pl"} || (defined %{ 'Irssi::Script::'.$_.'::' } && defined %{ 'Irssi::Script::'.$_.'::IRSSI' }));
    $result{$_}{version} = get_remote_version($_, $xml);
    my @headers = ('authors', 'contact', 'description', 'license', 'source');
    foreach my $entry (@headers) {
--- 204,210 ----
      my %result;
      my $xml = get_scripts();
      foreach (@{$scripts}) {
!   next unless (defined $xml->{$_.".pl"} || (%{ 'Irssi::Script::'.$_.'::' } && %{ 'Irssi::Script::'.$_.'::IRSSI' }));
    $result{$_}{version} = get_remote_version($_, $xml);
    my @headers = ('authors', 'contact', 'description', 'license', 'source');
    foreach my $entry (@headers) {
***************
*** 686,693 ****
      my $text;
      foreach (@$scripts) {
    no strict 'refs';
!   next unless defined %{ "Irssi::Script::${_}::" };
!   next unless defined %{ "Irssi::Script::${_}::IRSSI" };
    my %header = %{ "Irssi::Script::${_}::IRSSI" };
    next unless $header{sbitems};
    $text .= '%9"'.$_.'"%9 provides the following statusbar item(s):'."\n";
--- 686,693 ----
      my $text;
      foreach (@$scripts) {
    no strict 'refs';
!   next unless %{ "Irssi::Script::${_}::" };
!   next unless %{ "Irssi::Script::${_}::IRSSI" };
    my %header = %{ "Irssi::Script::${_}::IRSSI" };
    next unless $header{sbitems};
    $text .= '%9"'.$_.'"%9 provides the following statusbar item(s):'."\n";
***************
*** 774,780 ****
  sub contact_author ($) {
      my ($script) = @_;
      no strict 'refs';
!     return unless defined %{ "Irssi::Script::${script}::" };
      my %header = %{ "Irssi::Script::${script}::IRSSI" };
      if (defined $header{contact}) {
    my @ads = split(/ |,/, $header{contact});
--- 774,780 ----
  sub contact_author ($) {
      my ($script) = @_;
      no strict 'refs';
!     return unless %{ "Irssi::Script::${script}::" };
      my %header = %{ "Irssi::Script::${script}::IRSSI" };
      if (defined $header{contact}) {
    my @ads = split(/ |,/, $header{contact});
***************
*** 854,860 ****
  sub get_local_version ($) {
      my ($script) = @_;
      no strict 'refs';
!     return unless defined %{ "Irssi::Script::${script}::" };
      my $version = ${ "Irssi::Script::${script}::VERSION" };
      return $version;
  }
--- 854,860 ----
  sub get_local_version ($) {
      my ($script) = @_;
      no strict 'refs';
!     return unless %{ "Irssi::Script::${script}::" };
      my $version = ${ "Irssi::Script::${script}::VERSION" };
      return $version;
  }
***************
*** 1087,1093 ****
      my ($script, $server, $witem) = @_;
      no strict;
      $script = $2 if $script =~ /(.*\/)?(.*?)\.pl$/;
!     if (defined %{ "Irssi::Script::${script}::" }) {
    if (defined &{ "Irssi::Script::${script}::pre_unload" }) {
        print CLIENTCRAP "%R>>%n Triggering pre_unload function of $script...";
        &{ "Irssi::Script::${script}::pre_unload" }();
--- 1087,1093 ----
      my ($script, $server, $witem) = @_;
      no strict;
      $script = $2 if $script =~ /(.*\/)?(.*?)\.pl$/;
!     if (%{ "Irssi::Script::${script}::" }) {
    if (defined &{ "Irssi::Script::${script}::pre_unload" }) {
        print CLIENTCRAP "%R>>%n Triggering pre_unload function of $script...";
        &{ "Irssi::Script::${script}::pre_unload" }();