FAQ
ask 01/09/26 03:44:41

Modified: . perlfaq5.pod
Log:
replace local $_ with my $number in one of the answers so it's "better"
"perlstyle" (for some definition of that). Discussion at perl-documentation
welcome. :-)

Revision Changes Path
1.2 +4 -4 perlfaq/perlfaq5.pod

Index: perlfaq5.pod
===================================================================
RCS file: /home/perlcvs/perlfaq/perlfaq5.pod,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- perlfaq5.pod 2001/09/20 03:03:00 1.1
+++ perlfaq5.pod 2001/09/26 10:44:41 1.2
@@ -1,6 +1,6 @@
=head1 NAME

-perlfaq5 - Files and Formats ($Revision: 1.1 $, $Date: 2001/09/20 03:03:00 $)
+perlfaq5 - Files and Formats ($Revision: 1.2 $, $Date: 2001/09/26 10:44:41 $)

=head1 DESCRIPTION

@@ -428,9 +428,9 @@
This one will do it for you:

sub commify {
- local $_ = shift;
- 1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
- return $_;
+ my $number = shift;
+ 1 while ($number =~ s/^([-+]?\d+)(\d{3})/$1,$2/);
+ return $number;
}

$n = 23659019423.2331;

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcvs-perlfaq @
categoriesperl
postedSep 26, '01 at 10:44a
activeSep 26, '01 at 10:44a
posts1
users1
websitelearn.perl.org...

1 user in discussion

Ask: 1 post

People

Translate

site design / logo © 2018 Grokbase