473,597 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search within a variable

Hi ! I'm new to Perl and this group so any help is welcome. I've
look around the groups a lot but I can't seems to find what I need.

I have to do a script that connects to a specific web page and search
it's source code for some words. Now, the script is able to connect
to the page, print the source on screen but when I try to search, it
seems like I don't have the right parameters.

Let's look :

----------------------------------------------------
#!c:\perl\bin\p erl.exe

use Win32::Internet ;
$Connection = Win32::Internet->new();

print "Content-type: text/plain\n\n\n";

$url = "http://www.mydomain.co m";

$INET = new Win32::Internet ();
$file = $INET->FetchURL("$url ");

print "Here's the web address : $url\n";
print "And here's the source code : \n\n\n$file\n\n ";
----------------------------------------------------

The content of the variable $file is the source code right !
I need to do a search within the $file variable.

I tried two things I found in a book :
$canvas->find("word") ;
$hostindex = $text->search(-nocase, -count => \$combien, word);

It doesn't work at all when I try to print the content. I need to
know how to specify the variable in which I want the search to be
done. I don't know if you guys can understand what I mean ...
Can anybody help please ?
Thanks a lot !
Jul 19 '05 #1
0 2267

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3415
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering converting a site of mine to PHP-Nuke, but if the individual modules aren't picked up in search engines I'm not going to do it. Thanks phpKid
1
1371
by: Compkitty | last post by:
Hi, I'm sort of new to Stored Procedures; and I'm building a search page where there are 9 parameters the user can put in; as little as 1, at most 9.. then it runs the Stored P and looks at the values. I am using the COALESCE; to skips nulls,... but I'm still not getting the right results.. either I get 0 or 4000.. CREATE PROCEDURE Sp_Search ( @AcctNum varchar (100),
39
4378
by: Noticedtrends | last post by:
Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if authors of content subconsciously mention the keywords "lately and noticed" within the same brief sentence, the reader may infer "an unintended message" through the process of "inferential scanning;" a method of noting "semantic anomalies" which may...
4
9012
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if I had C / \ B D
32
14804
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
1
1257
by: Brian | last post by:
Hello I am trying to implement 'Search' (Basic Keyword search) functonality on a site. Home page has a search text box and a 'GO' button. When users will type in a keyword and presses 'GO', URL has to be refreshed with the 'Search Page' URL and results must be displayed. My customer does not like search terms to be passed through the URL . Is there anyway that I can accomplish this without the use of Session variables Appreciate your help...
2
2135
by: WesternCanuk | last post by:
Hello all. i'm new to mysql and a but of advice would be fantastic. I"m building a PHP website where i'm have problems getting my search query to work. I have built the search using AND and OR but this process is very limited. Here is the background. The user will be passing 4 variables from one page to another. buildingname buildingblock projectnumber date Table to search in is called paintinfo, and has 17 diff fields within it. ...
0
1459
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I've migrated from Win 2003 server to Win 2008 server. I've been banging my head agaist a wall for several days now trying to figure this out. I have the following script that will search the file system and return file names of all files within a folder and subfolders that meet the search criteria of DateLastModified. To test the output, you can use the following link:
18
2397
by: luke noob | last post by:
can some one please help me adapt my script so that i can search for multiple words within my database, my keywords feild looks something like this.... Big Teddie Bear Collection Tiny Small Soft At the moment if i search for the word "teddie" i will get "teddie" and if i search for "teddie bear" i will get "teddie bear", because in the keywords feild in the database "teddie" and "bear" are next to each other. but if i search for...
0
7962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8380
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8024
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3880
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.