Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Strings & Patterns

by Anonymous Monk
on Mar 16, 2013 at 02:44 UTC ( #1023802=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've got a bit of a problem. I'm designing something that pulls a webpage off the internet, searches through the source and grabs the data I want. The only problem I'm having is I don't know what I'm doing. What the goal is for this project is to be able to search through a single string that holds my webpage source, use patterns to look through the source, and for each instance of data I find I would like to put that data into an array, making sure I increment a counter along the way to keep track of the data amount. I don't need to deal with sorting the data or numbering it. All I want is to be able to search this one string and copy data from it and place it in an array. I just have no clue what I'm doing. Thanks.

Replies are listed 'Best First'.
Re: Strings & Patterns
by davido (Archbishop) on Mar 16, 2013 at 07:08 UTC

    You've got to start somewhere. "I don't know what I'm doing." is a cop out. You won't ever fix the engine if you refuse to open the hood and get your hands dirty. I'm going to try to explain why you're not getting a useful answer here, or in your StackOverflow post:

    We have no idea what your programming background is, and without more information have no idea what help you need from us. The tone of the question suggests programming is a totally new concept for you. If that's the case, you'll need to start by learning to program, and could learn programming as you learn Perl. ...or it could be that you already know how to program, and even know Perl, but are just unfamiliar with things like LWP::Simple and HTML::TokeParser::Simple, or Mojo::UserAgent with Mojo::DOM. But whatever your background, you'll have to chart a course. Here's one road map. Decide where you are on the map, and get moving. Then come back and ask us when you have something concrete to ask.

    1. Learn the basics of programming.
    2. Learn baby-Perl. -- perlintro, perlsyn, perlsub, perlretut, and Learning Perl from O'Reilly.
    3. Learn to search for and install CPAN modules.
    4. Learn how to use LWP::Simple and HTML::TokeParser::Simple, or Mojo::UserAgent and Mojo::DOM.

    The later steps will be rather trivial once you've gotten past the earlier steps, but the earlier steps might be more work than you're willing to commit to, if you just need to get the job done. If you're in that situation; just needing to get the job done without wasting time learning to be a programmer, you could hire someone who has taken the time to learn.

    However, if you're actually interested in learning to program with Perl, dig in and enjoy! But start with "Hello world!" and gain enough familiarity with the basics that you'll know what to do when you get to the stage that you find yourself reading the POD for LWP::Simple.


Re: Strings & Patterns
by Anonymous Monk on Mar 16, 2013 at 07:09 UTC

    I've got a bit of problem ... I just have no clue what I'm doing. Thanks.

    Have you read perlintro?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1023802]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-06-20 19:18 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.