in reply to Cultural and Bibliometric Perl
You can leave the newlines intact, they will be catched with '\s'. Even better, tr will take care of that.{ local $/ = undef; $contenido = <LIBRO>; }
$contenido = uc $contenido; $contenido =~ tr/A-Z/ /cs;
Well, you see how the use of $_ simplifies things..#.... my $contenido; { local $/ = undef; $contenido = <LIBRO>; } $contenido = uc $contenido; $contenido =~ tr/A-Z/ /cs; my %PF; $PF{$_}++ for( split /\s+/, $contenido); open LIBROUT, ">$ar.csv"; my $npalabras = keys %PF; while( keys %PF ){ print LIBROUT join ';', $_, my $f=$PF{$_}, $f/ $npalabras; print LIBROUT "\n"; }
Hope this helps,
Jeroen
"We are not alone"(FZ)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Cultural and Bibliometric Perl
by Ignatius Monk (Novice) on Jun 29, 2001 at 15:53 UTC |