Search within a variable

Discussion in 'Perl' started by JF Potvin, Jul 17, 2003.

  1. JF Potvin

    JF Potvin Guest

    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\perl.exe

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

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

    $url = "http://www.mydomain.com";

    $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 !
     
    JF Potvin, Jul 17, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mfglinux
    Replies:
    11
    Views:
    726
    Roberto Bonvallet
    Sep 12, 2007
  2. Abby Lee
    Replies:
    5
    Views:
    443
    Abby Lee
    Aug 2, 2004
  3. Krishna Komoravolu

    newbie ?: expand variable within a variable

    Krishna Komoravolu, Oct 31, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    128
    Gunnar Hjalmarsson
    Oct 31, 2003
  4. David Filmer
    Replies:
    11
    Views:
    225
    Brad Baxter
    Dec 5, 2003
  5. David Filmer
    Replies:
    19
    Views:
    257
    Kevin Collins
    May 21, 2004
Loading...

Share This Page