repellent has asked for the wisdom of the Perl Monks concerning the following question:
I have Perl code that would filter that file to look like:key1 "value1" key2 "value2" key3 "value3"
Would it be possible to create a subroutine such that I can call from another Perl script:$data_ref = { key1 => "value1", key2 => "value2", key3 => "value3", };
Considerations:my $data_ref = MyModule::filter_and_return_ref('datainput.txt');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code
by kyle (Abbot) on Aug 05, 2008 at 20:25 UTC | |
|
Re: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code
by massa (Hermit) on Aug 05, 2008 at 20:25 UTC | |
|
Re: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code
by Tanktalus (Canon) on Aug 05, 2008 at 22:24 UTC | |
by repellent (Priest) on Aug 05, 2008 at 23:45 UTC | |
|
Re: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code
by repellent (Priest) on Aug 05, 2008 at 20:37 UTC | |
by Fletch (Bishop) on Aug 05, 2008 at 21:20 UTC | |
by repellent (Priest) on Aug 05, 2008 at 21:44 UTC |