[25569] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7813 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 22 14:05:42 2005

Date: Tue, 22 Feb 2005 11:05:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Feb 2005     Volume: 10 Number: 7813

Today's topics:
        '+<' mode for opening files <mritty@gmail.com>
        ANNOUNCE: TiVo::HME 1.2 <methan@gmail.com>
    Re: Correct way to inherit from 3rd party class (Peter Scott)
    Re: Form manipulation through mechcanize (perl) <segraves_f13@mindspring.com>
    Re: Form manipulation through mechcanize (perl) <segraves_f13@mindspring.com>
    Re: Form manipulation through mechcanize (perl) <bonjo90@yahoo.co.in>
        help about array and hash <sonet.all@msa.hinet.net>
    Re: help about array and hash <phaylon@dunkelheit.at>
    Re: help about array and hash <mritty@gmail.com>
        How to get program's memory usage? <socyl@987jk.com.invalid>
    Re: Need help with CGI/ DBI error (permissions?) <pat@patmail.com>
    Re: Need help with CGI/ DBI error (permissions?) <1usa@llenroc.ude.invalid>
    Re: Need help with CGI/ DBI error (permissions?) <pat@patmail.com>
    Re: Need help with CGI/ DBI error (permissions?) <1usa@llenroc.ude.invalid>
    Re: Need help with CGI/ DBI error (permissions?) <pat@patmail.com>
    Re: Need help with CGI/ DBI error (permissions?) <phaylon@dunkelheit.at>
    Re: perl null value ? <mritty@gmail.com>
    Re: perl null value ? <jjohnson@psg.com>
    Re: perl null value ? <mritty@gmail.com>
    Re: perl null value ? <jjohnson@psg.com>
    Re: perl null value ? <1usa@llenroc.ude.invalid>
    Re: perl null value ? <1usa@llenroc.ude.invalid>
        Regex for "search query" string nick.p.doyle@gmail.com
    Re: Regex for "search query" string <phaylon@dunkelheit.at>
    Re: Regex for "search query" string nick.p.doyle@gmail.com
        Win32:OLE How to size or resize Excel comment textfield <rodolfo.hinojosa@intel.com>
    Re: Write-Only Socket xhoster@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 22 Feb 2005 18:57:06 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: '+<' mode for opening files
Message-Id: <6gLSd.68077$g16.42650@trndny08>

Greetings.

I am attempting to understand what is the use of opening files for both
reading and writing.  I have read both
perldoc -f open
and
perldoc perlopentut
but I am confused.  The above documentation refers to using '+<' mode as
'updating', and suggests -i is a better alternative.  That's all well
and good, but I would still like to understand what specifying a mode of
'+<' actually *does*.

For example, a sample input file contains the five lines:
1
2
3
4
5

Executing the following script:
#!/usr/bin/perl
use strict;
use warnings;
open my $fh, '+<', 'input.txt' or die "Cannot open: $!\n";
my $line = <$fh>;
print "Line is: $line";
print $fh "A\n";
__END__

results in output of:
Line is: 1

and the input file now contains:
1
2
3
4
5
1
A

Can someone please explain this result to me?  It looks as though perl
appended the file with whatever data I had already read, followed by the
output I actually printed.  Is this what is supposed to happen?  Is
there a way (using this method of opening a file for simultaneous read &
writes) to just print new data to the file, without printing copies of
any data that's already been read?

Thank you for your time,
Paul Lalli



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

Date: Tue, 22 Feb 2005 17:58:11 GMT
From: "zzo" <methan@gmail.com>
Subject: ANNOUNCE: TiVo::HME 1.2
Message-Id: <ICBtKA.1EFt@zorch.sf-bay.org>

TiVo::HME 1.2 has been uploaded to the CPAN (*).
It's a pure perl implementation of TiVo's HME protocol (see
http://tivohme.sourceforge.net).

SYNOPSIS
         use TiVo::HME::Application;
         @ISA = qw(TiVo::HME::Application);

         sub init {
           my($self, $context) = @_;

           $self->get_root_view->visible(1);
           my $mpg =  $T_RESOURCE->image_file('examples/myloop.jpg');
           $self->get_root_view->set_resource($mpg,
               $T_CONST->HALIGN_CENTER | $T_CONST->VALIGN_CENTER);
           }

           sub handle_event {
               my($self, $resource, $key_action, $key_code,
$key_rawcode) = @_;
               print "You pressed the $key_code key on the remote!\n";
           }
        }


* Now 100% more installable!!




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

Date: Tue, 22 Feb 2005 17:51:47 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: Correct way to inherit from 3rd party class
Message-Id: <TiKSd.472316$8l.52003@pd7tw1no>

In article <cvfcek$r9t$1@mamenchi.zrz.TU-Berlin.DE>,
 anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
>To inherit from an arbitrary class that doesn't define such a set of
>accessors, you will have to take a look at the implementation to identify
>an equivalent set (i.e. a set of methods all others are defined in terms
>of).  Use that as described above.  If you're unlucky, the set will be
>large -- it may comprise all methods for an exceptionally badly written
>class.  In that case, the class can't be usefully inherited from.

You could use delegation on an arbitrary object.  Untested:

package SubClass;
use base 'ParentClass';

my %MyAttrib = (foo => 1, bar => 1);

sub new { 
  my ($class, %arg) = @_;
  my $self = bless { }, $class;
  $self->{$_} = delete $arg{$_} for grep $MyAttrib{$_} => keys %arg;
  $self->{_parent} = $self->SUPER::new(%arg);
  return $self;
}

sub AUTOLOAD {
  my $self = shift;
  (my $attr = our $AUTOLOAD) =~ s/.*://;
  return if $attr eq 'DESTROY';
  if ($MyAttrib{$attr}) {
    $self->{$attr} = shift if @_;
    return $self->{$attr};
  }
  # Might want to use goto & below for traceback
  return $self->{_parent}->$attr(@_);
}


In this case, it doesn't matter whether the method that ends up
triggering AUTOLOAD is an accessor or something else.  Of course,
you still need to know what all the methods are in the parent
class so you don't accidentally override one you don't want to.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


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

Date: Tue, 22 Feb 2005 17:47:27 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Form manipulation through mechcanize (perl)
Message-Id: <PeKSd.8706$x53.8046@newsread3.news.atl.earthlink.net>

"Antwerp" <bonjo90@yahoo.co.in> wrote in message
news:0DxSd.16704$Am3.501021@news20.bellglobal.com...
> Hello,
>
>
>     I really appreciate your help, I've become really frustrated with
this - all
> the resources I seek seem to confirm what I've already done - and suggest
it
> should work.
>
>     The first part seems to work well - I am indeed getting the 2
necessary
> cookies written into my cookies file (which I've included below). When
first
> fetching the page, $url, it is redirected to the login page. As a result,
when I
> look to display the content, I see the login page, and its associated
login form
> (which is what should happen :-) ). I then attempt to use WWW::mechanize
to fill
> out and submit the form.
>
>     This is where things break down - something isn't working. What should
> happen is that once the form is submitted with the correct login
information, I
> am redirected back to the original $url, but this time, I because I have
logged
> in, I should be able to browse the site. Thus, if I print $mech->content,
I
> should get the source I would get if I was logged in - that is, I should
be able
> to parse the logged in content of the site. What actually happens is I get
the
> same code I got initially - as if nothing happened from when arrived to
the
> site, and now. Even if I include false data in the username and password
fields
> (which should result in some sort of error message being returned), it
looks the
> same.

<snip>

ISTM you are submitted to the wrong URL,

e.g., you use

http://www.memberplushq.com/pe/index.jsp

as the URL,

when the submittal should actually be made to

http://www.memberplushq.com/pe/register/include/processlogin.jsp

In addition, it appears you have missed at least one hidden variable that
should be included in your submittal

"userRequested" => "", # hidden

Because I don't have actual UID and PW to use with the site, I can't carry
the process to the next step.

BTW, you would have seen the above problems if you had followed the
procedure that was suggested in another thread (of yours), re: Randal L.
Schwartz Column 43 ...

Cheers.
--
Bill Segraves




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

Date: Tue, 22 Feb 2005 18:25:16 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Form manipulation through mechcanize (perl)
Message-Id: <gOKSd.3910$Ba3.468@newsread2.news.atl.earthlink.net>

"Bill Segraves" <segraves_f13@mindspring.com> wrote in message
news:PeKSd.8706$x53.8046@newsread3.news.atl.earthlink.net...
<snip>
> In addition, it appears you have missed at least one hidden variable that
> should be included in your submittal
>
> "userRequested" => "", # hidden

Another hidden variable:

"uri" => "/pe/index.jsp", # hidden

It appears you have all of the other variables covered, except for the
"value" of the submit button. You provided the correct name, loginSubmit;
but you didn't provide a value. From the response to a submittal of the
previously mentioned Col43 script,

"loginSubmit" => "\xa0\xa0Login\xa0\xa0", # submit

If the back-end processing is checking for the correct value, it would
behove you to provide it. ;-)

Cheers.
--
Bill Segraves




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

Date: Tue, 22 Feb 2005 13:16:03 -0500
From: "Antwerp" <bonjo90@yahoo.co.in>
Subject: Re: Form manipulation through mechcanize (perl)
Message-Id: <AMKSd.7213$uO.397025@news20.bellglobal.com>

Hi,

    Thank you for you help, but I figured it out. It turns out I missed the
hidden values of the form - HTTP live headers, a mozilla plug in, alerted me to
this, and now everything works.

Yeay!

AntWerp

"J. Gleixner" <glex_nospam@qwest.invalid> wrote in message
news:G7qSd.410$0X4.2002@news.uswest.net...
: Antwerp wrote:
: > Hi,
: >
: >     I'm trying to create a script that automatically logs in to a website,
and
: > then parses the index (which is unavailable without first logging on). I'm
: > having difficulties, but I'm not exactly sure where they might lie.
: >
: >     I know I need to enable cookies to login, and I believe I have done so.
I
: > also recognize that I need to find and submit the appropriate form data - I
: > *think* am doing this correctly too. However, once I submit the form data, I
am
: > unable to print, load, or view the "secure" page. I would appreciate any
help;
: >
: > -------
: >
: > my $mech = WWW::Mechanize->new( autocheck => 1 );
: >    $mech->agent_alias( 'Windows IE 6' );
: >    $mech->cookie_jar(HTTP::Cookies->new
: >  (
: >  file => "cookies.txt",
: >      autosave => 1,
: >  ) );
: > $mech->get( $url );  #Getting the desired page
: > print $mech->content();  #Printing the content of the page
: > $mech->field( $login_field_name, $usna );   #this should be setting the
login
: > field values
: > $mech->field( $password_field_name, $pawo ); #this should be setting the
: > password field values
: >
: > $mech->submit();       #this should submit the form, causing
: >                     #a redirect to the proper index for logged in users
: >
: > print $mech->content();  #Question:
: >                     #Shouldn't this show the new content of the page -
: >                     #that is, the member index? Why does it not do so?
:
: Without knowing your values of $url, $login_field_name, and
: $password_field_name, and what your final print displays, who knows.
: The code looks accurate.  Is anything written to cookies.txt? If there
: is more than one form on the page, then you may want to look at the
: submit_form() method.




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

Date: Wed, 23 Feb 2005 02:30:09 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: help about array and hash
Message-Id: <cvftol$e2p$1@netnews.hinet.net>

  undef %saw;

            @saw{@in} = (); #why? @saw not $saw, @saw is array or
hash?<===============
            @out = sort keys %saw;  # remove sort if undesired


            undef @ary;
            @ary[@in] = @in;  #why? @saw not $saw<===============
            @out = grep {defined} @ary;




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

Date: Tue, 22 Feb 2005 19:37:22 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: help about array and hash
Message-Id: <pan.2005.02.22.18.37.21.727674@dunkelheit.at>

sonet wrote:
> #why? @saw not $saw, @saw is array or hash?<===============

That's absolutely gibberish for me, but my third eye says you should get a
look at hash-slices in perldoc perldata. Also you should read the posting
guidelines, which were last posted awful 10 hours ago.

-- 
http://www.dunkelheit.at/

»Better to reign in hell than to serve in heaven«
                             -- John Milton, »Paradise Lost«



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

Date: Tue, 22 Feb 2005 19:02:55 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: help about array and hash
Message-Id: <zlLSd.42228$W16.24971@trndny07>

"sonet" <sonet.all@msa.hinet.net> wrote in message
news:cvftol$e2p$1@netnews.hinet.net...
>   undef %saw;
>
>             @saw{@in} = (); #why? @saw not $saw, @saw is array or
> hash?<===============
>             @out = sort keys %saw;  # remove sort if undesired
>
>
>             undef @ary;
>             @ary[@in] = @in;  #why? @saw not $saw<===============
>             @out = grep {defined} @ary;


@saw{@in} is a hash slice
@ary[@in] is an array slice

You can read more about slices in:
perldoc perldata

Search for the section labeled "Slices"

Hope this helps,
Paul Lalli



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

Date: Tue, 22 Feb 2005 18:10:52 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: How to get program's memory usage?
Message-Id: <cvfsjc$6dk$1@reader2.panix.com>



Is there a portable way to determine how much memory a Perl script
is consuming?  Now I'm using `ps ho rss $$` (plus chomp, yaddayadda),
but this is not very meaningful outside of Linux, let alone outside
of Unix.

Thanks!

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

Date: Tue, 22 Feb 2005 16:39:03 GMT
From: "patrickg" <pat@patmail.com>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <HeJSd.86610$pc5.69651@tornado.tampabay.rr.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns960570AA8443Casu1cornelledu@132.236.56.8...
> "patrickg" <pat@patmail.com> wrote in
> news:ybISd.105725$JF2.95728@tornado.tampabay.rr.com:
>
> >
> > "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> > news:Xns9605641F057B9asu1cornelledu@127.0.0.1...
>
> ...
>
> >> Well, I don't know about IIS but it sure makes a difference when
> >> running Apache. This should tell you that you no longer have a Perl
> >> issue but a web server configuration issue. I'd advise you to find an
> >> appropriate forum.
>
> ...
>
> > When you say it makes a difference when running Apache, are you
> > referring to Apache on Windows or Apache on *nix??
>
> Windows.
>
> > Reason I'm asking is because even when I run the script from a command
> > line (therefor not using any webserver at all), it still doesn't make
> > a difference as to my results. So maybe the difference is regarding
> > the OS, not the webserver. (?)
>
> No.
>
> There are three ways to invoke a Perl script on the command line in
> Windows:
>
> 1. perl myscript
>
> In this case, the first perl executable in the PATH is used. The
> interpreter you specify in the shebang line is irrelevant. However, the
> options you specified in the shebang line will be respected by the
> interpreter.
>
> 2. start myscript.pl
>
> Assuming the .pl extension is associated with a perl interpreter, that
> interpreter will be invoked to run the script. Again, the interpreter
> specified on the shebang line will be irrelevant.
>
> 3. Put .pl or whatever extension you use for Perl scripts in the PATHEXT
> (Win2k and higher) environment variable. In this case, you can run
> myscript.pl simply by entering
>
> myscript
>
> on the command line. Once again, assuming the file extension is
> associated with a perl interpreter, the interpreter specified on the
> shebang line becomes irrelevant.
>
> Apache, however, uses the shebang line to determine the interpreter to be
> used to run the script in the absence of any directives telling it
> otherwise.
>
> I am trying very, very hard to stay away from a discussion of how *your*
> web server should be configured. You should find an appropriate forum.
>
> Sinan.

Yes, I have read the docs on how to run perl scripts - I prefer the first
method (with the -w flag).

My other Perl CGI scripts that don't use DBI run OK, so I'm guessing that my
IIS server can't be too far off.
And I'm sure that there are plenty of people using CGI and DBI via IIS, so
if they had to do something *special* to get things to work, or know of any
*gotchas*, perhaps they can help. My point is that my webserver isn't
configured in any way special, so whatever works for others (using IIS)
should work on my server. Using Perl's CGI module doesn't require the use of
Apache, does it?

 If it's a webserver configuration issue, then I guess I *am* seeking a
discussion on how to configure IIS to work with Perl's CGI and DBI modules.
If perl.misc isn't the correct forum (assuming misc is for miscellaneous),
then I'm not sure which forum would be more appropriate. You can probably
imagine the response if I went to some IIS forum and mentioned that my Perl
scripts aren't working correctly!

Thanks for your help!
patrick




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

Date: 22 Feb 2005 16:57:26 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <Xns960579A30D6DCasu1cornelledu@132.236.56.8>

"patrickg" <pat@patmail.com> wrote in
news:HeJSd.86610$pc5.69651@tornado.tampabay.rr.com: 

> Yes, I have read the docs on how to run perl scripts - I prefer the
> first method (with the -w flag).

use warnings;

is preferable because it allows you to selectively turn off specific 
warnings by category.

> My other Perl CGI scripts that don't use DBI run OK, so I'm guessing
> that my IIS server can't be too far off.

Not having access to an Oracle installation along with IIS and not being 
able to telepathically decipher your web server configuration, I am in 
position to offer any insight into the question of your web server's 
configuration.

> And I'm sure that there are plenty of people using CGI and DBI via
> IIS,

I am sure there are a lot of people who use a lawnmover as well. 

> so if they had to do something *special* to get things to work,
> or know of any *gotchas*, perhaps they can help. My point is that my
> webserver isn't configured in any way special,

You seem to be missing the crucial point: This forum is not about IIS 
configuration.

> Using Perl's CGI module doesn't require the use of Apache, does it?

No it doesn't. But the original weirdness you posted showed you did not 
know much about how to use that module either.

Also, you just said that your other CGI scripts run fine.

> If it's a webserver configuration issue, then I guess I *am* seeking
> a discussion on how to configure IIS to work with Perl's CGI and DBI

Did you even bother to read the error message (I mean the real one, not the 
one that was due to you sending content before headers)?!!! From your 
original message:

>>> install_driver(Oracle) failed: Can't load
>>> 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
>>> load_file:Access is denied at C:/Perl/lib/DynaLoader.pm line 230.
>>>  at (eval 1) line 3
>>> Compilation failed in require at (eval 1) line 3.
>>> Perhaps a required shared library or dll isn't installed where
>>> expected at C:\Inetpub\wwwroot\test1.pl line 7

Clearly, your issue has nothing whatsoever to do with either the CGI or the 
DBI modules.

As perldoc -q cgi clearly states:

My CGI script runs from the command line but not the browser.  (500 Server
or)
    Several things could be wrong. You can go through the "Troubleshooting
    Perl CGI scripts" guide at

            http://www.perl.org/troubleshooting_CGI.html

    ... Questions that appear to be Perl questions but are really CGI ones 
    that are posted to comp.lang.perl.misc are not so well received.

Ditto for web server configuration or OS-specific questions.

> modules. If perl.misc isn't the correct forum (assuming misc is for
> miscellaneous), 

'miscellaneous' doesn't mean 'anything goes'. The problem you have, quite 
clearly pointed out in the error message, is due to a DLL not being found. 
You done zip to actually investigate that issue. 

> then I'm not sure which forum would be more appropriate. 

That is something for you to ponder.

> You can probably imagine the response if I went to some
> IIS forum and mentioned that my Perl scripts aren't working correctly!

But your is an OS + Web Server specific question.

Sinan.


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

Date: Tue, 22 Feb 2005 17:48:03 GMT
From: "patrickg" <pat@patmail.com>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <nfKSd.99326$qB6.97232@tornado.tampabay.rr.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns960579A30D6DCasu1cornelledu@132.236.56.8...
> "patrickg" <pat@patmail.com> wrote in
> news:HeJSd.86610$pc5.69651@tornado.tampabay.rr.com:
>
> > Yes, I have read the docs on how to run perl scripts - I prefer the
> > first method (with the -w flag).
>
> use warnings;
>
> is preferable because it allows you to selectively turn off specific
> warnings by category.
>
> > My other Perl CGI scripts that don't use DBI run OK, so I'm guessing
> > that my IIS server can't be too far off.
>
> Not having access to an Oracle installation along with IIS and not being
> able to telepathically decipher your web server configuration, I am in
> position to offer any insight into the question of your web server's
> configuration.

Then perhaps your not the best person to help me with this. I really
appreciate the effort, though. (Since your not telepathic, if there was
something in particular that you wanted to know about my config, you could
have asked. I provided any info that I thought would be pertinent in my
original post.)
>
> > And I'm sure that there are plenty of people using CGI and DBI via
> > IIS,
>
> I am sure there are a lot of people who use a lawnmover as well.

 Your point is...?


>
> > so if they had to do something *special* to get things to work,
> > or know of any *gotchas*, perhaps they can help. My point is that my
> > webserver isn't configured in any way special,
>
> You seem to be missing the crucial point: This forum is not about IIS
> configuration.

Yeah - I know. My IIS is configured fine for typical purposes. I'm having
problems with serving up *Perl* pages. Therefor....

>
> > Using Perl's CGI module doesn't require the use of Apache, does it?
>
> No it doesn't. But the original weirdness you posted showed you did not
> know much about how to use that module either.

Weirdness?? That's subjective, but neither here nor there. I stated that I
was new to Perl, so obviously I don't know everything about using *any*
module.


>
> Also, you just said that your other CGI scripts run fine.
>
> > If it's a webserver configuration issue, then I guess I *am* seeking
> > a discussion on how to configure IIS to work with Perl's CGI and DBI
>
> Did you even bother to read the error message (I mean the real one, not
the
> one that was due to you sending content before headers)?!!! From your
> original message:
>
> >>> install_driver(Oracle) failed: Can't load
> >>> 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
> >>> load_file:Access is denied at C:/Perl/lib/DynaLoader.pm line 230.
> >>>  at (eval 1) line 3
> >>> Compilation failed in require at (eval 1) line 3.
> >>> Perhaps a required shared library or dll isn't installed where
> >>> expected at C:\Inetpub\wwwroot\test1.pl line 7
>
> Clearly, your issue has nothing whatsoever to do with either the CGI or
the
> DBI modules.
>
> As perldoc -q cgi clearly states:
>
> My CGI script runs from the command line but not the browser.  (500 Server
> or)
>     Several things could be wrong. You can go through the "Troubleshooting
>     Perl CGI scripts" guide at
>
>             http://www.perl.org/troubleshooting_CGI.html

Bad link


>
>     ... Questions that appear to be Perl questions but are really CGI ones
>     that are posted to comp.lang.perl.misc are not so well received.
>
> Ditto for web server configuration or OS-specific questions.

So you're saying that this forum is only for Perl discussions that don't
have anything to do with specific modules, OS, middleware, etc?? I don't
know how you can troubleshoot without knowing the environment.


>
> > modules. If perl.misc isn't the correct forum (assuming misc is for
> > miscellaneous),
>
> 'miscellaneous' doesn't mean 'anything goes'. The problem you have, quite
> clearly pointed out in the error message, is due to a DLL not being found.
> You done zip to actually investigate that issue.

Not only do you not know all the investigating that I've done prior to
posting to the forum (which is always my last option), but you maybe should
revisit my original post, inwhich I state that I've already verified that
the dll is there, and has read / execute permissions on it.


>
> > then I'm not sure which forum would be more appropriate.
>
> That is something for you to ponder.

Uh-huh - so you don't have an answer for your own suggestion, do you?


>
> > You can probably imagine the response if I went to some
> > IIS forum and mentioned that my Perl scripts aren't working correctly!
>
> But your is an OS + Web Server specific question.

Maybe, but it is in regards to Perl. IOW... how to get Perl to work on a
particular OS with a particular webserver, both of which are very common.

I came to this forum as a newbie seeking help with a particular problem,
hoping that some more experienced people would have some advice from their
experiences. But it seems like all you want to do is argue and patronize. If
you can't help me, just move on to the next post.

Thanks (anyway)




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

Date: 22 Feb 2005 18:05:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <Xns9605854249894asu1cornelledu@132.236.56.8>

"patrickg" <pat@patmail.com> wrote in
news:nfKSd.99326$qB6.97232@tornado.tampabay.rr.com: 

> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns960579A30D6DCasu1cornelledu@132.236.56.8...
>> "patrickg" <pat@patmail.com> wrote in
>> news:HeJSd.86610$pc5.69651@tornado.tampabay.rr.com:
>>

 ...

> was something in particular that you wanted to know about my config,

Again, you are missing the fundamental point: This is not the place to 
discuss your web server or even CGI. This forum is for discussing Perl.

>> > And I'm sure that there are plenty of people using CGI and DBI via
>> > IIS,
>>
>> I am sure there are a lot of people who use a lawnmover as well.
> 
>  Your point is...?

Questions about IIS + Windows (or Apache on Solaris) are just as on-topic 
here as questions on your lawnmover.

> Yeah - I know. My IIS is configured fine for typical purposes. I'm
> having problems with serving up *Perl* pages. Therefor....

But not *all* CGI scripts written in Perl. You yourself have stated that 
other CGI scripts you have written in Perl are running fine. It is the 
one that needs a specific DLL that has problems.

>> As perldoc -q cgi clearly states:
>>
>> My CGI script runs from the command line but not the browser.  (500
>> Server or)
>>     Several things could be wrong. You can go through the
>>     "Troubleshooting Perl CGI scripts" guide at
>>
>>             http://www.perl.org/troubleshooting_CGI.html
> 
> Bad link

How so?

>>     ... Questions that appear to be Perl questions but are really CGI
>>     ones that are posted to comp.lang.perl.misc are not so well
>>     received. 
>>
>> Ditto for web server configuration or OS-specific questions.
> 
> So you're saying that this forum is only for Perl discussions that
> don't have anything to do with specific modules, OS, middleware, etc??

http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.text

 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.


> I don't know how you can troubleshoot without knowing the environment.

 ...

> Not only do you not know all the investigating that I've done prior to
> posting to the forum (which is always my last option), but you maybe
> should revisit my original post, inwhich I state that I've already
> verified that the dll is there, and has read / execute permissions on
> it. 

Those are not the only things you need to check. However, the list of 
things to check is independent of the particular language you are using. 
It is a web server + OS configuration issue.

>> > then I'm not sure which forum would be more appropriate.
>>
>> That is something for you to ponder.
> 
> Uh-huh - so you don't have an answer for your own suggestion, do you?

I don't have to. It is your job to say "thank you, I will look for a 
forum that deals specifically with IIS + Windows issues" and go away.

> Maybe, but it is in regards to Perl. IOW... how to get Perl to work on
> a particular OS with a particular webserver, both of which are very
> common. 

And off-topic here.
 
> If you can't help me, just move on to the next post. 

Correction: I won't help you.
 
> Thanks (anyway)

You are most welcome.

Sinan


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

Date: Tue, 22 Feb 2005 18:58:03 GMT
From: "patrickg" <pat@patmail.com>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <%gLSd.105743$JF2.40208@tornado.tampabay.rr.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns9605854249894asu1cornelledu@132.236.56.8...

> It is a web server + OS configuration issue.
>
You really haven't shown that - that's just your guess since you don't have
another idea. Kinda like any support rep for any hardware/ software
product - if the solution isn't in their pre-scripted checklist, then they
say it's an OS issue: "Call Microsoft."


> >> > then I'm not sure which forum would be more appropriate.
> >>
> >> That is something for you to ponder.

From clpmisc_guidelines.text:
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.

Thanks for the help (NOT).


>
> I don't have to. It is your job to say "thank you, I will look for a
> forum that deals specifically with IIS + Windows issues" and go away.
>

From clpmisc_guidelines.text:
  A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness.

> > Maybe, but it is in regards to Perl. IOW... how to get Perl to work on
> > a particular OS with a particular webserver, both of which are very
> > common.
>
> And off-topic here.
>
From clpmisc_guidelines.text:

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
    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.

My OS is running fine, IIS works, but having problems running Perl scripts
via IIS. I can't make that more simple for you. Obviously, this IS Perl
*related*, even if Perl itself is not the culprit.

> > If you can't help me, just move on to the next post.
>
> Correction: I won't help you.

That was obvious from your original post, which is why I'm wondering why you
replied to begin with. I guess it damaged your ego that you didn't know the
answer, so you decided to flame instead.

Feel free to killfile me, or at least have the courtesy not to respond to
any other questions that I will have.
patrick

ps - You really should get your egotistic head out of your ass.




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

Date: Tue, 22 Feb 2005 20:03:50 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Need help with CGI/ DBI error (permissions?)
Message-Id: <pan.2005.02.22.19.03.50.635740@dunkelheit.at>

patrickg wrote:

> From clpmisc_guidelines.text:
> 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.
> 
> Thanks for the help (NOT).

*PLONK*, *PLONK*, *PLONK* and *PLOK*[1] [2]

[1] The N is now broken because of you ..
[2] .. and yea, I know that you don't care.

-- 
http://www.dunkelheit.at/

Ordinary morality is only for ordinary people.
                       -- Aleister Crowley



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

Date: Tue, 22 Feb 2005 16:48:17 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: perl null value ?
Message-Id: <lnJSd.29196$ya6.6763@trndny01>

"Alexandre Jaquet" <alexj@floor.ch> wrote in message
news:cvfjlv$ggc$1@news.hispeed.ch...
> Hi how can make a test if ($var ne null) { print "not null"; } when
I'm
> doing that I got the following error msg :
>
> bareword "NULL" not allowed while "strict subs" in use at

What, exactly, do you mean by 'null' in this case?  Are you talking
about a variable which has not yet been defined?

if (defined ($var) ) { print "not undefined\n"; }

Are you talking about a variable that has a false value?

if ($var) { print "not false\n"; }

Are you talking about a variable whose value is a string containing the
null character?

if ($var ne "\000") { print "not the null character\n"; }

Or do you mean something else entirely?  "null" is not a special or
defined word in Perl syntax.  You need to tell us what you're actually
trying to do.

Paul Lalli



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

Date: Tue, 22 Feb 2005 17:02:45 GMT
From: jeremiah johnson <jjohnson@psg.com>
Subject: Re: perl null value ?
Message-Id: <VAJSd.16835$g44.4652@attbi_s54>

The Perl "null" values are:

1) ''     The empty string
2) '0'    Zero in single quotes
3) undef  very similar to the NULL in other languages
4)        .. can't remember the fourth.  sorry, tad.

but since Perl will return what it thinks you want, you really don't 
have to worry about it.

try this:

   if ($var) { print "not null\n"; }

if $var contains anything other than one of the four false values 
mentioned above, the condition will evaluate as true, and execution will 
proceed into the curly braces.

jeremiah();



Alexandre Jaquet wrote:
> Hi how can make a test if ($var ne null) { print "not null"; } when I'm 
> doing that I got the following error msg :
> 
> bareword "NULL" not allowed while "strict subs" in use at
> 
> thx in advance


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

Date: Tue, 22 Feb 2005 17:35:11 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: perl null value ?
Message-Id: <j3KSd.46180$sR5.22174@trndny05>

"jeremiah johnson" <jjohnson@psg.com> wrote in message
news:VAJSd.16835$g44.4652@attbi_s54...

Please do not top quote.  Thank you.

> The Perl "null" values are:

There is no such thing as 'null'.   What you have listed are the values
that evaluate to false in a boolean context.

> 1) ''     The empty string
> 2) '0'    Zero in single quotes

You mean "string containing only the character '0'".  The single quotes
are irrelevant, as there is no difference between single and double
quotes (unless a variable or escape sequence is included in the string,
which they are not in this case)

> 3) undef  very similar to the NULL in other languages
> 4)        .. can't remember the fourth.  sorry, tad.

The numeric value 0.  Either a numeric literal typed into your code (0,
0.0, 0x00, etc), or a the result of a mathematical computation which is
equal to 0.

Paul Lalli




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

Date: Tue, 22 Feb 2005 17:53:53 GMT
From: jeremiah johnson <jjohnson@psg.com>
Subject: Re: perl null value ?
Message-Id: <RkKSd.42339$4q6.25847@attbi_s01>

take your elitist attitude and shove it.  i will not be reposting.


Paul Lalli wrote:
> "jeremiah johnson" <jjohnson@psg.com> wrote in message
> news:VAJSd.16835$g44.4652@attbi_s54...
> 
> Please do not top quote.  Thank you.


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

Date: 22 Feb 2005 18:08:32 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: perl null value ?
Message-Id: <Xns960585B0FF35Fasu1cornelledu@132.236.56.8>

jeremiah johnson <jjohnson@psg.com> wrote in news:VAJSd.16835$g44.4652
@attbi_s54:

> The Perl "null" values are:
> 
> 1) ''     The empty string
> 2) '0'    Zero in single quotes

What is the difference between 'zero in single quotes' and 'zero in 
double quotes'? ITYM a string consisting only of the 0 character.

> 3) undef  very similar to the NULL in other languages
> 4)        .. can't remember the fourth.  sorry, tad.

You seem to be confused. I have no idea what Perl "null" values are, but 
1, 2, and 3 are not equivalent.

> but since Perl will return what it thinks you want, you really don't 
> have to worry about it.
> 
> try this:
> 
>    if ($var) { print "not null\n"; }

There is a difference between false and undef.

use strict;
use warnings;

my @false = (0, '', '0', undef);

for my $f (@false) {
    print "[$f] : True!\n" if defined $f;
}

__END__

Sinan


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

Date: 22 Feb 2005 18:09:24 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: perl null value ?
Message-Id: <Xns960585D6C5CF9asu1cornelledu@132.236.56.8>

jeremiah johnson <jjohnson@psg.com> wrote in news:RkKSd.42339$4q6.25847
@attbi_s01:

> Paul Lalli wrote:
>> "jeremiah johnson" <jjohnson@psg.com> wrote in message
>> news:VAJSd.16835$g44.4652@attbi_s54...
>> 
>> Please do not top quote.  Thank you.

> take your elitist attitude and shove it.  i will not be reposting.

Thank you for allowing the average IQ level to increase by leaving.

*PLONK* anyway.

Sinan


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

Date: 22 Feb 2005 10:25:44 -0800
From: nick.p.doyle@gmail.com
Subject: Regex for "search query" string
Message-Id: <1109096744.699306.69400@c13g2000cwb.googlegroups.com>

(I'm actually writing this in vb.net but the .net group gave no
response to my regex q's)
Given a "typical string for a search" containing quoted phrases and
logical operators
e.g. betty AND "the jets"
I want to match first "the jets" then the " and ", then anything else.

My current regex for "a or b" is "( or )|(.+)", because I thought the
alternation operator would operate in an ordered fashion but apparently
not.

Advice most welcome, thanks.
Nick



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

Date: Tue, 22 Feb 2005 19:32:09 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Regex for "search query" string
Message-Id: <pan.2005.02.22.18.32.08.424610@dunkelheit.at>

nick.p.doyle wrote:

> (I'm actually writing this in vb.net but the .net group gave no response
> to my regex q's)

I have about 40_000 in my list of groups, how much of them are you going
to try out?

> Given a "typical string for a search" containing quoted phrases and
> logical operators
> e.g. betty AND "the jets"
> I want to match first "the jets" then the " and ", then anything else.

At first, the term " and " is very confusing and I (not a native speaker)
needed some time to get it. What means "first"? first position? what means
you want to match "anything else"?

> My current regex for "a or b" is "( or )|(.+)", because I thought the
> alternation operator would operate in an ordered fashion but apparently
> not.

I wouldn't do this with regular expressions.

-- 
http://www.dunkelheit.at/
sapere aude.



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

Date: 22 Feb 2005 10:40:14 -0800
From: nick.p.doyle@gmail.com
Subject: Re: Regex for "search query" string
Message-Id: <1109097614.194216.70990@o13g2000cwo.googlegroups.com>

" and " means a space, then the letters 'a', 'n' and 'd', then another
space
Like in "homer and bart" but not "flanders".

"first" as in the order in which things are matched

"anything else" is things not covered by the other case - letter,
numbers, whatever - a period in regex language.



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

Date: Tue, 22 Feb 2005 09:34:14 -0700
From: Rodolfo Hinojosa~ <rodolfo.hinojosa@intel.com>
Subject: Win32:OLE How to size or resize Excel comment textfield?
Message-Id: <cvfmu6$ftm$1@news01.intel.com>

Usually I can figure out the syntax by creating a macro and converting 
the resulting VBA to the appropriate Perl syntax but this one has me 
stuck.I'm trying to set a fixed size for the textfield used to contain 
the comment. Does anyone have any examples they can share?

Thanks,
Rudy



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

Date: 22 Feb 2005 19:01:03 GMT
From: xhoster@gmail.com
Subject: Re: Write-Only Socket
Message-Id: <20050222140103.957$GR@newsreader.com>

Martin Kissner <news@chaos-net.de> wrote:
> Hello together,
>
> I am trying to write a little tcp-server which creates a write only
> socket an test it with a little client.
> The code I have tried so far is below and it workes as expected in the
> form I posted it.
>
> The question is:
> Why do I have to shutdown(0) $session _and_ $socket on the server?

As far as I can tell, you don't.  I get the same behavior whether $socket
is shutdown or not.

> I had expected that the client would not be able to write to his $socket
> if only $session on the server was shutdown(0)

I don't see that happening regardless of what you shutdown.  It looks to me
like the client is prohibited from writing to the socket only because
server exits.  shutdown(0) does not seem to be enforced on the other
end of the socket.

Perl 5.8.0 on Linux.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 7813
***************************************


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