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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of uninitialized value in substitution (s///)

Status
Not open for further replies.

canguro

Programmer
Sep 15, 2002
57
US
Hi, Everyone,

I'm trying to learn Perl on my own and making some progress, however, I'm still a newbie. I figure I can speed up my learning process by trying out some simple programs. I have a pet project that attempts to retrieve some stock data info and strip the tags from the HTML. (By the way, this is for my own practice, not for any commercial use of any kind). I am using the following code but getting the 'Use of uninitialized' message shown above. I am probably missing something rather obvious.
Can someone straighten me out? Here is the code:

#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
my $site="my $content=get $site;
my $message=$content;
$message=s/<[>]*>//g;
print $message;

Your help is very much appreciated. Many thanks.
 
Change the line:
$message=s/<[>]*>//g;

to:
$message=~s/<[>]*>//g;
 
raider2001,

Thank you very much for your fast reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top