in reply to Re: Reading line and Spliting it
in thread Reading line and Spliting it

without those modules how to read column names only from a comma separated file

Id,Name,Sex,RegDate,LeaveDate,Time,Dummy

i need to read it but print/write like this

Id,Name,Sex,RegDate,LeaveDate,Time

Replies are listed 'Best First'.
Re^3: Reading line and Spliting it
by Corion (Patriarch) on Jul 17, 2014 at 07:23 UTC

    So, where is your problem exactly? What is the code you have? What does your code output when run? What should it output instead?

      His username probably says it all.

      my problem is to delete the dummy column but the number of columns may differ dynamically as i have to read different files

      i use Tie::Array module to write into file. before writing i need to delete that dummy column which i read from another file. i have placed the code above in question itself !

      i need those column values to be separate values in an array. so that i can print the columns without dummy column

        Now is a good time to learn about pop, splice and other array manipulation functions available to you in Perl.

Re^3: Reading line and Spliting it
by jellisii2 (Hermit) on Jul 17, 2014 at 12:52 UTC
    Just doing a split like this will lead to insanity at some point, unless you can completely insure your data NEVER has commas, or has COMPLETELY PREDICTABLE commas in it. The modules help cope with encapsulated data (When dumping to CSV, Excel will often encapsulate data with a comma in double quotes) and other potential stupidity so you don't $self->shoot('foot'). They aren't perfect, but they're a vast improvement over blindly splitting on an arbitrary delimiter for real world data.