I isolated the problem from my previous post to this behavior, which I think is a bit problematic -- i.e. split is doing more than is should, IMO. Off hand, not seeing the forest for the trees, I'm not sure how to get split to leave the strings alone and not treat them as numbers.
The following demonstrates the problem:
n> perl -E 'use P;
my $fmt="prod\t006\t2.13\tx86_64\trpm";P $fmt;
my $str=P $fmt;P "str=\"$str\"";
my @flds=split /\t/,"$str";
foreach (@flds) {
Pe "%s \x83", "$_";
} P " ";
'
prod 006 2.13 x86_64 rpm
str="prod 006 2.13 x86_64 rpm"
prod 6 2.13 x86_64 rpm
If I put the params in an array, the 006 collapses right off the bat:
perl -E 'use P;
my $fmt=["%s\t%s\t%s\t%s\trpm","prod", "006", "2.13", "x86_64", "rpm"]
+;
P "%s", $fmt; # already converted
'
["%s %s %s %s rpm","prod",6,2.13,"x86_64","rpm"]
Using qw the tabs don't expand (so the split doesn't work anyway), but the 6 still collapses:
> perl -E 'use P;
my $fmt=[qw(%s\t%s\t%s\t%s\t%s prod 006 2.13 x86_64 rpm)];
P "%s", $fmt; # already converted before fmt
my $str=P @$fmt;
P "str=\"$str\"";
my @flds=split "\t","$str";
Pe "(%s) \x83", "$_" foreach @flds;
P " ";'
["%s\t%s\t%s\t%s\t%s","prod",6,2.13,"x86_64","rpm"]
str="prod\t6\t2.13\tx86_64\trpm"
(prod\t6\t2.13\tx86_64\trpm)
Quirky combo to hack it:
> perl -E 'use P;
my $fmt=["%s\t%s\t%s\t%s\t%s", qw( prod "006" "2.13" x86_64 rpm)];
P "%s", $fmt; # already converted before fmt
my $str=P @$fmt;
P "str=\"$str\"";
my @flds=split "\t","$str";
Pe "(%s) \x83", "$_" foreach @flds;
P " ";'
["%s %s %s %s %s","prod",""006"",""2.13"","x86_64","
+rpm"]
str="prod "006" "2.13" x86_64 rpm"
(prod) ("006") ("2.13") (x86_64) (rpm)
But running that in the prog I ended up with:
Recycling 1 duplicates...(cannot stat, already deleted?) path=/Share/s
+use/distribution/12.1/repo/oss/suse/test2/smugbatch-"006"-"2.1.3".x86
+_64.rpm, dev=(undef)
!!!!
Guess I'll keep poking at it... there's gotta be a way... but dang if this isn't harder than it should be...
p.s. maybe I'll just toss an eval on that final string and forget figuring out how to quote it...urg...