Re: string and hash [quite long]



Paul Lalli wrote:

> No_name wrote:
>> Hi at hall, I am a beginner and I've got this problem: translate a
>> string, runtime generated by lsdvd program, into an hash. The string is
>> similar at this:
>> our %lsdvd = (
>> device => '/dev/dvd',
>> title => 'DVDVOLUME',
>> vmg_id => 'DVDVIDEO-VMG',
>> provider_id => '',
>> track => [
>> {
>> ix => 1,
>> length => 5309.090,
>> vts_id => 'DVDVIDEO-VTS',
>> },
> <snip>
>> ],
>> longest_track => 1,
>> );
>> There is a way?
>>
>
> You want to take a string that looks like perl code and evaluate it as
> perl code? Try:
> perldoc -f eval
>
> Paul Lalli
Yes the program can print out a string that is "perl code". I'll try eval.
Thanks
.



Relevant Pages

  • Re: Use of uninitialized value in string eq at interface_details.pl line 174.
    ... Paul Lalli wrote: ... but if i leave it blank then i get a the following warning ... Use of uninitialized value in string eq at interface_details.pl line ... simply equal to the empty string, ...
    (perl.beginners)
  • Re: Single-liner for one-line substitute?
    ... Paul Lalli wrote: ... for a global search/replace in a file. ... change only a string on the first line of a file, ... Interesting, Paul, i wasn't aware of the implicit "while". ...
    (comp.lang.perl.misc)
  • Re: split function in perl
    ... Paul Lalli wrote: ... i need to extract the first part from this string ie xxx-1-2.set ... you get syntax errors? ... Incorrect output? ...
    (perl.beginners)
  • Re: Why doesnt this work?
    ... Paul Lalli wrote: ... > exactly 2 digits, a period, and 2 digits" ... This explains why you did not get an empty string as ...
    (comp.lang.perl.misc)
  • Re: Appending variables
    ... Paul Lalli wrote: ... Then it returns the string. ... I am trying to write this foreach loop to take multiple exclude files ...
    (perl.beginners)