>>>>> "Michael" == Michael Kelly <[EMAIL PROTECTED]> writes:

Michael> Well, all I know is that, in my experience, joining things
Michael> with an empty regex can introduce extra characters. For
Michael> instance:

Michael>     @array = qw(a apple b banana);

Michael>     $scalar = join(//,@array);

Uh, the first parameter to join is *never* a regex.  What difference
could it ever possibly make to make it a regex?

perldoc -f join

    join EXPR,LIST
            Joins the separate strings of LIST into a single string with
            fields separated by the value of EXPR, and returns that new
            string. Example:

                $rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell);

            See the split entry elsewhere in this document.

Michael> From that, $scalar is assigned to 'a1apple1b1banana', not
Michael> 'aapplebbanana' The way I get around this is to replace //
Michael> with "". (i.e. join("",@array);)

That's not "getting around it".  THat's "using it as it was intended".

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to