scotb has asked for the wisdom of the Perl Monks concerning the following question:
I need to provide a search option for the user where they search for a name and it returns the address of the user they entered.
$loopIndex = 0; $input = <STDIN>; chomp($input); foreach (@a) { if($_ =~ m/<name> [A-Z]/) { print "Contact: @a[$loopIndex -1]" ; } $loopIndex++; }
I am not sure what needs to be added to this or if it is even close! appreaciate your help
EDIT: The data is being pulled from an xml file. I am searching for the name but need to read back other elements such as address from the xml.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl XML Search
by tobyink (Canon) on Jan 11, 2013 at 15:37 UTC | |
by Jim (Curate) on Jan 11, 2013 at 17:10 UTC | |
by choroba (Cardinal) on Jan 11, 2013 at 17:35 UTC | |
by topher (Scribe) on Jan 16, 2013 at 06:12 UTC | |
|
Re: Perl XML Search
by locked_user sundialsvc4 (Abbot) on Jan 11, 2013 at 22:18 UTC | |
by Jenda (Abbot) on Jan 12, 2013 at 13:16 UTC | |
|
Re: Perl XML Search
by Anonymous Monk on Jan 11, 2013 at 15:19 UTC |