From thompson at cns.uni.edu Tue Nov 11 09:42:13 2003 From: thompson at cns.uni.edu (Aaron Thompson) Date: Mon Aug 2 21:27:31 2004 Subject: [Cedarvalley] rss parser. Message-ID: <20031111154213.GG17829@faculty.cns.uni.edu> Hello, I've been working on an RSS parser for a little while and was wondering if any of you have written or would suggest an RSS parser that would dump out an HTML table of variable columns? @ -- Aaron Thompson Unix Systems Administrator, College of Natural Science University of Northern Iowa Cedar Falls, IA 50614 "It is not the fall that kills you. It's the sudden stop at the end." -Douglas Adams From thompson at cns.uni.edu Thu Nov 13 23:42:16 2003 From: thompson at cns.uni.edu (Aaron Thompson) Date: Mon Aug 2 21:27:31 2004 Subject: [Cedarvalley] storing a hash in a list... Message-ID: <20031114054216.GA13234@faculty.cns.uni.edu> I am building a hash as I loop thru some data.. and would like to store that hash in another list for later use. I'm having trouble getting the hash to store properly. Any one know how to return a reference to a copy of a hash? I started with: @list = \%hashed_data but found that I got lots of references to the same data I tried: @list = \%{%hashed_data} This had the sam results. Thanks, @ -- Aaron Thompson Unix Systems Administrator, College of Natural Science University of Northern Iowa Cedar Falls, IA 50614 "The ships hung in the sky in much the same way that bricks don't." -Douglas Adams From wells at cedarnet.org Mon Nov 17 18:32:46 2003 From: wells at cedarnet.org (Stephen D. Wells) Date: Mon Aug 2 21:27:31 2004 Subject: [Cedarvalley] storing a hash in a list... In-Reply-To: <20031114054216.GA13234@faculty.cns.uni.edu> References: <20031114054216.GA13234@faculty.cns.uni.edu> Message-ID: <1069115566.30563.196.camel@localhost.localdomain> My cedarnet email was down and I don't know if a response has been generated yet however this is a detailed account of what is happening and how to avoid it: using @list = \%hashed_data stores a pointer to that data. Meaning that it's not a copy but a link. What you need is exactly what you said... a copy to a reference. The reason is that each time you go through the list you are pointing to the same data... Try this instead: push(@list, {%hashed_data}); STEVE On Thu, 2003-11-13 at 23:42, Aaron Thompson wrote: > I am building a hash as I loop thru some data.. and would like to > store that hash in another list for later use. I'm having trouble > getting the hash to store properly. Any one know how to return a > reference to a copy of a hash? > > I started with: > @list = \%hashed_data > > but found that I got lots of references to the same data > I tried: > > @list = \%{%hashed_data} > > This had the sam results. > > Thanks, > > @ -- Stephen D. Wells From wells at cedarnet.org Mon Nov 17 20:20:28 2003 From: wells at cedarnet.org (Stephen D. Wells) Date: Mon Aug 2 21:27:31 2004 Subject: [Cedarvalley] Interesting Projects? Sitebuilder Message-ID: <1069122028.30566.248.camel@localhost.localdomain> I want to know of any "interesting" projects you're working on. If you think this one is interesting, then I'll go through the process of building it out in subsequent postings and let you upload the code when it's done. If this looks like it's working out well with more participants than just me (hint hint) then it may make for interesting content to the site... thoughts? STEVE -------------------------------------------------------------------- Problem: The casino I work for would like a technique for building other casino websites quickly and easily. Each website starts with 95 pages of content which buyers of a new site are free to alter at their whim. They want to have a designer build three designs of the homepage, have the client choose a design and then have this program build the site out, package it and send it off to the client. The zipping and emailing is simple so it's the meshing of the template with the 95 pages of content that I want to describe here. Rules #1 I despise maintenance so... * New content should easily be added to the site without contacting me * New templates shouldn't need to be discussed with me * New variables should easily be inserted without my help Template -------- I opted to use an existing template system rather than re-inventing the wheel and more importantly it must have good documentation that needn't be discussed with me. There are really only two choices out there. HTML::Template and Template (template-toolkit). HTML::Template is simple to setup and use but the template toolkit is much more powerful and completely separates the processing from the output. Figuring that I'm not working with simpletons (I make that mistake a lot -- but I never learn) and that I'm always ready to follow rule #1, I opted for the template toolkit. Link Design ----------- Rather than have a complex linking system I'm just going to have the maintainers use the directory structure to help me determine linking arrangements. The filenames will then be the names of the links. Here's a quick example: base/index.tt base/signup/index.tt base/signup/signup.tt base/contact_us/index.tt base/contact_us/contact.tt base/faq/index.tt base/faq/why_is_there_air.tt base/faq/why_are_we_here.tt base/faq/what_is_that_on_my_shoe.tt using this you can see that the main navigation should point to: signup | contact us | faq and each file within a directory is the name of the link -- what could be simpler? should I continue? STEVE -- Stephen D. Wells From thompson at cns.uni.edu Tue Nov 18 09:48:21 2003 From: thompson at cns.uni.edu (Aaron Thompson) Date: Mon Aug 2 21:27:31 2004 Subject: [Cedarvalley] storing a hash in a list... In-Reply-To: <1069115566.30563.196.camel@localhost.localdomain> References: <20031114054216.GA13234@faculty.cns.uni.edu> <1069115566.30563.196.camel@localhost.localdomain> Message-ID: <20031118154821.GC26192@faculty.cns.uni.edu> Thanks Steve, I was just going to post a solution I came up with when I read this message... ... my $count = 0; for $url (@rss){ ... building %rss_data %{$web_data[$count]} = %rss_data; $count++ }#rof ... Thanks for the idea - I tried it and it works well. I like your solution better ;) I'm going to re-write my loop and get rid of the iterator. @ On Mon, Nov 17, 2003 at 06:32:46PM -0600, Stephen D. Wells wrote: > My cedarnet email was down and I don't know if a response has been > generated yet however this is a detailed account of what is happening > and how to avoid it: > > using @list = \%hashed_data stores a pointer to that data. Meaning that > it's not a copy but a link. What you need is exactly what you said... a > copy to a reference. The reason is that each time you go through the > list you are pointing to the same data... > > Try this instead: > > push(@list, {%hashed_data}); > > STEVE > > On Thu, 2003-11-13 at 23:42, Aaron Thompson wrote: > > I am building a hash as I loop thru some data.. and would like to > > store that hash in another list for later use. I'm having trouble > > getting the hash to store properly. Any one know how to return a > > reference to a copy of a hash? > > > > I started with: > > @list = \%hashed_data > > > > but found that I got lots of references to the same data > > I tried: > > > > @list = \%{%hashed_data} > > > > This had the sam results. > > > > Thanks, > > > > @ > -- > Stephen D. Wells -- Aaron Thompson Unix Systems Administrator, College of Natural Science University of Northern Iowa Cedar Falls, IA 50614 "It is not the fall that kills you. It's the sudden stop at the end." -Douglas Adams