From: Robert Klemme Date: 2009-03-26T23:33:14+09:00 Subject: Re: passing parameter 2009/3/26 Arun Kumar : > Robert Klemme wrote: >> Where is "xml in an array"?  The variable "xml" references an Array >> because you use String#scan (see above). You can simply iterate that >> Array as any other Array, too.  Where is the problem? > > The problem is that i need to parse the xml from the feeds url and the > code for it is written in another class. So I need to pass the feed url > ie.'xml'. Since it is written inside an iterator ie. in between each > do|content|, i cannot pass it as a prameter to the other class since xml > variable will not be accessible after the iterator ends. Please help me. I don't see how the fact that variable "xml" goes out of scope at some point in time prevents using in a different class or method. You simply have to pass it on at the time when it is _in_ scope. Frankly, I get the impression that you lack some basic understanding of how Ruby works, especially what objects and variables are. I suggest you work through some introductory material or search the archives of this group - there have been numerous discussions about call by reference etc. Regards robert -- remember.guy do |as, often| as.you_can - without end