Hi Jan,

Thanks for your help. That's what I need. I had tried something similar
earlier using () to surround the variable rather than []. My next question
is: when I try to print a specific member of the array I get an error
message if I use 'print $result[0];' for example. In fact, any thing I try
to do to the array such as list the number of members returns an error.

Thanks,
Ben


On 4/21/04 8:02 AM, Jan Eden wrote:

> Hi Ben,
> 
> ----- Original Message -----
> From: Ben Miller
> Sent: 21.04.2004, 7:49 Uhr
> 
>> Hello,
>> 
>> This is my first post and I'm working on my first real Perl program.
>> I'm trying to feed an array using information scraped off another
>> web page. I've got the scraping working no problem, but each of the
>> words I pull from the other page are treated as part of a single
>> variable. For example:
>> 
>> while (my $tag  = $stream->get_tag("a")) { my $result =
>> ($stream->get_trimmed_text("/a")); print "$result\n";
>> }
>> 
>> 
>> The while loop pulls all text which sits between 'a' tags on the
>> page being scraped. I'd like to force $result to accept each word as
>> part of an array. Any clues?
> 
> You could assign an array reference to $result:
> 
> my $result = [($stream->get_trimmed_text("/a"))];
> 
> if get_trimmed_test() returns a list.
> 
> HTH,
> 
> Jan


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to