Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Unitialised Value ?

Expand Messages
  • Charles K. Clarkson
    ... This is similar to the code you posted for bannerside1.pm. Might I suggest that you drop $domain completely. Just use $ENV{SERVER_NAME} directly. my
    Message 1 of 3 , Sep 4, 2002
    • 0 Attachment
      Gordon Stewart [mailto:gordon@...] wrote:
      :
      : my $domain =$ENV{SERVER_NAME};
      :
      : if ($domain eq "tview.kwister.com") {$site="nz";}
      : if ($domain eq "tdview.kwister.com") {$site="dis";}
      :
      :
      : Why will I get these messages :-
      :
      : [Wed Sep 4 17:57:40 2002] C:\sambar50\cgi-bin\test\view.cgi: Use of
      : uninitialized value in string eq at
      : C:\sambar50\cgi-bin\test\view.cgi line 58. [Wed Sep 4
      : 17:57:40 2002] C:\sambar50\cgi-bin\test\view.cgi: Use of
      : uninitialized value in string eq at
      : C:\sambar50\cgi-bin\test\view.cgi line 59.
      :
      :
      : Ive 'initialised' the $domain variable just 2-3 lines above -
      : & I want to
      : compare it to a particular domain name
      :
      : Ive tried == & eq
      :
      : Any advise ?
      :
      : This partcular code is new to this script (combining 2 sets
      : of scripts into one script) however I havnt been 'bamboozled'
      : by this error before now -
      : I usually resolve it within 10-20 minutes..
      :
      : I AM using warnings & strict..

      This is similar to the code you posted for bannerside1.pm.
      Might I suggest that you drop $domain completely. Just use
      $ENV{SERVER_NAME} directly.

      my $domain1 = $ENV{SERVER_NAME};

      if ($domain1 eq "tview.kwister.com") {$site="nz";}
      if ($domain1 eq "tdview.kwister.com") {$site="disabled";}

      $t{nz}="bannernz.list";
      $t{disabled}="bannerdis.list";
      $bannerlist = $t{$site};

      $t{nz}="bannersidenz.list";
      $t{disabled}="bannersidedis.list";
      my $bannerside1 = $t{$site};

      Would become something like:

      if ( $ENV{SERVER_NAME} ) {

      if ( $ENV{SERVER_NAME} eq 'tview.kwister.com' ) {
      # $bannerlist = 'bannernz.list';
      $bannerside1 = 'bannersidenz.list';

      } elsif ( $ENV{SERVER_NAME} eq 'tdview.kwister.com' ) {
      # $bannerlist = 'bannerdis.list';
      $bannerside1 = 'bannersidedis.list';

      } else {
      # Different server.
      }

      } else {
      # No server name listed.
      }

      I commented the lines with $bannerlist because
      it wasn't used in the module. If one of your subdomains
      is the default domain this could be shortened.

      if ( $ENV{SERVER_NAME} eq 'tview.kwister.com' ) {
      # $bannerlist = 'bannernz.list';
      $bannerside1 = 'bannersidenz.list';

      } else { # default to tdview.kwister.com
      # $bannerlist = 'bannerdis.list';
      $bannerside1 = 'bannersidedis.list';
      }


      HTH,

      Charles K. Clarkson
      --
      Head Bottle Washer,
      Clarkson Energy Homes, Inc.
      Small commercial and residential rehabilitation specialists.
      254 968-8328

      CJ Web Work - Solutions for Real Estate Investors.
      972 216-4952

      CJ Web Hosting - Lookout; We have one whole paying customer!
      254 968-8328
    Your message has been successfully submitted and would be delivered to recipients shortly.