Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: mail question and book

by Laurent_R (Parson)
on May 05, 2013 at 22:08 UTC ( #1032153=note: print w/ replies, xml ) Need Help??


in reply to mail question and book

You must have been very unlucky. There may be some bugs in some of the programs, of course, but I am pretty sure that they are quite uncommon, actually very rare. I have been using both the first and the second editions of this book in the past, there may be outdated features, but I haven't seen any real bug that I can remember of. It is definitely a book that I would warmly recommend. Perhaps the problem is that the code snippets presented in this book are rarely complete programs, or perhaps you overlooked something and mistyped the example. Or perhaps you are using a completely different version of Perl. Or maybe platform-dependent features.

I would add that Tom C. and Nat T. are very well know Perl authors, with an excellent reputation, and I firmly believe that they are doing they work very seriously. They also state the following in their preface: "We tested most programs and examples under BSD, Linux, and SunOS, but that doesn't mean they'll work only on those systems. Perl was designed for platform independence. " In addition O'Reilly's editors are also known to do their work very seriously. To me, O'Reilly is one of the best publishers in the field of IT.

OK, this response can only be very general. I would suggest that you post the programs that have bugs in your eyes (also explaining where the bug is in your mind), so that we can make a judgment on these bugs and provide a more specific answer.


Comment on Re: mail question and book
Re^2: mail question and book
by Raymond (Novice) on May 05, 2013 at 22:23 UTC
    Iam going to buy the book Perl Cookbook on amazon, because i live in Lisboa, so ti buy it i have to use amazon.com, there are no copies of the Perl Cookbook in Lisboa, i checked. I wanted a opinion, the only thing know is to wait to pay day in the end of the moth, normal pay day in Portugal.

      All right, but it would still be of interest for everyone, and especially for you, if you posted the programs that you think are wrong or bugged (which they may be, I certainly don't rule that out).

        #!/usr/bin/perl use strict; use warnings; print "How old are you?"; $age = <>; print "What is your favorite color?"; $color = <>; print "You are $age, and your favorite color is $color.";
        Global Symbol "$age" requires explicit package name at agecolor.pl lin +e 5 Global Symbol "$color" requires explicit package name at agecolor.pl l +ine 7 Global Symbol "$age" requires explicit package name at agecolor.pl lin +e 8 Global Symbol "$color" requires explicit package name at agecolor.pl l +ine 8 Execution of agecolor.pl aborted due to compilation errors.
        #!/usr/bin/perl use strict; use warnings; print "What is the radius of the circle?"; chomp ($r = <>); $diameter = (2 * $r); $area = (3.14 * ($r ** 2)); $cir = ($diameter * 3.14); print "Radius: $r\n Diameter: $diameter\n Circumference: $cir\n Area: +$area";
        Global symbol "$r" requires explicit package name at diameter.pl line +5. Global symbol "$diameter" requires explicit package name at diameter.p +l line 6. Global symbol "$r" requires explicit package name at diameter.pl line +6. Global symbol "$area" requires explicit package name at diameter.pl li +ne 7. Global symbol "$r" requires explicit package name at diameter.pl line +7. Global symbol "$cir" requires explicit package name at diameter.pl lin +e 8. Global symbol "$diameter" requires explicit package name at diameter.p +l line 8. Global symbol "$r" requires explicit package name at diameter.pl line +9. Global symbol "$diameter" requires explicit package name at diameter.p +l line 9. Global symbol "$cir" requires explicit package name at diameter.pl lin +e 9. Global symbol "$area" requires explicit package name at diameter.pl li +ne 9. Execution of diameter.pl aborted due to compilation errors.
        It took me 2 days to amke this topic: ______________________________

        My list from perl cookbook is named:

        1.1slowcat.pl

        1.2randcap.pl

        1.3wrapdemo.pl

        this code does not work, and i ask for help

        #!/usr/bin/perl -w use strict; use warnings; # slowcat - emulate a slow line printer # usage: slowcat [-DELAY] [files ...] $DELAY = ($ARGV[0] =~ /^-([.\d]+)/) ? (shift, $1) : 1; $| = 1; while (<>) { for (slit(//)) { print; select(undef,undef,undef, 0.005 * $DELAY); } }
        errors:
        Global symbol "$DELAY" requires explicit package name at 1.1slowcat.pl + line 6. Global symbol "$DELAY" requires explicit package name at 1.1slowcat.pl + line 11. Execution of 1.1slowcat.pl aborted due to compilation errors.
        ------------------------------
        #!/usr/bin/perl -p # randcap: filter to randomly capitalize 20% of the letters # call to srand() is unnecessary in 5.004 BEGIN { srand(time() ^ ($$ + ($$ << 15))) } sub randcase { rand(100) < 20 ? "\u$_[0]" : "\l$_[0]" } s/(\w)/randcase($1)/ge;
        % randcap < genesis | head -9
        errors:
        Semicolon seems to be missing at 1.2randcap.pl line 5. syntax error at 1.2randcap.pl line 6, near "letters # call to srand() is unnecessary in 5.004 BEGIN " syntax error at 1.2randcap.pl line 10, near ";}" Execution of 1.2randcap.pl aborted due to compilation errors.
        ------------------------------------
        #!/usr/bin/perl -w use strict; use warnings; # wrapdemo - show how Text::Wrap works @input = ("Folding and splicing is the work of an editor, ", "not a mere collection of silicon", "and", "mobile electrons!"); use Text::Wrap qw($columns &wrap); $colums = 20; print "0123456789" x 2, "\n"; print wrap(" ", " ", @input), "\n";
        errors:
        Global symbol "@input" requires explicit package name at 1.3wrapdemo.p +l line 6. BEGIN not safe after errors--compilation aborted at 1.3wrapdemo.pl lin +e 11.

        I hope it wasn't too much, but still i count with the help, of perlmonks and friends. Best Regards Ray

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-12-18 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls