develooper Front page | perl.perl5.porters | Postings from March 2008

[PATCH] Double warning with perl -we 'my $a; substr $a, 0, 10, "foo"'

Thread Next
From:
Vincent Pit
Date:
March 22, 2008 05:05
Subject:
[PATCH] Double warning with perl -we 'my $a; substr $a, 0, 10, "foo"'
Message ID:
47E4F5E7.4050901@profvince.com
substr gives two undefined warnings when the string is undef and the 
offset is 0 (in which case the undef string is grown and filled with the 
replacement). The attached patch fixes this by manually initializing the 
string to "" before inserting. Tested OK against 33547.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About