473,503 Members | 4,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't call method "send" on an undefined value

3 New Member
Hi all, newb to Perl here. I'm trying to use the Net:SNPP package to send a page, and getting the above error when trying to send. Here's my code:
Expand|Select|Wrap|Line Numbers
  1. my $host = "snpp.cingular.com:444";
  2.  
  3. my $snpp = Net::SNPP->new( $host );
  4.  
  5. $snpp->send( Pager => $to, Message => $message,);
  6.  
  7. $snpp->quit;
  8.  
I think that the problem may be that we're running Apache on top of a windows server as that seemed to introduce some other problems, but this doesn't make sense to me since I'm definitely defining $snpp, aren't I?

Thanks in advance.
-Karim Varela
Jun 26 '07 #1
1 5878
miller
1,089 Recognized Expert Top Contributor
Whenever connecting to an external host, add error checking that verifies the connection was established.

Expand|Select|Wrap|Line Numbers
  1. my $snpp = Net::SNPP->new( $host ) or die "Unable to create Net::SNPP object";
  2.  
We can predict that the above line will fail because you've already received an error message that says that $snpp is undefined (hence why you can't call "send" on it). It will be up to you to determine why you can't connect.

- Miller
Jun 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
7187
by: Kurda Yon | last post by:
Sorry for a very stupid question. Can you tell me what does the following html source does if I press button "Send"? If I read this code by Netscaspe from my local file system and then press...
2
6230
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
6
3314
by: Guadala Harry | last post by:
I have some client-side JavaScript that, among other things, calculates the value of a variable (myVar). On the server I have a stored procedure that needs to somehow receive as an input parameter...
6
30987
by: Gary | last post by:
Hi, I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)") This is not working ..what could be the...
4
4267
by: Rvo | last post by:
Hi all, I need to use the Netware "send" function to send messages to some/all attached netware users on a server. However, I can't find any documentation on this topic on the Novell site or...
0
1476
by: bruce | last post by:
I'm testing a very simple web services called Add (take 2 integers and return the result). The service program is done in VS.NET and work well using HTTP POST. I wrote a simple (Classic) ASP SOAP...
2
6939
by: wpollans | last post by:
Hello, I need to able to write JS that will click on a link with the middle mouse button - so that the link target will open in a new window or tab - using firefox. Or is there a better (more...
2
12563
by: somtabu | last post by:
How to send value from frontend to report in VB.Net Actually I have a form in VB.Net and there is a textbox. Now i want to send the textbox value to Crystal Report. How can i do this? Please help
1
6076
by: groupie | last post by:
Hi, I'd like to know how to implement the "Forgot Password" feature on many websites which require a login, exactly like this ebay example:...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7291
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7012
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.