Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
There's more than one way to do things
 
PerlMonks  

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.

Comment on Strings & Patterns
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.


    Dave

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1023802]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-04-18 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (464 votes), past polls