Hi whats the easiest way to read data from a feed file?
sample data in a file called data.txt:
name = varun
ip = '23.43.123.2'
address = "asd, blah blah blah ..... @#!$%$#%"
i want to use this data in a perl script.
I thought of initially reading it line by line n then cutting fields out but that didn't seem to work well with the single quotes and all....
isn't there any way to read the entire file in one shot rather than record wise.... it's a little confusing... could u plzzzzzzzzzzzzzzz show me an example... thanx....
after opening it up like this, i count the number of lines in the array and then run two loops to pick out one line(record) at a time....
ALL I WANTED to know was if there was another way to use the data dumper which would help me pick up data in a better way
Sorry, just making sure you're not a student trying to cheat.
Data::Dumper isn't doing the magic in my code, it just dumps a data structure (hence the name). The magic is happening in the map "loop", and it's acting on a whole file handle (it's basically a glorified foreach, but more powerful).
Huh? Is it just me, or does this seem unnecessarily complicated?