Can someone please explain the difference between parse and split?
| SitePoint Sponsor |
Can someone please explain the difference between parse and split?
Nothing is foolproof for a sufficently talented fool.
Seemingly stupid questions require the most intellegent answers.





Depending on the language you're talking about.... Generally speaking, parse means to interpret the language. Really it just means a compiler or program of some sort 'interpreting' or 'speaking' the language to do something.
Split means to split code or characters down.... But then the options for split are infinite![]()
The language is Perl.
But now I am more confused.
If I understand you right Parse means to compile or put together what has been programed so the computer can understand it.
While split means to seperate chains into words, characters etc.
Am I making sense?
Nothing is foolproof for a sufficently talented fool.
Seemingly stupid questions require the most intellegent answers.





That is correct.
Other Perl gurus on this forum will be able to elaborate on precisely what split does in Perl (since I'm not a Perl guru!)
Thanks for the help.
I am starting to get a handle on Perl.
I would like to have a more "elaborate" explaination of what split is used for.
Nothing is foolproof for a sufficently talented fool.
Seemingly stupid questions require the most intellegent answers.





As I'm doing a CS assignment (writing a compiler), parsing is the process of building the parse tree based on tokens. This might not make any sense to you, but that is one process of compiling a program (bring from high level lang. to lower one)
As for split in Perl, it's the opposite of join, splitting a string into a list based on some pattern
Eg: split(",","a,b,c,d"); => "a","b","c","d"
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
Bookmarks