Need help on the following codes, i couldn't solve
alone this ones, others i could fix them, thanks for your reply...
16.pl
#!/usr/bin/perl
use strict;
use warnings;
use charnames ':short';
print "\N{greek:Delta} is an upper-case delta.\n";
#page 16
use charnames qw(cyrilic greek);
print "\N{Sigma} and \N{Sigma} are Greek sigmas.\n";
print "\N{BE} and \N{be} are Cyrilic bes.\n";
No such script: 'CYRILIC' at 16.pl line 10.
Unknown charname 'BE' at 16.pl line 12.
Unknown charname 'be' at 16.pl line 12.
Wide character in print at 16.pl line 6.
+ö is an upper-case delta.
Wide character in print at 16.pl line 11.
+ú and +ú are Greek sigmas.
Wide character in print at 16.pl line 12.
´+¢ and ´+¢ are Cyrilic bes.
17.pl
#!/usr/bin/perl
use strict;
use warnings;
use charnames ':short';
print "\N{greek:Delta} is an upper-case delta.\n";
#page 16
use charnames qw(cyrilic greek);
print "\N{Sigma} and \N{Sigma} are Greek sigmas.\n";
print "\N{BE} and \N{be} are Cyrilic bes.\n";
Character U+00C4 (-) is named LATIN CAPITAL LETTER A WITH DIAERESIS
Wide character in printf at 17.pl line 10.
Character U+0394 (+ö) is named GREEK CAPITAL LETTER DELTA
18.pl
#!/usr/bin/perl
use strict;
use warnings;
#use charnames qw(:full);
my $name;
my $code;
my chr($code);
#pagina 16
use charnames qw(:full);
$name = "Music Sharp Sign";
$code = charnames::vianame($name);
printf "%s is character U+%04X (%s)\n",
$name, $code, chr($code);
No such class chr at 18.pl line 8, near "my chr"
BEGIN not safe after errors--compilation aborted at
18.pl line 11.
19.pl
#!/usr/bin/perl
use strict;
use warnings;
my $string;
my $char;
my $seen;
%seen = ();
$string = "an apple a day";
foreach $char (slit //, $string) {
$seen{$char}++;
}
print "unique chars are: ", short(keys %seen), "\n";
#pagina 17
Global symbol "%seen" requires explicit package name at 19.pl line 9.
syntax error at 19.pl line 11, near "//,"
Global symbol "%seen" requires explicit package name at
19.pl line 12.
Global symbol "%seen" requires explicit package name at 19.pl line 14.
Execution of 19.pl aborted due to compilation errors.
20.pl
#!/usr/bin/perl
use strict;
use warnings;
my $string;
my $seen;
#pagina 18
%seen = ();
$string = "an apple a day";
while ($string =~ /(.)/g) {
$seen{$1}++;
}
#pagina 18
print "unique chars are: ", sort(keys %seen), "\n";
Global symbol "%seen" requires explicit package name at 20.pl line 9.
Global symbol "%seen" requires explicit package name at 20.pl line 12.
Global symbol "%seen" requires explicit package name at 20.pl line 15.
Execution of 20.pl aborted due to compilation errors.
Thanks people your answers made a diference.
"syntax error at 19.pl line 11, near "//,"" // is part of the program
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.