[16560] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3972 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 03:05:33 2000

Date: Thu, 10 Aug 2000 00:05:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965891120-v9-i3972@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 10 Aug 2000     Volume: 9 Number: 3972

Today's topics:
        Almost there-please answer <jkearmanNO@mindspring.com>
        Cant figure this out. <psychoNOpsSPAM@pcpatches.com.invalid>
    Re: Cant figure this out. <wyzelli@yahoo.com>
    Re: Cant figure this out. <uri@sysarch.com>
    Re: Check datatype <billy@arnis-bsl.com>
    Re: Dereferencing correctly in regular expressions <elephant@squirrelgroup.com>
    Re: How do I dislpay all the conents in a file? thirdgc@my-deja.com
    Re: How to open web page from Perl script martinp@intersys.com.uy
    Re: multi file modules <elephant@squirrelgroup.com>
        No threads in this perl? <jason@shakabuku.org>
    Re: No threads in this perl? (Robert Hallgren)
    Re: on-the-fly variable <elephant@squirrelgroup.com>
    Re: open filehandle to a array or variable (Eric Bohlman)
        postgresql &  perl : where can i get help? <edward_long@andrews-models.com.au>
    Re: postgresql &  perl : where can i get help? (Prasanth A. Kumar)
    Re: Problems with adding 1 (Decklin Foster)
    Re: Problems with adding 1 thirdgc@my-deja.com
    Re: Problems with adding 1 (fvw)
    Re: Problems with adding 1 thirdgc@my-deja.com
    Re: reg expressions - protect html <godzilla@stomp.stomp.tokyo>
    Re: Sort of a sort problem. <lr@hpl.hp.com>
        use Win32::ODBC problems in PWS <drawbridge@home.com>
    Re: Using Bit::Vector for large hex-number arithmetic <sb@muccpu1.muc.sdm.de>
    Re: warning/var weirdness (or is it?) <memmett@fraser.sfu.ca>
    Re: warning/var weirdness (or is it?) <godzilla@stomp.stomp.tokyo>
    Re: warning/var weirdness (or is it?) <elephant@squirrelgroup.com>
    Re: warning/var weirdness (or is it?) <callgirl@la.znet.com>
    Re: warning/var weirdness (or is it?) <elephant@squirrelgroup.com>
    Re: warning/var weirdness (or is it?) <callgirl@la.znet.com>
        Who has used --------->  Net::Telnet   ????  Kick ASS   <superegoNOsuSPAM@execs.com.invalid>
        why doesn't work <unplug@poboxes.com>
    Re: why doesn't work (Robert Hallgren)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 10 Aug 2000 00:35:05 -0400
From: "Jim_Kearman" <jkearmanNO@mindspring.com>
Subject: Almost there-please answer
Message-Id: <8mtbqk$18a$1@slb6.atl.mindspring.net>

I uninstalled ActiveState Perl 516. When I went to reinstall I noticed that
both IIS-related check boxes were grayed out. Could this be the reason why
Perl is not working with PWS4?

Please advise. Many thanks.

Jim




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

Date: Wed, 09 Aug 2000 23:28:17 -0700
From: psycho <psychoNOpsSPAM@pcpatches.com.invalid>
Subject: Cant figure this out.
Message-Id: <010d36f4.ca015738@usw-ex0103-024.remarq.com>

Easily put, need to be able to cut the last part of a scarlar at
a determind character.  There would be more then of these
characters, but the last one and all data after that character
is to be deleted.


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Thu, 10 Aug 2000 16:13:05 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Cant figure this out.
Message-Id: <Z9sk5.25$KC1.3120@vic.nntp.telstra.net>

"psycho" <psychoNOpsSPAM@pcpatches.com.invalid> wrote in message
news:010d36f4.ca015738@usw-ex0103-024.remarq.com...
> Easily put, need to be able to cut the last part of a scarlar at
> a determind character.  There would be more then of these
> characters, but the last one and all data after that character
> is to be deleted.
>

$var = $1 if ($var =~ /(.*)#/); # where # represents the character
referred to above

Wyzelli




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

Date: Thu, 10 Aug 2000 06:46:32 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Cant figure this out.
Message-Id: <x74s4t1ulz.fsf@home.sysarch.com>

>>>>> "W" == Wyzelli  <wyzelli@yahoo.com> writes:

  W> "psycho" <psychoNOpsSPAM@pcpatches.com.invalid> wrote in message
  W> news:010d36f4.ca015738@usw-ex0103-024.remarq.com...
  >> Easily put, need to be able to cut the last part of a scarlar at
  >> a determind character.  There would be more then of these
  >> characters, but the last one and all data after that character
  >> is to be deleted.
  >> 

  W> $var = $1 if ($var =~ /(.*)#/); # where # represents the character
  W> referred to above

why the assigment? just use s///

	$var =~ s/(.*)#/$1/ ;

and there are many other ways as well.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 10 Aug 2000 04:21:19 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: Check datatype
Message-Id: <8mtajt$rhi$1@nnrp1.deja.com>

In article <3991ADED.5F667844@mail.com>,
  a <mail@mail.com> wrote:
> How can I check the datatype.  Right now I have:
>
> if( ($numberRecords !=~ /\D/) || ($numberErrors !=~ /\D/) )
>
> to see if the variable is a number.
>

FAQ: How do I determine whether a scalar is a
number/whole/integer/float?

Answers available from your local 'perldoc perlfaq4'
or http://www.cpan.org/doc/manual/html/pod/perlfaq4.html.

Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 10 Aug 2000 04:38:57 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Dereferencing correctly in regular expressions
Message-Id: <MPG.13fccf49c377eb57989683@localhost>

Iain Chalmers wrote ..
>here's some that I had to try before I was convinced about what they'd do:
>
>@a=('a','b');
>print "$a[print 'this was evaluated...']\n";
>print "$a[open(FOO,'file_that_doesnt_exist')]\n";
>
>I _guess_ thats kinda D(ing)WIM, but *boggle*!

regarding the DWIMiness of those .. I agree that if you typed those 
statements 'innocently' then you'd be completely befuddled

but the infrequency of that befuddlement is evidenced by the lack of 
appearance of related questions in c.l.p.misc .. most times all that's 
involved are simple evaluations that are very DWIMy

my own made-up rule for predicting interpolation was:

  The variables in a string are interpolated, but no operators are
  evaluated UNLESS the interpolation of a variable demands a value from
  that operator OR the operator is a dereference operator and is
  followed by either a '[' or a '{'.

I'd have to add something to specifically cover the tight binding of '[' 
and '{' to apparent scalars and the whitespace ambiguity resolution 
feature .. AND .. a new bug that someone seems to have discovered with 
my variables in the thread [warning/var weirdness (or is it?)] .. 
exceptions exceptions exceptions

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Thu, 10 Aug 2000 04:53:10 GMT
From: thirdgc@my-deja.com
Subject: Re: How do I dislpay all the conents in a file?
Message-Id: <8mtcfm$sns$1@nnrp1.deja.com>

Thanks. I guess I should reread the array chapter of the Perl Cookbook.
I already fixed that part of the script but it did help fix another
part. Thanks again.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 10 Aug 2000 04:11:05 GMT
From: martinp@intersys.com.uy
Subject: Re: How to open web page from Perl script
Message-Id: <8mta0n$r5b$1@nnrp1.deja.com>

There are different ways to do that. The following is very common.
After you verify what ever you need you may use:

print "Location: http://www.yourdomain.com/the_page_you_want.html\n\n";

Hope this help.

Martin

In article <8mmqh2$aaj$1@nnrp1.deja.com>,
  hla_sa@my-deja.com wrote:
> I'm new to Perl and need to know how to open an existing web page from
> within a Perl script. After a login verification my Perl script should
> open a new web page in the browser. The login check is working but I
> don't know how to redirect the browser to a new webpage
> programmatically. A simple example should suffice. Thanks.
>
> p.s. How is another Perl script called from with a running script ?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 10 Aug 2000 04:22:58 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: multi file modules
Message-Id: <MPG.13fccb8dea8fde7a989682@localhost>

Matthew Emmett wrote ..
>I'm having trouble getting the following to work: I have a package
>called "Roster" that I've defined through 2 files: Roster.pm and
>RosterUI.pm.  Here is my constructor from Roster.pm:
>
>package Roster;
>use strict;
>
>use Modules::RosterUI;
>
>use Tk;
>
>sub new {
>    my $proto = shift;
>    my $class = ref($proto) || $proto;
>    my $self  = {};
>
>    bless ($self, $class);
>
>    my ($top) = @_;
>
>    # make top level frame
>    $self->{top} = $top->Frame();
>
>    # build the bits of the Roster
>    build_StudentRoster ($self); # list of students on the right
>    build_StudentDetails ($self); # student details on the left
>    build_StudentActions ($self); # buttons under details pane
>
>    # pack the top!
>    $self->{top}->pack();
>    
>    return $self;
>}
>
>where build_StudenRoster, build_StudentDetails and
>build_StudentActions are defined in RosterUI.pm.  For example,
>
>package Roster;
>use strict;
>
>sub build_StudentRoster {
>    my $self = shift;
>
>    # blah blah
>}
>
>
>My problem is that build_*, when called with build_* (); doesn't work
>because $self isn't defined.  I've tried playing around with different
>combinations of use, require and do to include RosterUI.pm in
>Roster.pm, but no success!  So, I'm wondering if what I'm trying to do
>is in fact possible!  Any suggestions?

at a guess .. your use line has Modules::RosterUI in it .. you realise 
that will make Perl look for 'Modules/RosterUI.pm' in the directories in 
@INC .. if Roster.pm and RosterUI.pm are in the same directory then you 
should probably just have

  use RosterUI;

like I said .. just a guess

a lot depends on whether that $top is being set correctly I'd imagine .. 
it would seem that you've got things pretty messed up and that whatever 
is 'use'ing Roster is also 'use'ing RosterUI .. perhaps it should just 
use Roster which in turn uses RosterUI

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Thu, 10 Aug 2000 05:23:30 GMT
From: Jason Bodnar <jason@shakabuku.org>
Subject: No threads in this perl?
Message-Id: <8mte8g$ttf$1@nnrp1.deja.com>

I'm pretty sure I turned on threading when I built perl5.6 the other
day:

$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.14-15mdk, archname=i586-linux-thread-multi
    uname='linux mrmagoo.nohost.com 2.2.14-15mdk #1 tue jan 4 22:24:20
cet 2000 i586 unknown '
    config_args='-des -Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.95.2 19991024 (release)
    cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Jul 30 2000 18:39:23
  @INC:
    /usr/local/lib/perl5/5.6.0/i586-linux-thread-multi
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/i586-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl


But when I try to run a threaded program I'm working on I get:

No threads in this perl at iceboxd line 55.

The important code is simply:

my $stream_thread = new Thread(\&stream);
$stream_thread->detach;


So what gives? perldoc Thread or perldoc perlthrtut both say that their
information is based on 5.005 threading and that 5.6.0 will have a new
threading model. Has the thread syntax changed in 5.6.0 without updating
the documentation?

--
Jason Bodnar
jason@shakabuku.org


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 10 Aug 2000 06:00:03 GMT
From: sandhall@swipnet.se (Robert Hallgren)
Subject: Re: No threads in this perl?
Message-Id: <slrn8p4go0.7ni.sandhall@poetry.lipogram>

On Thu, 10 Aug 2000 05:23:30 GMT,
 Jason Bodnar <jason@shakabuku.org> wrote:

> I'm pretty sure I turned on threading when I built perl5.6 the other
> day:

[...]
>     config_args='-des -Dusethreads'

[...]
> But when I try to run a threaded program I'm working on I get:
> 
> No threads in this perl at iceboxd line 55.
> 
> The important code is simply:
> 
> my $stream_thread = new Thread(\&stream);
> $stream_thread->detach;

From README.threads in the Perl 5.6.0 src:

  NOTE: This documentation describes the style of threading that was
  available in 5.005.  Perl v5.6 also has the early beginnings of
  interpreter-based threads support (which is what will be enabled by
  default when you simply ask for -Dusethreads).  However, be advised
  that interpreter threads cannot as yet be created from the Perl level
  yet.  If you're looking to create threads from within Perl, chances
  are you _don't_ want interpreter threads, but want the older support
  for threads described below, enabled with:

      sh Configure -Dusethreads -Duse5005threads



Robert
-- 
Robert Hallgren <sandhall@swipnet.se>

PGP: http://www.lipogram.com/pgpkey.asc
5F1E 95C2 F0D8 25A3 D1BE 0F16 D426 34BD 166A 566C


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

Date: Thu, 10 Aug 2000 04:11:07 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: on-the-fly variable
Message-Id: <MPG.13fcc8c230221e99989681@localhost>

Andy wrote ..
>Can anybody tell me how to set an on-the-fly variable in Perl?

you use the assignment operator .. you'll find it in the perlop section 
of the documentation .. but it's pretty tricky stuff

  perldoc perlop

also - depending on what you mean by 'on-the-fly' you might also want to 
investigate the 'local' keyword in perlfunc and follow the reference 
there to perlsub

  perldoc -f local

  perldoc perlsub

mum was right - it is just as easy to be helpful ;)

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: 10 Aug 2000 05:39:51 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: open filehandle to a array or variable
Message-Id: <8mtf77$31t$2@nntp9.atl.mindspring.net>

Stephen Haysom (stevehaysom@hotmail.com) wrote:
: I was wondering if it is possible to open a filehandle to an array or scalar
: variable, or open the filehandle to a temporary file, as I only need the
: information to be stored temporarily.

Look into the various modules in the IO::Stringy bundle, available from CPAN.



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

Date: Thu, 10 Aug 2000 14:16:50 +1000
From: "Edward Long" <edward_long@andrews-models.com.au>
Subject: postgresql &  perl : where can i get help?
Message-Id: <8mtag5$4sk$1@nina.pacific.net.au>

Where I can go for help and examples of using perl with postgresql?

--

________________________________________________________________________
Andrew's Models Pty Ltd - transforming data into valuable information
http://www.andrews-models.com.au
26 Gardeners Road, Kingsford NSW 2032, Australia
Domestic: Ph: 0411 521616 or (02) 9663 4555, Fax: (02) 9663 2911
International: Ph: +61 2 9663 4555, Fax: +61 2 9663 2911





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

Date: Thu, 10 Aug 2000 04:24:15 GMT
From: kumar1@home.com (Prasanth A. Kumar)
Subject: Re: postgresql &  perl : where can i get help?
Message-Id: <m3k8dpzqts.fsf@C654771-a.frmt1.sfba.home.com>

"Edward Long" <edward_long@andrews-models.com.au> writes:

> Where I can go for help and examples of using perl with postgresql?
<snip>

Read the DBI and Pg man pages after you install both portions. The Pg
man page should come with the DBD-Pg (the database dependent driver
used with DBI.) The webpage for DBI also has links to tutorials and
examples of general DBI code.

-- 
Prasanth Kumar
kumar1@home.com


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

Date: Thu, 10 Aug 2000 04:16:11 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: Problems with adding 1
Message-Id: <f0qk5.15068$f_5.75653@news1.rdc1.ct.home.com>

thirdgc@my-deja.com <thirdgc@my-deja.com> writes:

> open(postnum, "</home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
> open $num\.num: $! \n");
> @postnum = <postnum>;
> close(postnum);

Stop using this code and read `perldoc -q increment` right away.

> open(postnum1,

Why don't you have -w on?

> || dienice("Can't open $num\.num: $! \n");

I already advised you of a better way to do this.

-- 
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)


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

Date: Thu, 10 Aug 2000 04:10:06 GMT
From: thirdgc@my-deja.com
Subject: Re: Problems with adding 1
Message-Id: <8mt9ut$r4v$1@nnrp1.deja.com>

I tried this and I got an error. Can't modify array deref in
postincrement at /home/3gc/www/ctb/bbpost.cgi line 122, near "@numb ++"

open(postnumb, "</home/3gc/www/ctb/posts/$num\.num");
@numb = <postnumb>;
close(postnumb);

@numb ++;

open(postnum1, "+>/home/3gc/www/ctb/posts/$num\.num") || dienice("Can't
open $num\.num: $! \n");
print postnum1 "$postnum\n";
close(postnum1);


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 10 Aug 2000 04:19:56 GMT
From: fvw+usenet@var.cx (fvw)
Subject: Re: Problems with adding 1
Message-Id: <965881441UPY.fvw@var.cx>

<8mt9ut$r4v$1@nnrp1.deja.com> (thirdgc@my-deja.com):
>I tried this and I got an error. Can't modify array deref in
>postincrement at /home/3gc/www/ctb/bbpost.cgi line 122, near "@numb ++"
>
>open(postnumb, "</home/3gc/www/ctb/posts/$num\.num");
>@numb = <postnumb>;
>close(postnumb);
>
>@numb ++;

afaik the ++ operator doesn't work on arrays, so you'll either have
to do $numb[0]++; if you're sure there's only one line in the
file, or if there are more lines in the file, you'll have
to do a foreach on the array, and increment each element
of the array seperately.


-- 

                        Frank v Waveren
                        fvw@var.cx
                        ICQ# 10074100


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

Date: Thu, 10 Aug 2000 04:59:34 GMT
From: thirdgc@my-deja.com
Subject: Re: Problems with adding 1
Message-Id: <8mtcrl$t2j$1@nnrp1.deja.com>

I figured it out from a reply to my other post. I found out that @numb
didn't equal $numb and I should use $numb[0] instead. That fixed my
problem. I should have checked the array chapter of the Perl CookBook.I
really apreciate your help.

Chris


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 09 Aug 2000 19:20:44 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: reg expressions - protect html
Message-Id: <3992117C.B097F0B2@stomp.stomp.tokyo>

Alan Barclay wrote:
 
> Larry Rosler wrote:

> > Note that NoWarnStrict is slower than WarnStrict.
> > I don't conclude from this that '-w' speeds a program
> > up, though.  In fact, I find no sgnificance in this
> > data set at all.
 
> I agree with Larry here. I ran each of the benchmarks
> 10 times each, and got these results 
> (Sorted for ease of comparision):

(snipped)
 
> As you can see, even if the benchmark is rerun without
> changing anything, there is a variation of as much as
> 4 wallclock seconds. All of the ranges of times overlap,
> and because of this, any ordering of results is possible.

Actually what you are displaying is benchmark's inherent
margin of error which is plus or minus five seconds, as
an average. A good "relative" scientific test would be
one million iterations, ten sets each, with your results
averaged. Ten million iterations in ten sets for each
code snippet, averaged, would be fairly accurate for
relative comparisons of code snippets, if you establish
identical conditions and controls, but would be highly
inaccurate for any stand alone timing of a single 
code snippet. Benchmark has too great a margin of
error for single code snippet timing. It is only
good for relative comparsions, with timing results,
the numbers themselves, being meaningless as a true
reflection of actual event times.

Godzilla!


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

Date: Wed, 9 Aug 2000 22:56:39 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Sort of a sort problem.
Message-Id: <MPG.13fbe3ecf63893db98ac5b@nntp.hpl.hp.com>

In article <h504pssi50sa8fql3j6n8513j1tifrkhtq@4ax.com>, 
abe@ztreet.demon.nl says...

 ...

> 	my @sorted = map substr($_, 4) => sort
> 		map { /(\d+)/; sprintf("%04u", $1).$_ } @files;

As Tony the Tiger might say, "That's GReaT!".

You could save a few strokes by moving the regex directly into the 
argument list, instead of the $1.  Any captures go directly into the 
list.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 10 Aug 2000 05:53:34 GMT
From: DM <drawbridge@home.com>
Subject: use Win32::ODBC problems in PWS
Message-Id: <399243B5.F5EDA3F9@home.com>


I am having a problem running "use" and "require" statements with
Win32:ODBC under PWS (Personal Web Server).

I have been writing code with: 
use Win32::ODBC;

This whole program works fine from the DOS prompt, but does not work
running through a web browser.  
Other scripts work fine, just not this one because of the use
Win32::ODBC.


--- ERROR ---->
Can't locate Win32/ODBC.pm in @INC at
C:\Inetpub\wwwroot\cgi-bin\viewer6.pl 
line 23. BEGIN failed--compilation aborted at
C:\Inetpub\wwwroot\cgi-bin\viewer6.pl line 23. 
--- ERROR ---->

After getting this error I moved Win32 to "C:\Perl\lib\Win32"

Now I get a new error:
--- ERROR ---->
Missing $ on loop variable at C:\perl\lib/Exporter.pm line 40. BEGIN
failed--compilation aborted at C:\Inetpub\wwwroot\cgi-bin\engine6.pl
line 20. 
--- ERROR ---->
 
Something is not setup correctly somewhere.  Why would the same script
work at the prompt but complain 
in a web browser?   Do I not have it installed right? I have not been
able to figure out a fix for this.  If anyone 
has any suggestions I would be grateful.  My computer settings are
listed below.

____James

I'm running the following:
Windows 98 A
Personal Web Server 4.0
ActiveState Perl Build 616

My Registry Settings are:



HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters\Script
Map 
(Default)   "REG_SZ"
 .pl         "C:\perl\bin\perl.exe %s %s"  
BIN         "C:\perl\bin"
PRIVLIB     "C:\perl\lib"

(I have tried  -- >.pl  "C:\perl\bin\perlIS.dll" < -- and got the same
results)


My installed Packages are:
PPM> query
Archive-Tar   [0.072  ] module for manipulation of tar archives.
Compress-Zlib [1.03   ] Interface to zlib compression library
DBD-ODBC      [0.28   ] ODBC driver for the DBI module.
DBI           [1.14   ] Database independent interface for Perl
HTML-Parser   [2.23   ] SGML parser class
MIME-Base64   [2.11   ] Encoding and decoding of base64 strings
PPM           [2      ] Perl Package Manager: locate, install, upgrade
software
                        packages.
Tk            [800.022] Tk - a Graphical User Interface Toolkit
URI           [1.04   ] Uniform Resource Identifiers (absolute and
relative)
Win32-API     [0.01   ] Implementation of arbitrary Win32 APIs.
XML-Element   [1.07   ] Base element class for XML elements
XML-Parser    [2.27   ] A Perl module for parsing XML documents
libwin32      [0.16   ] A collection of extensions that aims to provide
                        comprehensive access to the Windows API.
libwww-perl   [5.45   ] Library for WWW access in Perl
PPM>


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

Date: 10 Aug 2000 06:55:44 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Using Bit::Vector for large hex-number arithmetic
Message-Id: <8mtjlg$nog$1@solti3.sdm.de>

In comp.lang.perl.misc Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:

>>It does so since version 5.8, released about a week ago.

> Oh.  Looks like I need to go see what my favorite module has been up to
> while I wasn't looking.

Thanks for the compliment! :-)

But don't worry, there weren't many important changes:

 +  Changed "na" to "PL_na" in Vector.xs in order to make the module
    ready for Perl 5.6.0.
 +  Removed the error messages which appeared at global destruction
    time with Perl 5.6.0.
 +  Changed the corresponding test script (t/02____destroy.t) accordingly.
 +  Optimized the "strEQ" away from the typemap section in Vector.xs.
 +  Fixed the misspelled word "whether" in the documentation.
 +  Added method "Power()".
 +  Added overloaded operator "**" (for exponentiation).
 +  Changed method "Copy()"; the two vectors do not need to have the same
    size anymore. The method will copy as much as will fit or fill up
    with 0's or 1's (depending on the sign of the source) if necessary.
 +  Changed the corresponding test script (t/09_parameters.t) accordingly.

Best regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: 09 Aug 2000 21:03:21 -0700
From: Matthew Emmett <memmett@fraser.sfu.ca>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <yvw9og31zrsm.fsf@fraser.sfu.ca>

fvw+usenet@var.cx (fvw) writes:

> I have the following code:
> 
> #!/usr/bin/perl -w
> my $a='foo';
> my $b="${a}${a}[";
> print $b;

perl is trying to look for the @a array when it see's ${a}[.  If you
try 

#!/usr/bin/perl -w
use strict;

you'll get a nicer error message.

Try my $b="${a}${a}\["; instead.

Matt


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

Date: Wed, 09 Aug 2000 21:29:49 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <39922FBD.6D8F6789@stomp.stomp.tokyo>

fvw wrote:

> #!/usr/bin/perl -w
> my $a='foo';
> my $b="${a}${a}[";
> print $b;
 
> I would expect this to print "foofoo[", but instead it 
> prints "foo[" and complains:

(snipped)


Give this some thought:

TEST SCRIPT:
____________

#!/usr/local/bin/perl

print "Content-Type: text/plain\n\n";

my $a='foo';
my $b="${a}${a}\[";
print $b;

exit;

PRINTED RESULTS:
________________

foofoo[


Godzilla!

--
I'm a Black Magic Woman. I will rock you.
  http://la.znet.com/~callgirl3/magic.mid


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

Date: Thu, 10 Aug 2000 04:47:48 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <MPG.13fcd156d6116e90989684@localhost>

Matthew Emmett wrote ..
>fvw+usenet@var.cx (fvw) writes:
>
>> I have the following code:
>> 
>> #!/usr/bin/perl -w
>> my $a='foo';
>> my $b="${a}${a}[";
>> print $b;
>
>perl is trying to look for the @a array when it see's ${a}[.  If you
>try 
>
>#!/usr/bin/perl -w
>use strict;
>
>you'll get a nicer error message.
>
>Try my $b="${a}${a}\["; instead.

and yet

  #!/usr/bin/perl -w
  $x = 'foo';
  print "${x}${x}[";

works without issue .. I think this is a bug .. the '{}'s should 
definitely resolve the scope of the scalars and mean that the '[' is not 
attempted

I don't think it's looking for @main::x .. I think it's looking for 
$main::x (for some reason) which is why providing a value for $main::x 
works just fine

if it thought that it was evaluating an array element then the error 
would be

  syntax error at - line 2, at EOF
  Missing right bracket at - line 2, within string
  Execution of - aborted due to compilation errors.

it's like two '{}' delimited scalars in a double quoted string forces 
one of them to be evaluated as a main:: but only when some '[' or '{' 
thing is involved .. egads !!

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 09 Aug 2000 22:23:24 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <39923C4C.D74AE176@la.znet.com>

jason wrote:

(snippage)

> and yet
 
>   #!/usr/bin/perl -w
>   $x = 'foo';
>   print "${x}${x}[";
 
> works without issue .. I think this is a bug .. the '{}'s should

(snipped)

You have not replicated the same conditions. You have
altered stated parameters and discarded strict.

My test of your code above yields different results
than you have announced. My tests yield the same
results as the original code given by the author.

Godzilla!


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

Date: Thu, 10 Aug 2000 05:57:08 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <MPG.13fce19740f3d632989689@localhost>

Godzilla! wrote ..

damn - I've been switching from a newsreader based killfile to an 
nfilter based killfile - I must have screwed up somewhere .. anyway

>jason wrote:
>
>(snippage)
>
>> and yet
> 
>>   #!/usr/bin/perl -w
>>   $x = 'foo';
>>   print "${x}${x}[";
> 
>> works without issue .. I think this is a bug .. the '{}'s should
>
>(snipped)
>
>You have not replicated the same conditions. You have
>altered stated parameters and discarded strict.

as usual - you're ignoring context .. here's the originator's code

  #!/usr/bin/perl -w
  my $a='foo';
  my $b="${a}${a}[";
  print $b;

there's no strict .. the strict was suggested by the first followup 
poster (Matthew Emmett) .. you're correct in that I combined the two 
last lines .. but I assure you that it makes no difference to the issue 
at hand

>My test of your code above yields different results
>than you have announced. My tests yield the same
>results as the original code given by the author.

this comment is put in complete context by your first comment which 
shows that you don't know what the 'original code' actually was

  *re-plonk*

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 09 Aug 2000 23:08:18 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <399246D2.2B3C7E62@la.znet.com>

jason wrote:

>   *re-plonk*

Thank goodness. Another ignorant jackass
by whom I won't be annoyed.

Godzilla!


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

Date: Wed, 09 Aug 2000 23:15:41 -0700
From: Savant_cubed <superegoNOsuSPAM@execs.com.invalid>
Subject: Who has used --------->  Net::Telnet   ????  Kick ASS  idea
Message-Id: <0092d81c.821796ec@usw-ex0101-008.remarq.com>

Does anyone know a better way to telnet to other servers ? I
keep getting timeout errors using the Net::Telnet module.
Everytime I try to Change directories once I've telnetted to
some server with ( cd /bin), it times out. Is there anyway I can
do this ? Please help. Email --> superego@execs.com
-
-
-
-
-  www.DanCclark.com
-
-
-
-


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Thu, 10 Aug 2000 13:00:20 +0800
From: unplug <unplug@poboxes.com>
Subject: why doesn't work
Message-Id: <399236E4.542C213A@poboxes.com>

Hi all,

  I have written the following code.

#!/usr/bin/perl -w

my $urlContent="";
$urlContent=`lynx -dump http://www.msn.com.hk/help/help0.asp`;

print "Content-type: text/html\n\n";
print "<html><head><title>TEST</title></head><body>";
print "<h2>$urlContent</h2><br>\n";
print "</body></html>";

It works fine in the console.  However, it doesn't work in the web
browser.
Does anyone know what's wrong with the code??

Rgds,
unplug


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

Date: Thu, 10 Aug 2000 06:08:42 GMT
From: sandhall@swipnet.se (Robert Hallgren)
Subject: Re: why doesn't work
Message-Id: <slrn8p4h94.7pr.sandhall@poetry.lipogram>

On Thu, 10 Aug 2000 13:00:20 +0800,
 unplug <unplug@poboxes.com> wrote:

[...]
> It works fine in the console.  However, it doesn't work in the web
> browser.

perldoc perlfaq9

  "My CGI script runs from the command line but not the browser."



Robert
-- 
Robert Hallgren <sandhall@swipnet.se>

PGP: http://www.lipogram.com/pgpkey.asc
5F1E 95C2 F0D8 25A3 D1BE 0F16 D426 34BD 166A 566C


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3972
**************************************


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