Use of uninitialized value in concatenation (.) or string at lib/MSN.pm line 220, line 1. Use of uninitialized value in concatenation (.) or string at lib/MSN.pm line 220, line 1. Connecting to messenger.hotmail.com:1863 as / (3 NS) TX: VER 0 MSNP10 MSNP9 CVR0 (3 NS) RX: VER 0 MSNP10 MSNP9 CVR0 Use of uninitialized value in concatenation (.) or string at lib/MSN/Notification.pm line 572, line 1. (3 NS) TX: CVR 1 0x0409 winnt 5.0 i386 MSNMSGR 6.1.0203 MSMSGS (3 NS) RX: 731 1 SERVER ERROR : Badly Formated CVR : 1
it looks as though it isn't passing the username and password to the module
Here is the beginning of bot.pl:
Code:
use lib "./lib";<br /><br />use MSN;<br /><br />require "config.dat";<br /><br /># create an MSN object showing all server errors and other errors<br />#my $msn = new MSN( 'Handle' => $handle, 'Password' => $password );<br /><br /># OR create an MSN object with all error messages turned off<br />#my $msn = new MSN( 'Handle' => $handle, 'Password' => $password, 'ServerError' => 0, 'Error' => 0 );<br /><br /># OR create an MSN object with full debugging info<br />my $msn = new MSN( 'Handle' => $handle, 'Password' => $password, 'AutoloadError' => 1, 'Debug' => 1, 'ShowTX' => 1, 'ShowRX' => 1 );
and here is the config.dat file:
Quote:
# HelplessBot Template # Config
my $handle = 'scott@unixhideout.com'; my $password = '********';
also the lines from the errors: lib/MSN.pm line 220:
Quote:
$self->debug( "Connecting to $self->{Host}:$self->{Port} as $self->{Handle}/$self->{Password}" );
and lib/MSN/Notification.pm line 572:
Quote:
$self->send( 'CVR', CVER10 . $self->{Handle} );
if you could help please that would be great, thanks
Have you tried declaring the $handle and $password variables in your bot.pl instead of the config.dat? I'm not sure why and I haven't tested it, but I think you'll find that either the variables are local to the .dat file because of the mys or Perl is not treating the config.dat file as actual Perl source during the require.
When you have errors like this, the thing to do is remove all doubt of the use of external files.
Yeah. Just like "my" declares variables for the current scope (means they're gone at the next }), it does the same thing with required files.
For example (red = already there, blue = require-included codes)
Quote:
#!/usr/bin/perl
my $red = 'FF0000';
my $blue = '0000FF';
print "Red: $red\n" . "Blue: $blue\n\n";
The value of $red would show, but not $blue. ___________________
Anyways, declare them with "our" to make them global.
So in the config.dat, use "our $handle" and "our $password"
If that doesn't work, declare them before loading that file (using our again), and in the config.dat just refer to them (i.e. "$handle = 'name@domain.com';") _________________ Current Site (2008) http://www.cuvou.com/
Joined: 25 Jun 2004 Posts: 130 Location: Liverpool(home) or Derby(uni), UK votes: 3
Posted: Thu Feb 28, 2008 1:13 pm Post subject:
The topic is 4 years old, the original poster is long gone by now. If you post your problems here (or in a new topic) then we can help you sort it out.