[ic] Search within embedded perl

Ed LaFrance (New Media E.M.S.) ic_users at newmediaems.com
Thu Jul 8 17:47:33 EDT 2004


At 11:54 AM 7/8/2004, you wrote:


> >>In reading through the manual I find reference to using, or not using as
> >>the case may
> >>be, the loop tag within embedded perl.
> >>
> >>It states:
> >
> >>NOTE: This would not usually be used with embedded Perl -- a better
> >>choice would normally be:
> >>
> >>for(@list) { CODE }
> >>
> >>
> >>But suppose I wanted to replicate the following within embedded perl:
> >>
> >>[loop search="
> >>fi=state.txt
> >>sf=country
> >>se=[default country US]
> >>rf=state,name,country
> >>un=yes
> >>tf=sorder,name
> >>ml=100
> >>"
> >>option=state]
> >>
> >>How would this be structured or how would I call the search without the
> >>loop tag?
>
> >At 08:35 AM 7/2/2004, Ed wrote:
> >
> >The $DbSearch Perl object would allow you to do this - see the Template
> >Docs:5.2 for more info.
>
>The example shown is for a DB, it doesn't really give a clue as to how to 
>search foo.txt
>If I add
>   mv_searchfile => 'foo.txt'
>an error shows up in the error.log that states:
>search error: search file 'foo' is not a valid database reference.
>
>I tried to take a different angle and use the query tag which also states 
>that it can be
>used with text files, yet there is no documentation on how to do this either.
>
>Does anybody have either of these functions working on a text file?
>Anybody.....anybody....

I would think that $DbSearch would work if you added:

         mv_searchtype   => 'text',

- Ed




===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          Ed.LaFrance at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list