Jojo: NACHTRAG zu "Wie schicke ich ... zum Server und zurück...?

...offensichtlich ist meine Anfrage zu umfangreich geworden. Hier der Rest der abgeschnitten wurde.

eval "tr/[$OK_CHARS]//c";
   $chk_name=$_;
   return($chk_name);
  }
} else {return ("illegal_filename");}
}

sub Get_Seconds {
local($giventime)=@_;
local($givenh,$givenm,$givens);
if (index($giventime,':') < 0)  {return 0;}
($givenh,$givenm,$givens)=split(/:/,$giventime);
return ($givenh*3600+$givenm*60+$givens);
}

sub lock {
   local($fh) = @_;
   flock($fh,$LOCK_EX);
   seek($fh, 0, 2);
}

sub unlock {
   local($fh)=@_;
   flock($fh,$LOCK_UN);
}

$MAX_SLEEP = 15;
$LOCK_LOCATION = "/tmp";
$PROG_NAME = $0;
$PID = $$;

sub NLock {
        local($_) = @_[0] $PROG_NAME;
        @FULL_PATH = split("/");
        $LOCK_NAME = pop(@FULL_PATH);
        $LOCK_PATH = "$LOCK_LOCATION/$LOCK_NAME.lck";

while (-e "$LOCK_PATH") {
                $SLEEP_COUNT++;
                sleep 1;
                if ($SLEEP_COUNT == $MAX_SLEEP) {
                        $! = "Persistent lock file $LOCK_PATH exists.";
                        return 0;
                }
        }
        open (LOCK, "> $LOCK_PATH") return 0;
        print LOCK $PID;
        close (LOCK);
        1;
}

sub NUnlock {
        local($_) = @_[0] $PROG_NAME;
        @FULL_PATH = split("/");
        $LOCK_NAME = pop(@FULL_PATH);
        $LOCK_PATH = "$LOCK_LOCATION/$LOCK_NAME.lck";

return (unlink $LOCK_PATH);
}

sub get_http {
    local ($httphost,$httpport,$httppath,$httpcommand) = @_;
    local($httpretry,$httpthat,$httpthataddr);
    $httpretry=0;
    $httpthem = $httphost;
    ($httpname, $httpaliases, $httpproto) = getprotobyname('tcp');
    ($httpname, $httpaliases, $httpport) = getservbyname($port, 'tcp') unless $port =~
/^\d+$/;
    ($httpname, $httpaliases, $httptype, $httplen, $httpthataddr) =
gethostbyname($httpthem);
    $httpthat = pack($httpsockaddr, &AF_INET, $httpport, $httpthataddr);
    socket(S, &PF_INET, &SOCK_STREAM, $httpproto) die "socket: $!";
    bind(Server, sockaddr_in($httpport, INADDR_ANY)) ;
    connect(S, $httpthat) return(undef);
    select(S); $ = 1; select(stdout);
    $output = "";
    {                          
        print S "$httpcommand $httppath HTTP/1.0\n\n"; # Aergerzeile!
        while (<S>) {
           if ($_ =~ /HTML/) {$httpretry=1;}
           $httpoutput = $httpoutput.$_;
        };
    };  
    close S;    
    if ($httpretry) { #Dieser Server will moeglicherweise den vollen Pfad haben...

$httpthat = pack($httpsockaddr, &AF_INET, $httpport, $httpthataddr);
        socket(S, &PF_INET, &SOCK_STREAM, $httpproto) die "socket: $!";
        bind(Server, sockaddr_in($httpport, INADDR_ANY)) ;
        connect(S, $httpthat) return(undef);
        select(S); $ = 1; select(stdout);
        $httppath='http://'.$httphost.'/'.$httppath;
        $httpoutput = "";
        {                              
          print S "$command $path HTTP/1.0\n\n"; # Aergerzeile!
          while (<S>) {$httpoutput = $httpoutput.$_;};
        };      
    }  
    return ($httpoutput);
}
sub httpstatus
{
    local ($proto_host,$proto_path) = @_;
    $s = get_http($proto_host,'80',$proto_path,"HEAD");
    ($p,$st) = ($s =~ /(^HTTP[^ ]*) *(\d\d\d) /);
    return ($st)
}
sub http_call {
    local($homepage) = @_;
    local ($server,$subpage);
    local($kopf_call,$st_call);
    $server=substr($homepage,7,length($homepage));
    $subpage=substr($server,index($server,'/'),length($server));
    $server=substr($server,0,index($server,'/'));

local ($s,$p,$st);
    $s = get_http($server,'80',$subpage,"GET");
    $kopf_call=get_http($server,'80',$subpage,"HEAD");
    $st_call=substr($s,length($kopf_call),length($s));
    return ($st_call)
}

sub ALLSort {
my (@SORTARRAY)=@_;
my ($asorttmpfile1)="/tmp/allsort-.tmp2";
my (@RESULTARRAY);

if ($#SORTARRAY <=0) {return @SORTARRAY;}
open(ASO,">$asorttmpfile1 ");
  for ($sortcount=0;$sortcount<=$#SORTARRAY;$sortcount++) {
   print ASO "$SORTARRAY[$sortcount]\n";
  }
close ASO;
if ($ALLSORT_METH) {
   system("sort $ALLSORT_METH $asorttmpfile1 > $asorttmpfile2");
} else {
   system("sort $asorttmpfile1 > $asorttmpfile2");
}
unlink $asorttmpfile1;

open(ASO,"<$asorttmpfile2");
  while(<ASO>) {
   chop($_);
   push(@RESULTARRAY,$_);
  }
close ASO;
unlink $asorttmpfile2;
return @RESULTARRAY;
}

1;

**********
D)   FRAGE
**********

Was muss ich aendern, um die zum Server Uebertragenen Daten auf meinen Rechner
zurueckzubekommen?

Entschuldigt bitte, dass diese Anfrage so lang geworden ist.

Ich danke euch im voraus für eine Antwort.

  1. Schön für dich!

  2. Tag!

    ...offensichtlich ist meine Anfrage zu umfangreich geworden.

    Ach wirklich? Ist das so? Und kannst Du Dir vielleicht vorstellen, dass dies aus einem bestimmten Grund so eingerichtet wurde? Vielleicht ist es einfach so, dass sich hier kein Mensch 20 kB Quellcode durchlesen wird, um eine Frage zu beantworten, die allgemeiner nicht haette gestellt werden koennen?

    Nun, die Fehlermeldung in der error.log laesst mich vermuten, dass der Webserver einfach nicht weiss, wie er ein Perlscript auszufuehren hat. Ich weiss nicht, wie Omnihttp das herausfindet. Entweder nimmt es die Angabe in der ersten Zeile der Perldatei her, wo stehen muss, wo der Interpreter liegt. Die solltest Du also mal richtig angeben (den kompletten Pfad natuerlich). Oder Du musst die Dateiendung .pl mit der perl.exe verknuepfen. Oder Du musst in irgendeiner Config-datei einstellen, wie ein Perlscript ausgefuehrt wird. Wie gesagt, ich kenne Omnihttp nicht, und normalerweise gibt's fuer sowas ne Dokumentation.

    Entschuldigt bitte, dass diese Anfrage so lang geworden ist.

    Es ist nicht wichtig, ob das jemand entschuldigt, sondern ob Du was draus gelernt hast.

    Calocybe