SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast JAD's Avatar
    Join Date
    Jan 2001
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  2. #2
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    My 2 Cents (or is that 2.2 Cents including GST?)

  3. #3
    SitePoint Enthusiast JAD's Avatar
    Join Date
    Jan 2001
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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! )
    My 2 Cents (or is that 2.2 Cents including GST?)

  5. #5
    SitePoint Enthusiast JAD's Avatar
    Join Date
    Jan 2001
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •