oh ok... the "." is a way in perl to concentrate the variables then?

so this
$counterfile = "$homepage counter.txt";

etc
should change to
$counterfile = $homepage."counter.txt";

I am learning! i will not forget!!!


  ----- Original Message ----- 
  From: Eduard Grinvald 
  To: Luinrandir Hernson ; [EMAIL PROTECTED] 
  Sent: Monday, June 04, 2001 9:16 PM
  Subject: Re: did i do this correctly?


  $hompage != $homepage, below, i'm not sure what the spaces are for in the
  filenames, to concatenate strings, use the '.' operator:
  $homepage.$number.".gif"
  ----- Original Message -----
  From: "Luinrandir Hernson" <[EMAIL PROTECTED]>
  To: <[EMAIL PROTECTED]>
  Sent: Monday, June 04, 2001 9:18 PM
  Subject: Re: did i do this correctly?


  here is the entire code
  it works but no .gif files appear?????
  i set permissions to 775 on all .gif's the counter.txt file and the .pl and
  .cgi programs????

  ideas ????

  if i didn't want to use the .gif's could i put a
  print "counter.txt";
  somewhere????



  #!/usr/bin/perl -w
  use strict;

  ####################################
  # Setup begin
  $hompage = "/home/thx-1138/";

  $counterfile = "$homepage counter.txt"; #Full file path of counter.txt

  $imagefile{'0'}="$homepage 0.gif"; #Full file path of 0.gif
  $imagefile{'1'}="$homepage 1.gif"; #Full file path of 1.gif
  $imagefile{'2'}="$homepage 2.gif"; #Full file path of 2.gif
  $imagefile{'3'}="$homepage 3.gif"; #Full file path of 3.gif
  $imagefile{'4'}="$homepage 4.gif"; #Full file path of 4.gif
  $imagefile{'5'}="$homepage 5.gif"; #Full file path of 5.gif
  $imagefile{'6'}="$homepage 6.gif"; #Full file path of 6.gif
  $imagefile{'7'}="$homepage 7.gif"; #Full file path of 7.gif
  $imagefile{'8'}="$homepage 8.gif"; #Full file path of 8.gif
  $imagefile{'9'}="$homepage 9.gif"; #Full file path of 9.gif
  #Setup end
  ############################
  $|=1;
  @querys = split(/&/, $ENV{'QUERY_STRING'});
  foreach $query (@querys) {
     ($name, $value) = split(/=/, $query);
     $FORM{$name} = $value;
  }
  $position="$FORM{'position'}";

  open(NUMBER,"$counterfile");
  $number=<NUMBER>;
  close(NUMBER);

  $number++;
  if ($position==1) {
     open(NUMBER,">$counterfile");
     print NUMBER "$number";
     close(NUMBER);
  }

  if (($position>0) && ($position<=length($number))) {
     $positionnumber=substr($number,(length($number)-$position),1);
  }
  else {
     $positionnumber="0";
  }
  if ($imagefile{$positionnumber}) {
     $imagereturn=$imagefile{$positionnumber};
  }
  else {
     $imagereturn=$imagefile{'0'};
  }

  print "Content-type: image/gif\n\n";

  open(IMAGE,"<$imagereturn");
  print <IMAGE>;
  close(IMAGE);
  exit 0;






Reply via email to