On Mar 23, Bruce Ambraal said:
>Running the script produce lots of errors.
.... which you have not reproduced here.
>#!/usr/bin/perl - strict
Uh... no. That 'strict' needs to go somewhere else.
#!/usr/bin/perl -w
use strict;
>open(A_file,"<search.html>");
You've got an extra > in there.
open A_file, "< search.html" or die "can't read search.html: $!";
>my@ary = <A_file>;
>while($n < $#ary){
Since 'strict' is on, you'll need to declare $n beforehand.
my $n = 0;
And change your test to either
while ($n <= $#ary) { ... }
or
while ($n < @ary) { ... }
> chomp($ary[$n];
Missing a closing ) here.
> while($ary[$n] =~ s#.*(href = http.*)\s.*#\1#n){
You should use $1 instead of \1 in the replacement part of a substitution,
and 'n' is not a substitution modifier. What do you think /n does?
> $ary[$n] = ~s/<.*>//g;
You have a space between the = and ~. That's bad. It should be =~
instead. And <.*> will match too much, which ends up making the /g
useless.
> $ary[$n] =~ s/>.*//g;
That /g is useless.
> print $ary[$n],"\n";
> }
> $n++;
>}
Why don't you explain what you want your program to DO?
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]