Vanquish has asked for the wisdom of the Perl Monks concerning the following question:
#Print Numbers to a file print "File name: "; my $cr_f = <STDIN> ; open (STDOUT, ">$cr_f"); # Start parsing the following HTML file $p->parse_file("outpage.html"); my $get_next_text = 0; sub start{ # Execute when start tag is encountered my ($tagname,$attr) = @_; if ($tagname eq 'td' && exists $attr->{align} && $attr->{align} eq + 'right') { $get_next_text = 1; } else { $get_next_text = 0; } } sub text { { my $text = shift; print $text if $get_next_text; } } unlink ("outpage.html");
20040722 Edit by castaway: Changed title from 'STDOUT'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Avoiding printing ^M to Avoiding printing ^M to STDOUT
by pbeckingham (Parson) on Jul 21, 2004 at 15:44 UTC | |
|
Re: Avoiding printing ^M to STDOUT
by sgifford (Prior) on Jul 21, 2004 at 19:37 UTC | |
|
Re: Avoiding printing ^M to STDOUT
by xorl (Deacon) on Jul 21, 2004 at 15:45 UTC |