Re: formatting the loop

2004-02-12 Thread James Edward Gray II
On Feb 12, 2004, at 10:06 AM, Michael S. Robeson II wrote: On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: [snip] my @char = ( /[a-z]/ig, ( '-' ) x $len )[ 0 .. $len - 1 ]; If I may, yuck! This builds up a list of all the A-Za-z characters in the string, adds a boat load of extra

Re: formatting the loop

2004-02-12 Thread Michael S. Robeson II
On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: [snip] my @char = ( /[a-z]/ig, ( '-' ) x $len )[ 0 .. $len - 1 ]; If I may, yuck! This builds up a list of all the A-Za-z characters in the string, adds a boat load of extra - characters, trims the whole list to the length you want

Re: formatting the loop

2004-02-11 Thread James Edward Gray II
On Feb 11, 2004, at 2:35 PM, Michael S. Robeson II wrote: next unless s/^\s*(\S+)//; my $name = $1; Well, if we're reading name to name, the thing right a the beginning of our sequence is going to be a name, right? The above removes the name, and saves it for later use. OK, I think this

Re: formatting the loop

2004-02-11 Thread Michael S. Robeson II
See comments below. On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote: On Feb 11, 2004, at 1:27 PM, Michael S. Robeson II wrote: [snip] Anyway, though it works great I am having a tough time trying to figure out WHY it works. See comments below, in the code. [snip] I think if I can und

Re: formatting the loop

2004-02-11 Thread Rob Dixon
James Edward Gray II wrote: > > > $/ = '>'; # Set input operator > > Here's most of the magic. Exactly. If you don't believe in magic, don't write in Perl: most people don't. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: formatting the loop

2004-02-11 Thread James Edward Gray II
On Feb 11, 2004, at 1:27 PM, Michael S. Robeson II wrote: [snip] Anyway, though it works great I am having a tough time trying to figure out WHY it works. See comments below, in the code. [snip] I think if I can understand the mechanics behind this script it will only help me my future unders