Thread CGI-script aus perl-script starten (2 answers)
Opened by Tim at 2011-09-15 15:13

Linuxer
 2011-09-15 15:34
#152452 #152452
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
Hi,

schau Dir mal die LWP Module an.

Du kannst beispielsweise relativ leicht mit LWP::Simple einfache Requests erstellen, um Daten von Webservern zu erhalten.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

# fetch data from URL
my $content = get( "http://example.org/cgi-bin/whatever.pl" );

# process data into desired structure
my @array = do_your_magic_with(\$content);


# let's assume, that we got a string with whitespace separated values
sub do_your_magic_with {
  my $ref = shift;

  return split m/\s+/, $$ref;
}

meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread CGI-script aus perl-script starten