Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::SMS advice needed ....

Status
Not open for further replies.

rab54

Programmer
Jan 28, 2004
112
GB
Hi gurus -

I have set up a script to send me SMS Alerts on completion of variouys tasks - it all works fine except when I include variable - eg '$recs were imported'

Here is a code snippet -

my $sms = Net::SMS::O2->new(
autotruncate => 1,
username => 'myname',
password => 'mypass',
recipient => 'mynumber',
subject => 'Nightly Import OK - ',
message => '$recs sent',
);

I have checked the module info on CPAN - but no joy ....

Any help would be excellent

cheers

Rab
 
Hi Rab

Use double rather than single quotes when you want to have the value of a variable in a string; like this:

"$recs sent"

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Cheers Mike

I have already tried this tho ;~(

....
 
rab,
you could try

$msg="$recs sent";
and then

message=>$msg

you have a trailing comma in your code with naught after it, this might be causing a problem also

Could you give me any more information on how you went about setting up an account with oh2?

--Paul


It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
No worries Paul - it's a doddle -

go to o2.co.uk
create a user name (and password)

Use the above the in the code sample above -

You get 30 free - then you gotta pay - but you can do it via your phone (£1.50 per 30) not too bad .....

Still working on the variable prob ....

chers
 
sorted - I needed the quotes in the final $message -

$sms->verbose( 1 );
$sms->message( "$recs records imported" );

cheers all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top