On Fri, 2008-09-05 at 20:35 +0800, Jeff Pang wrote: > 2008/9/5 Mr. Shawn H. Corey <[EMAIL PROTECTED]>: > > > if( /^\s*(\d+)/ ){ > > my $id = $1; > > $longz{$id} = $_; > > I prefer the shorter one: > > $longz{$1} = $_;
I prefer defencive programming techniques. After every match, assign the capture variables to their own variables. If you just use them, they may change because of some other match hidden away in a subroutine call. It's longer but it avoids bugs. -- Just my 0.00000002 million dollars worth, Shawn "Where there's duct tape, there's hope." Cross Time Cafe "Perl is the duct tape of the Internet." Hassan Schroeder, Sun's first webmaster -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/