R
Roger
Here's the code, a comment at the end about what I'm trying to do.
@list = ("w","d","e","e","d","r","f","e","d",
"c","v","g","h","t","y","h","g","t","h","y","D","P");
while( @list ) # just debugging here
{
@end = @list[16..19];
splice (@list,16,17, "Z", "X"); # after this 18..21 are undef
splice(@list ,18,1, @end);
($Fld1) = "|" . join "|", @list ;
($Fld1) .= "|";
print $Fld1;
}
#The basic idea here is to take a list, remove some values in the middle
#and replace them with some other values, and then make the entire record
#pipe delimited, beginning to end.
#It might be a hash would be a better choice, but my 'expertise' does
#not yet reach to that data type
#I have accomplished the tasks mentioned but it's real, real ugly, I know.
#Obviously I'm very new to Perl, thanks for any help.
@list = ("w","d","e","e","d","r","f","e","d",
"c","v","g","h","t","y","h","g","t","h","y","D","P");
while( @list ) # just debugging here
{
@end = @list[16..19];
splice (@list,16,17, "Z", "X"); # after this 18..21 are undef
splice(@list ,18,1, @end);
($Fld1) = "|" . join "|", @list ;
($Fld1) .= "|";
print $Fld1;
}
#The basic idea here is to take a list, remove some values in the middle
#and replace them with some other values, and then make the entire record
#pipe delimited, beginning to end.
#It might be a hash would be a better choice, but my 'expertise' does
#not yet reach to that data type
#I have accomplished the tasks mentioned but it's real, real ugly, I know.
#Obviously I'm very new to Perl, thanks for any help.