in reply to Re^3: Using Config::IniFiles Module Obtain Comma Separated Values into An Array
in thread Using Config::IniFiles Module Obtain Comma Separated Values into An Array

Okay How do I do that...??

Please share a sample or snippet code if possible.

Even a link would suffice..

  • Comment on Re^4: Using Config::IniFiles Module Obtain Comma Separated Values into An Array

Replies are listed 'Best First'.
Re^5: Using Config::IniFiles Module Obtain Comma Separated Values into An Array
by Corion (Patriarch) on May 27, 2016 at 08:17 UTC

    You have already been shown the link to split. The next step is to apply that function to your code.

    Please note that this is not a script writing service. Your constant asking for "sample or snippet of code" feels to me as if you are unable or unwilling to write any code yourself. This is not what this site is for.

    This site is for and by programmers or people learning how to program, with the central focus on Perl.

    Your problem would be easily solved by writing one additional line of Perl code. You have stated that this is impossible for you, but have not stated at all why this would be impossible for you.

    If your requirements prohibit you from actually programming, this site is not for you.

Re^5: Using Config::IniFiles Module Obtain Comma Separated Values into An Array
by Anonymous Monk on May 27, 2016 at 09:03 UTC
    hehe, what corion said :)
    package MyConfini; use parent qw/ Config::IniFiles /; sub MyConfini::arrayValBySpace { my( $self, @rest ) = @_; my @vals = $self->val( @rest ); if( @vals == 1 ){ @vals = split ' ', $vals[0]; } return vals; }
      Thank you for your time,

      I cannot do this.
      I cannot use split or regex or anything other than the module's inbuilt function as i mentioned on the top of the Link's description.

      I am really close to the solution.

      I just need to make a modification on my config file.

      Thank you for going through the trouble of coding it here.

      Appreciate it a lot.
        I cannot use split or regex or anything other than the module's inbuilt function as i mentioned on the top of the Link's description.

        That is clearly in contradiction to the code which you posted in the root of this thread:

        tie %ini,'Config::IniFiles', (-file=>$sample); #... print "$_\n",for(@arr);

        Here you have used tie, print and for, none of which are the module's inbuilt functions. You have failed to meet your own arbitrary restrictions. Game over, player 1.

        A reply falls below the community's threshold of quality. You may see it by logging in.