Hi crazyinsomniac,
As my second language, I am sorry if my poor English mislead you to such funny exegesis of my post, and though I found some good points in it, other points were really dead wrong. Anyway, since some advises you offered seemed to me as good ones, I stand corrected and I would try to make a better move on future questions. So thanks for bring them.
Also, you wondered about my perl skills. I am aware that they are not strong -- I'm only starting with perl and no, my question wasn't a homework assignment, as I am not taking perl lessons --, but they are not so weak as to couldn't write a "Hello world" program, as you unfortunately guessed. Here is a code snippet, the one I wrote to find out how many times a letter appears in the names of the days (please read my other replies to know more about the target problem). It runs fine under MacPerl, so if you like to check it out, you may need to change it a bit (I guess only the first line).
#!perl -w
use strict;
my %semanal;
while (<DATA>) {
chomp;
foreach my $letra (split //) {
$semanal{$letra}++;
}
}
foreach my $pal (sort keys %semanal) {
print "$pal\t$semanal{$pal}\n";
}
__DATA__
lunes
martes
miercoles
jueves
viernes
sabado
domingo
output:
a 3
b 1
c 1
d 2
e 8
g 1
i 3
j 1
l 2
m 3
n 3
o 4
r 3
s 6
t 1
u 2
v 2
Thank you.
Best regards,
Richard
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.