#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    pa, usa
    Posts
    8
    Rep Power
    0
    if i wanted to search through a string with the input of the user, how would i do that?

    i.e.
    user input for search: a
    subjects:
    alberto
    randels
    zardoz
    printer

    the search would return alberto, randels, & zardoz all because they contain the letter a, but not printer because it doesn't.

    how would i do this?

    thanks alot


    ------------------
    rrandels.
  2. #2
  3. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    #!/usr/local/bin/perl

    print "Enter somethingn";
    chomp($input = <STDIN> );

    if ($input =~ /a/){
    print "has an 'a'";
    }
    else{
    print "no 'a' here";
    }

IMN logo majestic logo threadwatch logo seochat tools logo