We don't bite newbies here... much | |
PerlMonks |
help with perl understandingby barryscott (Acolyte) |
on Jan 08, 2008 at 09:19 UTC ( [id://661036]=perlquestion: print w/replies, xml ) | Need Help?? |
barryscott has asked for the wisdom of the Perl Monks concerning the following question:
Good morning Monks.
I'm struggling to extract functions from c code,
and was very kindly helped out by the forum with the following code snippet, which (with my limited but fast growing knowledge of perl) looks like the kind of thing I'm after... but I have some questions to understand it fully. Firstly - is $prev a special variable? How does perl know to use the line previous? Is something clever happening on the regex that I can't identify? Next, do I require a file to be looked at line by line, or "slurped" in? Can someone very quickly let me know, and the advantages of each? Help is *much* appreciated, I'm trying to design some tools for analysing my source code and learning perl at the same time. ---EDIT--- I've had some coffee, steamed open my eyes and sat down with a manual. I can now see how it works - sorry to bother ;oD This language really is amazing you know, so versatile, but if you don't fully understand some subtle features it can be very difficult to read. I'm an embedded c programmer by trade, so this high level work amazes me.
Back to
Seekers of Perl Wisdom
|
|