perl beginner

Discussion in 'Perl' started by hsvjap, Dec 12, 2008.

  1. hsvjap

    hsvjap

    Joined:
    Mar 15, 2008
    Messages:
    17
    Likes Received:
    0
    hi all,

    Iam a beginner in perl, so i need some inputs to the below mentioned .

    <page id="c_page_popup_click" visuals="visuals/popup/v_page1_popup_Primenumber.tml" dataSources3="@m_ds_designofaproject.popup_click">

    the above text is to printed again with the word "click" replaced from another word , say anything taken from a xl sheet.


    wat i did was, at all underscores i split them using $break, but many _ are there,

    i created final array inserted the replacing texts and finally printed it .

    the code is here



    #MODULE 8-SPLIT THE FORMAT INTO DIFFERENT ARRAY ELEMENTS WHENEVER _ IS ENCOUNTERED
    @part1=split("_",$break);
    print "@part1\n";


    $final[0]=$part1[0];
    $final[1]="_";
    $final[2]=$part1[1];
    $final[3]="_";
    $final[4]=$part1[2];
    $final[5]="_";
    $final[6]=$part1[3];
    $final[7]="_";
    $final[8]=$part1[4];
    $final[9]="_";
    $final[10]=$part1[5];
    $final[11]="_";
    $final[12]=$part1[6];

    $final[14]=$name;

    $last=')"/>';

    $final[15]=$last;

    #print "@final\n";


    the $ name is replacing string.



    any suggestions for improvement are appreciated.

    thanks in advance,

    hsvjap.
     
    hsvjap, Dec 12, 2008
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.