Pit Capitain wrote: > Peter Bailey schrieb: >> I'm going nuts with this tiny script. >> (...) > > Peter, the problem with your script seems to be here: > >> 9 totalpages = contents.scan(/^%%Page:.*[0-9]{1,5}$/) do >> 10 end > > If you use String#scan with a block, the method returns the original > string ("contents" in this case). See > > http://www.ruby-doc.org/core/classes/String.html#M001884 > > Try to remove the "do end" part. > > Regards, > Pit Thank you very, Pit. I believe the "do end" bit was in there from a previous rendition of this attempt, but, now that you say it, yes, it does make sense that it shouldn't be there. I'll try it first thing Monday morning. Cheers ! -- Posted via http://www.ruby-forum.com/.