Skip Menu |

This queue is for tickets about the String-PictureFormat CPAN distribution.

Report information
The Basics
Id: 111125
Status: resolved
Priority: 0/
Queue: String-PictureFormat

People
Owner: turnerjw784 [...] yahoo.com
Requestors: gsullivan [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 1.11



Subject: Patch to fix minor POD bug
The patch fixes a minor bug in the SYNOPSIS code in the POD: $s is changed to $_. Also, the line of code with "..." was deleted to allow the SYNOPSIS code to be copy-and-pasted directly. I also indented the SYNOPSIS code as a "Verbatim Paragraph" (perldoc perlpod) so that it renders better.
Subject: diff-u.txt
--- ../String-PictureFormat-1.1.orig/lib/String/PictureFormat.pm 2016-01-12 00:29:06.000000000 -0500 +++ lib/String/PictureFormat.pm 2016-01-12 10:05:41.322431000 -0500 @@ -10,48 +10,48 @@ =head1 SYNOPSIS -use String::PictureFormat; + use String::PictureFormat; -$_ = fmt('@"...-..-...."', 123456789); -print "-formatted=$_=\n"; #RETURNS "123-45-6789". + $_ = fmt('@"...-..-...."', 123456789); + print "-formatted=$_=\n"; #RETURNS "123-45-6789". -$_ = unfmt('@"...-..-...."', '123-45-6789'); -print "-unformatted=$_=\n"; #RETURNS "123456789". + $_ = unfmt('@"...-..-...."', '123-45-6789'); + print "-unformatted=$_=\n"; #RETURNS "123456789". -$_ = fmt('@$,12.2>', 123456789); -print "-formatted=$_= \n"; #RETURNS " $123,456,789.00". + $_ = fmt('@$,12.2>', 123456789); + print "-formatted=$_= \n"; #RETURNS " $123,456,789.00". -$_ = fmtsiz('@$,12.2>'); -print "-format size=$_= \n"; #RETURNS 18. + $_ = fmtsiz('@$,12.2>'); + print "-format size=$_= \n"; #RETURNS 18. -$_ = fmt('@$,12.2> CR', -123456789); -print "-formatted=$_=\n"; #RETURNS " $123,456,789.00 CR". + $_ = fmt('@$,12.2> CR', -123456789); + print "-formatted=$_=\n"; #RETURNS " $123,456,789.00 CR". -$_ = fmt('@$,12.2> CR', 123456789); -print "-formatted=$_=\n"; #RETURNS " $123,456,789.00 ". + $_ = fmt('@$,12.2> CR', 123456789); + print "-formatted=$_=\n"; #RETURNS " $123,456,789.00 ". -$_ = fmt('@$,12.2>', -123456789); -print "-formatted=$_=\n"; #RETURNS " $-123,456,789.00". + $_ = fmt('@$,12.2>', -123456789); + print "-formatted=$_=\n"; #RETURNS " $-123,456,789.00". -$_ = fmt('@-$,12.2>', -123456789); -print "-formatted=$_=\n"; #RETURNS " -$123,456,789.00". + $_ = fmt('@-$,12.2>', -123456789); + print "-formatted=$_=\n"; #RETURNS " -$123,456,789.00". -$_ = fmt('@$(,12.2>)', -123456789); -print "-formatted=$_=\n"; #RETURNS " $(123,456,789.00)". + $_ = fmt('@$(,12.2>)', -123456789); + print "-formatted=$_=\n"; #RETURNS " $(123,456,789.00)". -$_ = fmt('=16<', 'Now is the time for all good men to come to the aid of their country'); -print "-s=".join('|',@{$s})."=\n"; #RETURNS "Now is the time |for all good men |to come to the aid|of their country =". + $_ = fmt('=16<', 'Now is the time for all good men to come to the aid of their country'); + print "-s=".join('|',@{$_})."=\n"; #RETURNS "Now is the time |for all good men |to come to the aid|of their country =". -sub foo { - (my $data = shift) =~ tr/a-z/A-Z/; - return $data; -} -... -$_ = fmt('@foo()', 'Now is the time for all'); -print "-formatted=$_=\n"; #RETURNS "NOW IS THE TIME FOR ALL" + sub foo { + (my $data = shift) =~ tr/a-z/A-Z/; + return $data; + } + + $_ = fmt('@foo()', 'Now is the time for all'); + print "-formatted=$_=\n"; #RETURNS "NOW IS THE TIME FOR ALL" -$_ = fmt('@tr/aeiou/AEIOU/', 'Now is the time for all'); -print "-formatted=$_=\n"; #RETURNS "NOw Is thE tImE fOr All" + $_ = fmt('@tr/aeiou/AEIOU/', 'Now is the time for all'); + print "-formatted=$_=\n"; #RETURNS "NOw Is thE tImE fOr All" =head1 DESCRIPTION
How about this?: use String::PictureFormat; print "-formatted=".fmt('@"...-..-...."', 123456789)."=\n"; #RETURNS "123-45-6789". my @v = fmt('@"...-..-...."', 123456789); print "-formatted= string=$v[0]= length=$v[1]= justify=$v[2]=\n"; #RETURNS "123-45-6789", length=11, justify=""=. print "-unformatted=".unfmt('@"...-..-...."', '123-45-6789')."=\n"; #RETURNS "123456789". print "-formatted=".fmt('@$,12.2>', 123456789)."= \n"; #RETURNS " $123,456,789.00". print "-format size=".fmtsiz('@$,12.2>')."= \n"; #RETURNS 18. print "-formatted=".fmt('@$,12.2> CR', -123456789)."=\n"; #RETURNS " $123,456,789.00 CR". print "-formatted=".fmt('@$,12.2> CR', 123456789)."=\n"; #RETURNS " $123,456,789.00 ". @v = fmt('@$,12.2>', -123456789); print "-formatted= string=$v[0]= length=$v[1]= justify=$v[2]=\n"; #RETURNS " $-123,456,789.00", length=19, justify=">"=. print "-formatted=".fmt('@-$,12.2>', -123456789)."=\n"; #RETURNS " -$123,456,789.00". print "-formatted=".fmt('@$(,12.2>)', -123456789)."=\n"; #RETURNS " $(123,456,789.00)". $_ = fmt('=15<', 'Now is the time for all good men to come to the aid of their country'); print "-formatted=".join('|',@{$_})."=\n"; #RETURNS "Now is the time |for all good men|to come to the |aid of their |country ". sub foo { (my $data = shift) =~ tr/a-z/A-Z/; return $data; } print "-formatted=".fmt('@foo()', 'Now is the time for all')."=\n"; #RETURNS "NOW IS THE TIME FOR ALL" print "-formatted=".fmt('@tr/aeiou/AEIOU/', 'Now is the time for all')."=\n"; #RETURNS "NOw Is thE tImE fOr All" exit(0); =================================================== It would be nice to be able to run w/"-w", but I'm not sure how to avoid a lot of "Use of uninitialized value in pattern match (m//)" warnings, which are the only ones (harmless) I normally get. Regards, Jim On Tue Jan 12 10:16:41 2016, GSULLIVAN wrote: Show quoted text
> The patch fixes a minor bug in the SYNOPSIS code in the POD: $s is changed > to $_. Also, the line of code with "..." was deleted to allow the SYNOPSIS > code to be copy-and-pasted directly. I also indented the SYNOPSIS code as > a "Verbatim Paragraph" (perldoc perlpod) so that it renders better.
Subject: PictureFormat.pm

Message body is not shown because it is too large.

On Tue Jan 12 12:31:32 2016, TURNERJW wrote: Show quoted text
> How about this?: >
If you applied my patch directly to your code, then I think it is fine. If my patch is acceptable to you, then go ahead and upload a new version.
On Tue Jan 12 20:28:26 2016, GSULLIVAN wrote: Show quoted text
> On Tue Jan 12 12:31:32 2016, TURNERJW wrote:
> > How about this?: > >
> > If you applied my patch directly to your code, then I think it is > fine. If my patch is acceptable to you, then go ahead and upload a > new version.
Done as/of v1.11. Jim