in reply to Using Config::IniFiles Module Obtain Comma Separated Values into An Array

I'm going to wager a guess that your instructor worded the problem the way s/he did so that you develop your own version of split using the functions index and substr.

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

Replies are listed 'Best First'.
Re^2: Using Config::IniFiles Module Obtain Comma Separated Values into An Array
by perlPsycho (Initiate) on May 27, 2016 at 13:07 UTC
    No its Pretty Simple.
    Here's the link.

    Thanks Everyone for Discussing this topic Today:

    I hope some one finds it useful when they are stuck in the future.

    Link: EOT_STYLES
    Simple Config File Modification:

    # # # # # # [hello] # # # # i=abc i=def i=ghi i=jkl i=mno # j=<<EOT abc def ghi jkl mno pqrs tuv wxyz EOT # # #


    Unlike a few guys here
    I provide snippets of Real time Examples:
    Snippet Code :
    #! /usr/bin/perl use warnings; use strict; use Getopt::Long; use Config::IniFiles; # SAMPLE : SET CONFIGURATION SAMPLE FILE TO READ. my ($sample,%ini,$cfg,%input_config_citi); GetOptions('config=s'=>\$sample,-nomultiline => 0); # TIE : OBTAIN THE CONFIG FILES CONTETNS $cfg= Config::IniFiles->new(-file=>$sample); my @arr=$cfg->val('hello','i'); my @arr=$cfg->val('hello','j'); print "\n\nThe values are : "; print "$_\n",for(@arr);

      That is not a solution to the problem as you previously stated it:

      But there is some other Way to populate an array by using space,comma(s),dot(s) by default.

      like ...

      j=abc def ghi jkl mno pqrs tuv wxyz<br> j=abc,def,ghi,jkl,mno,pqrs,tuv,wxyz<br> j=abc.def.ghi.jkl.mno.pqrs.tuv.wxyz<br>

      I need this way of Obtaining he values in an array.

      And here:

      I cant get the space separated value. I need a way to get the j= abc def ghi jkl mno pqrs tuv wxyz in a single line of code using a method of Config::IniFiles.

      Changing the requirements (by changing the input) is unfair to those trying to help.

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