Revision 570abc83
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
tie %{ $self }, 'SL::Watchdog';
|
||
}
|
||
|
||
read(STDIN, $_, $ENV{CONTENT_LENGTH});
|
||
bless $self, $type;
|
||
|
||
if ($ENV{QUERY_STRING}) {
|
||
$_ = $ENV{QUERY_STRING};
|
||
}
|
||
$self->_input_to_hash($ENV{QUERY_STRING}) if $ENV{QUERY_STRING};
|
||
$self->_input_to_hash($ARGV[0]) if @ARGV && $ARGV[0];
|
||
|
||
if ($ARGV[0]) {
|
||
$_ = $ARGV[0];
|
||
if ($ENV{CONTENT_LENGTH}) {
|
||
my $content;
|
||
read STDIN, $content, $ENV{CONTENT_LENGTH};
|
||
$self->_request_to_hash($content);
|
||
}
|
||
|
||
bless $self, $type;
|
||
|
||
$self->_request_to_hash($_);
|
||
|
||
my $db_charset = $main::dbcharset;
|
||
$db_charset ||= Common::DEFAULT_CHARSET;
|
||
|
Auch abrufbar als: Unified diff
Scriptparameter sowohl via %ENV als auch von @ARGV und STDIN auswerten
Bisher war es so, dass -- in aufsteigender Priorität -- entweder STDIN
mit $ENV{QUERY_LENGTH}, $ENV{QUERY_STRING} oder $ARGV0 als Eingabe
gelesen wurde. Nun werden alle drei Kanäle in der Reihenfolge
$ENV{QUERY_STRING}, $ARGV0 und STDIN gelesen und ausgewertet. Die
Eingaben überschreiben sich nur bei identischen Keys, ergänzen sich
aber ansonsten.
Beispiel:
<form method="post" action="am.pl?who=me">
<input type="submit" name="action" value="Gogogo">
</form>
sorgt für zwei Key/Value-Paare in $form; who => me und action => Gogogo.