[19882] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2077 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 6 11:10:45 2001

Date: Tue, 6 Nov 2001 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1005062709-v10-i2077@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 6 Nov 2001     Volume: 10 Number: 2077

Today's topics:
        $query not working when submitting data. <scott-news@scottbell.org>
    Re: $query not working when submitting data. <newsgroup_mike@ultrafusion.co.uk>
    Re: Best language for low IQ programmers? <kav@ct.heise.de>
        can't make use of do <hkyeung9@ie.cuhk.edu.hk>
    Re: DBI  $dbh->prepare(q{SELECT .... }); question???? <s_grazzini@hotmail.com>
    Re: DBI  $dbh->prepare(q{SELECT .... }); question???? <control153@yahoo.com>
    Re: Dynamically Assigning Scalars On The Fly <newsgroup_mike@ultrafusion.co.uk>
        Help: simple perl question on Windows (Araxes Tharsis)
    Re: If statement in perl script not working! (Tad McClellan)
        Long file names and perl. <andrew_ralph@yahoo.com>
    Re: Long file names and perl. (Tad McClellan)
    Re: MySQL table detection <cpryce@pryce.net>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@augustmail.com
    Re: Problem with make while installing Perl 5.6.1 on So (Greg Rotunda)
        Problem with prototype function <ochampag@nortelnetworks.com>
    Re: Problem with prototype function (Tad McClellan)
        Profiling Perl (Dimitri)
    Re: question about perl-cgi <tony_curtis32@yahoo.com>
    Re: Serial Port control under Win32::SerialPort (David)
    Re: simple perl question on Windows <jstanley@mmm.com>
    Re: Some very basic questions <robin1@otenet.gr>
    Re: Some very basic questions <wood_bob@emc.com>
    Re: Some very basic questions (Tad McClellan)
        too late for -T? <nickmarkham@mailandnews.com>
    Re: too late for -T? <ronh@iainc.com>
    Re: too late for -T? <BROWNHIK@Syntegra.Bt.Co.Uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 6 Nov 2001 15:18:54 -0800
From: "Scott Bell" <scott-news@scottbell.org>
Subject: $query not working when submitting data.
Message-Id: <k9TF7.29055$Cl3.4358603@news6-win.server.ntlworld.com>

I have a self portscanning tool on my webpage, it asks for the start and
finish ports, to get to the page a link links to index.cgi?content=scanner,
when I do the scan I want the link to be
index.cgi?content=scannow&startport=<port>&endport=<port>. Now when I submit
the data on the form $query->param(content) doesn't have any value even
though it *does* link to that page, I know I've gotten this right as
HTTP_REFERER has ?content=scanner, currently I'm checking if
$query->param(startport) isn't blank but this totally messes up as the front
page is shown at the bottom since $query->param(content) is blank. So, whats
the right way to fix this?


--
Scott Bell
email: scott@scottbell.org
web: http://www.scottbell.org




------------------------------

Date: Tue, 06 Nov 2001 15:47:24 GMT
From: "Mike Mackay [Ultrafusion]" <newsgroup_mike@ultrafusion.co.uk>
Subject: Re: $query not working when submitting data.
Message-Id: <gCTF7.750$3N6.233094@news1.cableinet.net>

Hi,
      Try this instead : $query->param('content')
Also you should call the CGI.pm into your script at the top of the page with
this :
use CGI qw(:standard);
$query = new CGI;

HTH,
Mike Mackay




------------------------------

Date: Tue, 06 Nov 2001 16:29:14 +0100
From: "karsten v." <kav@ct.heise.de>
Subject: Re: Best language for low IQ programmers?
Message-Id: <3BE801CA.1080002@ct.heise.de>

Kenny Chaffin wrote:

> In article <1004990076967295@aol.com>, BrianMetc@aol.com says...
> 
>>I would like to get into the programing field. My problem is that I have low IQ due to
>>early childhool learning deprivation and TV overdose. Simply said I am stuped, I am 
>>pretty good amongst my friends, but not solving problems. You know what I
>>mean. Anyways, I want to go into computor programing because of money
>>issue. I now need to choose languege for programming, simple enough
>>for me.


why bother being a programmer ? you can apply as a manager ! :)

regards,

karsten



------------------------------

Date: Tue, 6 Nov 2001 23:44:11 -0800
From: "Ryan" <hkyeung9@ie.cuhk.edu.hk>
Subject: can't make use of do
Message-Id: <9s9037$79f$1@eng-ser1.erg.cuhk.edu.hk>

Hello,

I have a question of make use of do.
I have a program called find.pl which is a cgi program and it includes the
following syntax:

find.pl:
 ...
use CGI;
 ...
do "get.pl";
 ...

and
get.pl:
 ...
$page=get("http://www.abc.com/index.html");
 ....
when i type perl get.pl in linux,i can get the file index.html. However,
when i try the find.pl in browser in my apache, it can run all the script
except
do "get.pl" this sentence(i can't get any file!!!). Why? Is it we can't just
treat cgi program as normal perl program and need to do something so that we
can make use those some function in perl like "do"?

Thank you~





------------------------------

Date: Tue, 06 Nov 2001 14:06:12 GMT
From: "Steve Grazzini" <s_grazzini@hotmail.com>
Subject: Re: DBI  $dbh->prepare(q{SELECT .... }); question????
Message-Id: <o7SF7.40010$XA5.9371674@typhoon.nyc.rr.com>


"_Mario Latens" <mario.lat@libero.it> wrote in message
news:20011106.143525.1662739668.2538@localhost.localdomain...
> What does it means "q" in:
> $dbh->prepare(q{SELECT .... });
>
> I'm talking about DBI.
>
> where can I get more informations about DBI functions?
> I saw CPAN but I did not find nothing!
>
> Thank you in advance, Mario.

q{} (or q[], q##, etc) is just an alternative to '' (single quotes)
qq{} is alternative double-quotes.

$dbh->prepare( q{SELECT * FROM table WHERE field = 'something'} );

is probably avoiding the backslashes in

$dbh->prepare( 'SELECT * FROM table WHERE field = \'something\'' );

-Steve





------------------------------

Date: Tue, 06 Nov 2001 09:16:46 -0500
From: cool dude <control153@yahoo.com>
Subject: Re: DBI  $dbh->prepare(q{SELECT .... }); question????
Message-Id: <3BE7F0CE.FA9C076C@yahoo.com>

a good book is:
Programming thePerl DBI (Database Programming with Perl)
O'Reilly
ISBN: 1565926994

_Mario Latens wrote:

> What does it means "q" in:
> $dbh->prepare(q{SELECT .... });
>
> I'm talking about DBI.
>
> where can I get more informations about DBI functions?
> I saw CPAN but I did not find nothing!
>
> Thank you in advance, Mario.



------------------------------

Date: Tue, 06 Nov 2001 14:56:39 GMT
From: "Mike Mackay [Ultrafusion]" <newsgroup_mike@ultrafusion.co.uk>
Subject: Re: Dynamically Assigning Scalars On The Fly
Message-Id: <HSSF7.699$3N6.197942@news1.cableinet.net>

Yes I admit that this could pose some serious 'bugs' in the program and it
would indeed be a terrible task of debugging. I'll explain what I wanted to
do, in exact detail.

I wanted to create a small csv database solution where people could upload
there csv script and also a template file to show the output. Basically in
the template file people would have say, '<--country-->' embedded into the
html. The perl script when run, would process this template file and
substitute '<--country-->' for the correct value from the database. I wanted
this to run autonomously without the user having to modify the perl script,
in case they buggered it basically!

I got this idea from a perl script that I saw which was called : "ReadCSV".
The code in that particular script is extremely difficult to read and
understand, plus I would prefer to design this 'system' a lot more on my own
because then that way I could have a true understanding of how it all works.

Being only a beginner verging on intermediate perl programmer this is really
testing the old grey brain cells, LOL.

Regards,
Mike Mackay.




------------------------------

Date: 6 Nov 2001 07:00:09 -0800
From: pnrmaia@hotmail.com (Araxes Tharsis)
Subject: Help: simple perl question on Windows
Message-Id: <fb38b9b7.0111060700.75c29acf@posting.google.com>

Hi,
I want to run the following script on Windows 2000, receiving input
from the file employees.txt. In UNIX it is:
       MyScript.pl < employees.txt
But it is not working in Windows.
Any help appreciated.
Thanks,
Araxes


$i = 0;
while(<STDIN>)
{
  m#\w+\s+(\w+)#;
  print("$1\n");
  ++$i
}
print("$i records found.");


------------------------------

Date: Tue, 06 Nov 2001 15:06:28 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: If statement in perl script not working!
Message-Id: <slrn9ufs8e.ap2.tadmc@tadmc26.august.net>

harm.bouwman@mediasys.nl <harm.bouwman@mediasys.nl> wrote:
>
>I have made a html form which passes $FORM{'username'} and
                               ^^^^^^

Via global variables. Global variables (generally) are bad. You 
should pass arguments to the function rather than communicate 
using global variables.


>$FORM{'passoword'} trough to statement below after splitting the url. When
>both username and password are ok, the first if statement functions ok. when
>the username or password is not ok, then the second and thirth if statement
>does working.


>Does anybody now what's going wrong here!


Precedence.


>sub check_user {
>
>my $dbh = DBI->connect("DBI:mysql:${db}", "${user}", "${password}",(
                                    ^  ^   ^ ^    ^^  ^ ^        ^^ ^
                                    ^  ^   ^ ^    ^^  ^ ^        ^^ ^
>{'RaiseError' => 1}));
  ^          ^      ^
  ^          ^      ^

You have lots of unnecessary quotes and curlies there. They just
get it the way of understanding your code.

   my $dbh = DBI->connect("DBI:mysql:$db", $user, $password,
                          {RaiseError => 1});


>my $sth = $dbh->prepare("${sql}");


   my $sth = $dbh->prepare($sql);  # more unneeded clutter


>$sth->execute();
>
>while (my $field = $sth->fetchrow_hashref()) {
>
>if ($FORM{'username'} eq my $field->{'username'} && $FORM{'password'} eq my
                                                  ^^
                                                  ^^
>$field->{'password'} ) {


Those "my"s should not be there.

&& is "high precedence" so perl is parsing that as:

$FORM{username} eq ($field->{username} && $FORM{password}) eq $field->{password}
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You should either put parenthesis in to override precendence, or use
"and" (low precedence) instead of "&&".


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 6 Nov 2001 14:38:55 -0000
From: "Andy Ralph" <andrew_ralph@yahoo.com>
Subject: Long file names and perl.
Message-Id: <RBSF7.27$yw1.260@news.uk.colt.net>

Hi,

I've got a problem with a perl script on windows NT Server (using Apache and
Tomcat).  I get the following error message when attempting to call my Perl
CGI script from a form (eg, <form action = "FileUpload.cgi"......>):

    fileupload.cgi is not executable; cannot translate to a short path name.

It worked on our local server but when uploaded to another (supposedly
identical) machine, it stopped working.  I thought it may be to do with
windows NT not supporting long filenames properly but it should do!  Or
maybe the path to the perl executable is too long (#!
e:/Share/ActivePerl/bin/perl -w).

Has anyone seen the error message before or has anyone any suggestions?

Cheers,

Andy.




------------------------------

Date: Tue, 06 Nov 2001 15:22:26 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Long file names and perl.
Message-Id: <slrn9uft5h.atg.tadmc@tadmc26.august.net>

Andy Ralph <andrew_ralph@yahoo.com> wrote:
>
>I've got a problem with a perl script on windows NT Server (using Apache and
>Tomcat).  I get the following error message when attempting to call my Perl
>CGI script from a form (eg, <form action = "FileUpload.cgi"......>):
>
>    fileupload.cgi is not executable; cannot translate to a short path name.


That message does not come from perl. You do not have a Perl problem.


>It worked on our local server but when uploaded to another (supposedly
>identical) machine, it stopped working.  


So the problem is probably related to the different servers, not
related to the programming language used.


>I thought it may be to do with
>windows NT not supporting long filenames properly but it should do!  


Then why post to a Perl newsgroup rather than an NT newsgroup?


>Or
>maybe the path to the perl executable is too long (#!
>e:/Share/ActivePerl/bin/perl -w).


That would be OS-related rather than Perl-related too.


>Has anyone seen the error message before or has anyone any suggestions?


Your question is off-topic here. You will get more help in an OS
or web related newsgroup.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 06 Nov 2001 09:42:46 -0600
From: cpryce <cpryce@pryce.net>
Subject: Re: MySQL table detection
Message-Id: <B80D6115.22FC%cpryce@pryce.net>

in article 9s8972$l2g$1@wanadoo.fr, Anthony Heuveline at
Anthony.Heuveline@wanadoo.fr wrote on 11/6/01 3:08 AM:

> Does anybody know how to detect if a table exists or not in a mySQL database
> with perl?

#!/usr/local/bin/perl -w

use DBI; 

my $dbh = DBI->connect("dbi:mysql:test", "test", undef, {RaiseError=>1,
AutoCommit=>1}); 

my $table = "our query table name";

my @tables = $dbh->tables();
my %exists = map {$_=>1} @tables;

# Now you can ask ...

if ($exists{$table}) {
    # do something ...
} 

--
cp



------------------------------

Date: Tue, 06 Nov 2001 15:01:11 GMT
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.2 $)
Message-Id: <XWSF7.73476$U7.6205835@bin1.nnrp.aus1.giganews.com>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.2 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://mail.augustmail.com/~tadmc/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Please do not use the existence of these guidelines as a
       "license to flame" or other meanness. It is possible that
       a poster is not aware of the things discussed here. Let's
       give them the benefit of the doubt, and just help them learn
       how to post, rather than assume that they do know and are
       being the "bad kind" of Lazy.

    A note about technical terms used here:

       In this document, we use words like "must" and "should" in the 
       very precise sense that they're used in technical conversation 
       (such as you're likely to encounter in this newsgroup). When 
       we say that you *must* do something, we mean that if you don't
       do that something, then it's very unlikely that you're going to 
       get much benefit from using this group.  We're not trying to boss
       you around; we're just trying to convey the point without using 
       a lot of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must

    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should

    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and is expected regardless of what newsgroup
        you are visiting. Lurking means to simply monitor a newsgroup for a
        period of time until you become very familiar with local customs.
        Think of a newsgroup as foreign culture. Each newsgroup has its own
        specific customs and rituals. Get to know those customs and rituals
        well before you participate. This will help you to avoid
        embarrassing social situations. Consider yourself to be a foreigner
        at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like

    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?

    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community

    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.perl.com/CPAN-local/authors/Dean_Roehrich/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* the sections of quoted text
        that your comments apply to. Failure to do this is called "Jeopardy"
        posting because the answer comes before the question.

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://www.geocities.com/nnqweb/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid

    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset

    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan <tadmc@augustmail.com> and many others on the
    comp.lang.perl.misc newsgroup.



------------------------------

Date: 6 Nov 2001 06:12:13 -0800
From: grotunda@earthlink.net (Greg Rotunda)
Subject: Re: Problem with make while installing Perl 5.6.1 on Solaris 8
Message-Id: <28f9e19.0111060612.28836c4d@posting.google.com>

Hi,
I got the exact same thing with pretty much the same conditions... I'm
going to check with our resident guru and I'll post again...


------------------------------

Date: Tue, 6 Nov 2001 15:26:27 +0100
From: "Olivier" <ochampag@nortelnetworks.com>
Subject: Problem with prototype function
Message-Id: <9s8s0o$isd$1@bcarh8ab.ca.nortel.com>

Hi all,

I have created a package that contains communication functions ...

It has bee declared like :

### CODE BEGIN HERE ####

package Autotest;

require   Exporter;
@ISA    = qw(Exporter);
@EXPORT = qw(Connect);
@EXPORT_OK = qw();
 ..
 ..
 ..
 ..
# First function her
sub Connect() {

        my($cnxtype,$addr,$timeout,$login,$password) = @_;
        ..
       ...
}

#### END OF PACKAGE CODE HERE ####

Then i want to use the Connect function in one of my program and implement
as follow :

#### BEGIN OF PROGRAM ####
#!/usr/bin/env perl

use Expect;
use Autotest;
 ...
 ...
# -------------------------
# Connect to the Catapult
# -------------------------
# USE Connect function from the package defined below...
$catasid=Connect("CATA",$addrcata,20,$login,$password);
 ..
 ..
#### END OF PROGRAM ####
I launch the program and got the following error :

Too many arguments for Autotest::Connect at ./Init.pl line 38, near
"$addrubi)"
Execution of ./Init.pl aborted due to compilation errors.

Why ???

Thanks.
Olivier






------------------------------

Date: Tue, 06 Nov 2001 15:22:28 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Problem with prototype function
Message-Id: <slrn9uftbu.atg.tadmc@tadmc26.august.net>

Olivier <ochampag@nortelnetworks.com> wrote:

>sub Connect() {
            ^^

This says that the Connect function takes no arguments.


>        my($cnxtype,$addr,$timeout,$login,$password) = @_;


It looks like you wanted it to take 5 scalar args though.


>#### BEGIN OF PROGRAM ####
>#!/usr/bin/env perl

   use warnings;
   use strict;

[snip]

>Too many arguments for Autotest::Connect at ./Init.pl line 38, near
>"$addrubi)"
>Execution of ./Init.pl aborted due to compilation errors.
>
>Why ???


You said it takes zero args and you called it with more than
zero args.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 6 Nov 2001 07:43:20 -0800
From: mauroid@csi.forth.gr (Dimitri)
Subject: Profiling Perl
Message-Id: <a3ebf7b8.0111060743.3bca3847@posting.google.com>

Is there a way to automatically profile Perl code? I.e. to find 
out for how long the code runs inside any given subroutine etc.? 

The code is written using object-oriented Perl, but that shouldn't
make a difference.

Thanks for any help,
Dimitri


------------------------------

Date: Tue, 06 Nov 2001 08:26:28 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: question about perl-cgi
Message-Id: <87vggouga3.fsf@limey.hpcc.uh.edu>

>> On 6 Nov 2001 00:26:14 -0800,
>> weiwe1@yeah.net (hugh1) said:

> if cgi call another cgi. in perl i can use <> and
> CGI.pm's $q->param get the parameters (POST).

> but how can i transfer them to another cgi program ??

You can't.  At least it's probably better to think so.

What you do is construct the appropriate HTTP request to
the remote server where your CGI program is located.

For that, use LWP.  A cookbook provides documentation,

    perldoc lwpcook

hth
t
-- 
Oh!  I've said too much.  Smithers, use the amnesia ray.


------------------------------

Date: 6 Nov 2001 07:26:49 -0800
From: dgoldman@msn.com (David)
Subject: Re: Serial Port control under Win32::SerialPort
Message-Id: <c7681ff1.0111060726.3df0ec61@posting.google.com>

> Of course MS_RLSD_ON always returns a 128; it's a bitmask constant that you 
> just bitwise-AND with the modemlines() return value, as I showed.

I just realized what you meant by MS_RLSD_ON being a bitmask, etc. I
will attempt to use this later today. How is one supposed to know
that's what this thing is? Do you just get divine inspiration? I'm
really trying hard to learn how to learn where to get information like
this. Any suggestions. As for the API call - all I got from the
WIN32::CommPort manpage
(http://members.aol.com/Bbirthisel/CommPort.html) was this -

      # controlling outputs from the port
  $PortObj->dtr_active(T);              # sends outputs direct to
hardware
  $PortObj->rts_active(Yes);            # returns status of API call
  $PortObj->break_active(N);            # NOT state of bit

So, I'm still not sure what API this is. Any clues?

Thanks again - David


------------------------------

Date: Tue, 6 Nov 2001 09:55:14 -0600
From: <jstanley@mmm.com>
Subject: Re: simple perl question on Windows
Message-Id: <9s915f$n7v$1@magnum.mmm.com>

Do you just want to read from the file?  If so here is the code.


open (FILEHANDLE, "employees.txt");
@arrayname=<FILEHANDLE>;

then go through the array.


"Araxes Tharsis" <pnrmaia@hotmail.com> wrote in message
news:fb38b9b7.0111060700.75c29acf@posting.google.com...
> Hi,
> I want to run the following script on Windows 2000, receiving input
> from the file employees.txt. In UNIX it is:
>        MyScript.pl < employees.txt
> But it is not working in Windows.
> Any help appreciated.
> Thanks,
> Araxes
>
>
> $i = 0;
> while(<STDIN>)
> {
>   m#\w+\s+(\w+)#;
>   print("$1\n");
>   ++$i
> }
> print("$i records found.");




------------------------------

Date: Tue, 6 Nov 2001 15:37:54 -0800
From: "Dynamo" <robin1@otenet.gr>
Subject: Re: Some very basic questions
Message-Id: <9s8pcg03dt@enews4.newsguy.com>


"Tintin" <tintin@snowy.calculus> wrote in message
news:dJQF7.11$oQ5.542785@news.interact.net.au...
>
> "Dynamo" <robin1@otenet.gr> wrote in message
> news:9s8c3d013mi@enews2.newsguy.com...

[snipped chit chat]
> >  I have downloaded activestate perl for win 32 which is waiting in the
> wings
> > in my temp directory but I am frightened to install it without
> understanding
> > (in simple laymans terms) what it will do to my system and how it will
> help
> > me.
>
> There's nothing to be frightened of.  It just installs on your system very
> much like any other software (and can be removed in the same way).

Thank you. Have now taken the bold move and installed. Nothing drastic
happened.

>
> >
> > Am I correct in saying that activestate perl is an environment (similar
to
> a
> > shell) that will allow me to write commands using a simple text editor
and
> > execute them at the prompt (similar to dos batch commands.)?
>
> Easiest to think of Perl as scripting language.   You write Perl code in a
> text editor and then run your script.

>
> >
> > Since javascript and HTML can also be written in a text editor, and I
only
> > want to use perl as a tool for my website, what advantages will I gain
by
> > using perl instead of javascript or HTML.?
>
> Perl, Javascript and HTML are three different things.  Javascript is
> (mostly) a scripting language to run client side in your browser.  HTML is
> just a markup language, not a programming language.
>
> >

OK. Got that I think. If I write javascript and the client hasn't got java
script enabled then he won't be able to interpret my scripting. By the same
comparison if I write a perl script and I don't have perl installed I cannot
interpret my own scripting.

> > Do I really need activestate perl on MY machine if I am only going to
> write
> > scripts that will be executed on my ISP's machine (provided of course
that
> I
> > read all the documentation :-))
>
> You don't, but it sure makes development and debugging much, much easier.
>

A stupid question really now that I am starting to understand the basics!

[snipped]

Many thanks
Paul Robinson




------------------------------

Date: Tue, 6 Nov 2001 09:19:21 -0500
From: "Bob Wood" <wood_bob@emc.com>
Subject: Re: Some very basic questions
Message-Id: <9s8rdf$hdp8@emcnews1.lss.emc.com>

Since you have identified yourself as a newbie, and you are trying to do
things yourself to avoid security holes, you should be aware that many of
the security holes are not intentional:  they're often there because someone
writing the code didn't realize there was a security hole.  So having a
novice write the code may actually increase the risk.  You might want to
have someone more experienced look over your code to look for such holes...





------------------------------

Date: Tue, 06 Nov 2001 15:06:26 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Some very basic questions
Message-Id: <slrn9ufqti.ap2.tadmc@tadmc26.august.net>

Dynamo <robin1@otenet.gr> wrote:
>Hello,
>
>Sorry if some of these questions seem very basic but I have searched the web
>for answers and all the sites I have been to talk in technical jargon that I
>do not understand being a total newbie. My server does not support FPE and


What is FPE?


>as such I have to use scripts to do some of the more fancy stuff with my
>website. My preference would be to use pre written scripts but the write ups
>talk of many security holes in the scripts and badly written scripts. So I
>thought I would be bold and have a go at writing a script for myself.


The reason that many free programs on the web have security holes is
because the programmer was inexperienced. You have a very good
chance of simply recoding security holes  :-(


> I have downloaded activestate perl for win 32 which is waiting in the wings
>in my temp directory but I am frightened to install it without understanding
>(in simple laymans terms) what it will do to my system and how it will help
>me.


It won't hurt you. It installs pretty much like any other software.

It will help you because you will be able to debug and "try stuff"
on your local computer without even needing a connection to the internet.


>Am I correct in saying that activestate perl is an environment (similar to a
>shell) that will allow me to write commands using a simple text editor and
>execute them at the prompt (similar to dos batch commands.)?


Yes (except for the "similar to a shell" part).


>Since javascript and HTML can also be written in a text editor, and I only
>want to use perl as a tool for my website, what advantages will I gain by
>using perl instead of javascript or HTML.?


They are three different things for three different purposes.

Javascript is for client-side programming (the program runs in
a browser).

HTML is a markup language. It is not a programming language at all.

Perl is for server-side programming (the program runs on a server).

(actually Perl _can be_ for server-side programming would be more
 accurate. Many Perl programs do not run in web environment at all.
)


>Do I really need activestate perl on MY machine if I am only going to write
>scripts that will be executed on my ISP's machine (provided of course that I
>read all the documentation :-))


You don't _need_ it, but it will make your job a whole lot easier
if you can test locally before uploading to your web server.


>Are perl compilers similar to web authoring software in that you tell it
>what you want to do and it converts it to the HTML code for you, 


No. Perl is not joined at the hip with the web. In fact, Perl had
a significant following before the WWW was even _invented_. Perl
was first released in 1987.

There are modules (libraries of code) that can make outputting
HTML easier though.


>or are they
>simply script editors 


Perl is a programming language. An "editor" is a different thing entirely.

perl is a "compiler" _and_ an "interpreter" (sometimes called a
"compile and go" language).


>that tell you where your coding has gone wrong and


It will sometimes tell you where your coding has gone wrong.

If you enable warnings (use warnings;) it will find even more mistakes.

If you enable strictures (use strict;) if will find yet more mistakes.

If you enable diagnostics (use diagnostics;) then it will add more
verbose descriptions of any errors or warnings.


>debug it for you.


No, it won't debug for you.

People are still better than machines for some tasks.

Good thing, or programmers would be out of a job :-)


>Thats about it for now. If he is asking questions like this "DONT DO IT!!" I
>hear you shouting. Well I've gotta start somewhere.
                                    ^^^^^^^^^^^^^^^

You are in a classic situation where you are learning multiple
things all at once. Their interactions will make your head swim
with confusion. It is best to tackle each independently and tie
them all together when you understand each part. It sounds to me
like you are new to all of these:

   Usenet
   Unix
   Programming
   Perl
   CGI


A good approach would be to write non-web programs in Perl for
a while, until you get comfortable with programming and with Perl.

_Then_ turn your attention to programming perl than conforms to the
Common Gateway Interface.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 6 Nov 2001 10:23:51 -0500
From: "Nicholas R. Markham" <nickmarkham@mailandnews.com>
Subject: too late for -T?
Message-Id: <9s8uun$uik$1@newsfeeds.rpi.edu>

I have a Perl CGI (several, in fact) that I want to make more secure using
taint mode.  The shebang line looks like

#! /usr/bin/perl -T

But when I try to run it, perl says 'Too late for "-T" option at script.cgi
line 1.'
How can the first line of the script be too late?




------------------------------

Date: Tue, 06 Nov 2001 15:42:09 GMT
From: "Ron Hartikka" <ronh@iainc.com>
Subject: Re: too late for -T?
Message-Id: <lxTF7.2346$PM1.34166@typhoon.mw.mediaone.net>

Maybe you have -m or -M on the command line and so could have exposed your
program already?

Is it modperl?

How are you running perl?


"Nicholas R. Markham" <nickmarkham@mailandnews.com> wrote in message
news:9s8uun$uik$1@newsfeeds.rpi.edu...
> I have a Perl CGI (several, in fact) that I want to make more secure using
> taint mode.  The shebang line looks like
>
> #! /usr/bin/perl -T
>
> But when I try to run it, perl says 'Too late for "-T" option at
script.cgi
> line 1.'
> How can the first line of the script be too late?
>
>




------------------------------

Date: Tue, 6 Nov 2001 15:43:40 -0000
From: "Kevin Brownhill" <BROWNHIK@Syntegra.Bt.Co.Uk>
Subject: Re: too late for -T?
Message-Id: <9s90mk$lma$1@pheidippides.axion.bt.co.uk>

Have you got a space between !# -and- /usr/bin/perl

"Ron Hartikka" <ronh@iainc.com> wrote in message
news:lxTF7.2346$PM1.34166@typhoon.mw.mediaone.net...
> Maybe you have -m or -M on the command line and so could have exposed your
> program already?
>
> Is it modperl?
>
> How are you running perl?
>
>
> "Nicholas R. Markham" <nickmarkham@mailandnews.com> wrote in message
> news:9s8uun$uik$1@newsfeeds.rpi.edu...
> > I have a Perl CGI (several, in fact) that I want to make more secure
using
> > taint mode.  The shebang line looks like
> >
> > #! /usr/bin/perl -T
> >
> > But when I try to run it, perl says 'Too late for "-T" option at
> script.cgi
> > line 1.'
> > How can the first line of the script be too late?
> >
> >
>
>




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 2077
***************************************


home help back first fref pref prev next nref lref last post