On Sun, 17 Aug 2003 11:52:35 +0200, Eelco Alosery wrote: >I want to read multiple cookies, there names al start whith PLUG but al >whit a diverent number like PLUG10 and PLUG14 and zo on. >These cookies al contain data in the same format like >name|price|amount|number| > >Now I want to read these cookies and display them in a html page >generated bij perl. > >I know how to read 1 cookie but the number of the cookie is never the >same, zo i must read all the cookies starting whit PLUG and remember >the number after the name for later deletings or changing of a cookie.
Server side? I hope so... Well you start by using CGI::Cookie, which is whgat cGI.pm uses itself. There in the "synopsis" in the docs you can see: # fetch existing cookies %cookies = fetch CGI::Cookie; So it's easy enough: @plug =grep /^PLUG\d+$/, keys %cookies; gives you the list of all existing cookies of the required format. The values in the hash are the actual cookie objects. BTW don't overdo it. People generally don't like it if a site stores more than 2 or 3 cookies on your browser. Use another mechanism, thus session-management, if you want to store a lot of data. See for example CGI::kSession for a small and simple module. -- Bart.