>>>>> "jbarry" == jbarry  <[EMAIL PROTECTED]> writes:

jbarry>         /(.*?),/; #pattern matching. Grabs everything up to the first comma.
jbarry> (The material number)
jbarry>         $key = $1;

All other comments included, the one thing that hasn't been pointed
out is that this is dangerous.

NEVER use $1 unless it's in the context of a conditional based on the
pattern match.  If the match fails (perhaps unexpectedly), you'll
be getting the *previous* $1, and that will certainly not be what
you had expected.

jbarry>         /.*?,(.*)/;
jbarry>         #print 'First:'. $1."\n";       # sanity check 1

Ditto here.

-- 
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!

Reply via email to