Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Reaped: Simple Perl programme using

by NodeReaper (Curate)
on May 23, 2007 at 06:40 UTC ( [id://616945]=sourcecode: print w/replies, xml ) Need Help??
Category: LOOPING
Author/Contact Info Siva.P siva.p@birlasoft.com
Description: This perl programme is helpful for beginer.
This node was taken out by the NodeReaper on May 24, 2007 at 02:16 UTC
Reason: [hossman]: reap, plagerized from another site, see Re: Simple Perl programme using

You may view the original node and the consideration vote tally.

Replies are listed 'Best First'.
Re: Simple Perl programme using
by Arunbear (Prior) on May 23, 2007 at 12:44 UTC
    Apart from all the other comments, it looks like you copied the code from this tutorial. Did you read their copyright statement?

      One should probably be wary of tutorial sites which:

      • use the incorrect "PERL" rather than "Perl"
      • don't grant any reuse of their code snippets (it's not even a restrictive "you can use this as long as you credit us", it's a flat out "you can't reproduce our code" period)
      • seem to think that hashes may be made sorted (hashes (vanilla, not tied) are by definition unordered; LISTS of keys or values may be sorted . . .)
      • has an example using variable interpolation where they apparently meant to show +-as-concatenation operator (last code sample)
Re: Simple Perl programme using
by blazar (Canon) on May 23, 2007 at 08:50 UTC
    "whileL.pl" 24 lines, 404 characters

    I second cbu's comment: very unhelpful! If your example program is aimed at beginners, then even more unhelpful in spreading bad programming habits. In addition to what the other poster wrote, since we recommend people all the time not to try to reinvent the wheel risking to do so wrongly and to use CGI instead, you may want to do so. Even for such a tiny thing.

    Since your code has already been rewritten in a better way, I'll comment on the title, which is also particularly unhelpful - "Simple Perl programme using":

    • bad spelling: it's "program", not "programme";
    • not only it's not a well formed English phrase at all, but one can not even guess what it is about;
    • CGI is not mentioned at all, but it's in fact what it is about, so it supports the Perl eq CGI pov.

    As far as the first two points are concerned, I understand that English may not be your mother tongue: neither is it mine, but special care should be applied at least when composing titles, if not all the rest. As for the second, that pov is often associated with stuff that gives Perl a bad name so it is generally deprecated amongst Perl programmers: granted, it's better tolerated here than elsewhere, but it is still wrong.

      I don't disagree, but I thought I'd be pedantic...

      bad spelling: it's "program", not "programme"

      Depends which English you use :), but I concede that in the UK program is generally accepted for computing and programme is used for everything else, like TV.

      How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
      Robot Tourist, by Ten Benson

Re: Simple Perl programme using
by Tux (Canon) on May 23, 2007 at 06:57 UTC

    I would say unhelpful, as it not even uses use strict, and your html quoting style uses ' instead of ", which is wrong.

    #!/usr/bin/perl use strict; use warnings; print "content-type: text/html\n\n"; # SET UP AN HTML TABLE print qq{<table border="1">\n}; # COUNTER - COUNTS EACH ROW my $count = 1; foreach my $name (qw( Steve Bill Connor Bradley )) { print " <tr><td>", $count++, "</td>\n", " <td>$name</td>\n", " </tr>\n"; } print " </table>\n";

    Is both more consice and more perlish


    Enjoy, Have FUN! H.Merijn
          A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found