I have the following line of code:

        $MyPrtLine = join( ",", (split (/ *\t */, 
$_))[9,10,11,15,25,28,31,32,34] );

        Is there a way to build splice portion: [9,10,11,15,25,28,31,32,34] so 
I could place as a variable either like:

        $MyPrtLine = join( ",", (split (/ *\t */, $_))[${MySplic}] );     
        or
        $MyPrtLine = join( ",", (split (/ *\t */, $_))${MySplice} );

        Both generate errors and what I am after is the ability to make an 
external value which I have as part of an ini file which I read in. I then 
generate the splice and no code changes.

        I am taking a large line ( 50+ fields ) and cutting down to what 
another user actually needs.

        Any way to accomplish?

      Thanks.


Wags ;)

        ps here is code that works with the first line(ie static splice). You 
should be able to cut and paste unless your mailer changes tabs to spaces. I 
ran it and it worked on xp, as 810 - 5.8.4.


#!perl

use strict;
use warnings;

while ( <DATA> ) {
    chomp;
    printf "%s\n",
                                join( ",", (split (/ *\t */, 
$_))[9,10,11,15,25,28,31,32,34] );
 }
 
__DATA__
VPkr    dx       6694           V       3       E       o       vHbUNJq         
        -75581.96       jZJy    Z       13421216        sNvpbcSzF SVkecw 
djNTwqWj       161123155       H6      r                                        
       79416787        ULR ebJnUiTnYgP                                          
                       31638847        vbusYccDz FPEsDy srjiHhzs       fcP      
               *MQ FskP        cytKrr KAy soVdG                                 
                                       6752-17-39      AFn                     
eZ      yvgu    +78789   381595527
vnfi    FC       7617   3455    Q       5       C       P       pVQSdHYUuN      
        +97317.36       cUds    f       94779484        HIZXT tAGRyJwiZokJfo    
        779586649       X6      M                                               
59613139        vWuQf fjykoJF                                                   
                57762176        IwjeG CSMeynturIUEzk            BvJ             
        *oi gCtr        GxqzZg REI ZILUr                                        
                                1916-88-42      Rwo                     TA      
jhWg    +47967   793474171
Tnkp    ZE       4697           r       4       j       y       IKGbYuA         
        +28363.78       BhfJ    s       39813118        CMEBGxJuZ ExCUxUn- krzx 
MfsbDp  616926757       u8      f                                               
59891125        nGFe iVWItm vBXF DtbnH                                          
                51759434        WuzSdMPRk zkjFKrZ- sgeH WuQGnE  epp             
        *em oXVU        cNCJfh seu xbIxH                                        
                                6374-73-93      Tzm                     VZ      
DbBk    +83234   666885577



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to