Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/09/2006, 19:27
Avatar de LatamHost
LatamHost
 
Fecha de Ingreso: octubre-2004
Ubicación: Santiago, Chile
Mensajes: 522
Antigüedad: 20 años, 4 meses
Puntos: 1
Problema con pequeño Script

Hola!

Amigos, tengo un pequeño problema con un programita y me gustaria saber si pueden darme una mano, me estoy volviendo loco. Se poquisimo de PERL (mas se de PHP) pero no entiendo el error:

Global symbol "$sess" requires explicit package name at ./notify_sms.really.old line 44.
Global symbol "$to" requires explicit package name at ./notify_sms.really.old line 44.
Global symbol "$text" requires explicit package name at ./notify_sms.really.old line 44.
Execution of ./notify_sms.really.old aborted due to compilation errors.

El codigo es:

Código:
      1 #!/usr/bin/perl -wT
      2
      3 use strict;
      4 use HTTP::Lite;
      5 use Getopt::Long;
      6 use vars qw($opt_version $opt_help $opt_username $opt_password $opt_api_id $opt_baseurl $opt_text $opt_to $PROGNAME);
      7 use lib "/usr/lib/nagios/libexec" ;
      8 use utils qw(%ERRORS &print_revision &support &usage);
      9
     10 $PROGNAME = "notify_sms";
     11
     12 sub print_help ();
     13 sub print_usage ();
     14
     15 Getopt::Long::Configure('bundling');
     16
     17 GetOptions
     18         ("v"   => \$opt_version, "version"    => \$opt_version,
     19          "h"   => \$opt_help, "help"       => \$opt_help,
     20          "a=s" => \$opt_api_id, "apiid=s" => \$opt_api_id,
     21          "b=s" => \$opt_baseurl, "baseurl=s" => \$opt_baseurl,
     22          "m=s" => \$opt_text, "message=s" => \$opt_text,
     23          "p=s" => \$opt_password, "password=s" => \$opt_password,
     24          "t=s" => \$opt_to, "to=s" => \$opt_to,
     25          "u=s" => \$opt_username, "username=s"  => \$opt_username);
     26
     27 if ($opt_version) {
     28         print_revision($PROGNAME,'$Revision: 1.1 $');
     29         exit $ERRORS{'OK'};
     30 }
     31 if ($opt_help) {print_help(); exit $ERRORS{'OK'};}
     32
     33 ($opt_api_id) || usage("Gateway api ID must be specified\n");
     34 ($opt_text) || usage("Message body must be specified\n");
     35 ($opt_password) || usage("Gateway login password must be specified\n");
     36 ($opt_to) || usage("Phone to number must be specified\n");
     37 ($opt_username) || usage("Gateway login username must be specified\n");
     38
     39 if (!$opt_baseurl) {
     40     $opt_baseurl = "http://api.clickatell.com";
     41 }
     42
     43 my $login_url = $opt_baseurl."/http/auth?user=".$opt_username."&password=".$opt_password."&api_id=".$opt_api_id;
     44 my $send_url = $opt_baseurl."/http/sendmsg?session_id=".$sess."&to=".$to."&text=".$text;
     45
     46 #print $text."\n";
     47
     48 my $http = new HTTP::Lite;
     49 my $req = $http->request($login_url);
     50 my $res = $http->body();
     51 my @sres = split(":", $res);
     52
     53 if ($sres[0] eq "OK") {
Que esta saliendo mal?

Gracias de antemano!!