On Tue, 2009-09-01 at 23:11 -0400, Uri Guttman wrote: > >>>>> "SB" == Steve Bertrand <st...@ibctech.ca> writes: > > SB> Uri Guttman wrote: > > >> so ask your real question about string munging and not how to do a > >> particular technique. > > SB> Searching "crisler" in the archives results in four messages. I believe > SB> he was trying, and his original question was a real question. > > yes, and i was saying it is likely the wrong question. > > >> this is called the XY problem where you think you > >> want X but you really want Y. > > SB> newbs don't understand that, without simple code examples. > > and i explained it. it is when you are asking about X (thinking that a > specific way to do something) when you should be asking about Y (usually > the larger problem which has a better or proper solution). > > uri
>From a 'newbie' pov, I think it's worth trying to do both the 'Y' and 'X' components in a post. I believe it has several advantages; * Describing the underlying problem ('Y') provides potential helpers with hopefully a good understanding of what the real problem is so they can offer a better solution. * Posting code showing a (usually failed) attempt at solving the problem ('X') demonstrates that the OP has thought about the problem and tried to solve it first and isn't just rushing off to the list at the first hint of trouble. * Demonstrates (at least to some degree) the current level of understanding of the OP (both of Perl & the problem), hopefully resulting in answers that are better targeted in terms of explaining /why/ a certain approach might be good or bad. Knowing 'why' can be just as important as knowing 'how' to use a certain solution type. * Building a minimal exposition of the problem in code for the sake of posting often helps to clarify the nature of the problem. Complex code (for whatever value complex may be for a newbie) often tends to hide the nature of a problem. More than a few times I've put together such code for the purposes of posting and discovered the solution when I striped away the complexity. I've also developed quite a directory of snippets that have tested or demonstrated some function in a way that I understand. I often go back there when I'm stuck. If someone is particularly proficient in another language, expressing 'Y' may well be mentally easier in pseudo code applying the solution technique from that other language (or a 'perlish' equivalent), and end up looking like an 'X' type question by virtue of its form rather than its nature. Sometimes the OP just doesn't realise the more generic case of what they're trying to do, particularly if they're now to programming in general. If it's all new, there are no strong mental 'class' models they can call on to describe their problem. Just my $0.02 (Adjusted for inflation or deflation as per local economic conditions!) Tim Bowden -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/