[7961] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1586 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 6 00:07:44 1998

Date: Mon, 5 Jan 98 21:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 5 Jan 1998     Volume: 8 Number: 1586

Today's topics:
     ADABAS C access: module, odbc, jdbc <jsellers@manatee.brev.lib.fl.us>
     Re: ADABAS C access: module, odbc, jdbc <boei@trifox.com>
     Re: Capturing STDERR on NT <swarren@eclipse.net>
     Re: Capturing STDERR on NT <wizard@eznet.net>
     Compiling Perl w/sfio on HPUX ????? <jens@tellux.de>
     DBI on NT installation problems <igor@iprint.com>
     Re: file globbing <ebohlman@netcom.com>
     GD Win32 vox@tomco.net
     Re: how do you get today's date for DateCalc ? (Martien Verbruggen)
     Re: I need money [Re: I need a script] <dformosa@st.nepean.uws.edu.au>
     Re: Lexical scope and embedded subroutines. <ajh@rtk.com>
     libwww-perl-5 and Win32 <mkishine@ix.netcom.com>
     Re: NEWBE: Triming an input string (Theo den Brinker)
     Re: newbie question: install perl on solaris 2.5.1 <joseph@5sigma.com>
     Re: perl manipulation of dbf(dBASE) or db(Paradox) file <ebohlman@netcom.com>
     Problem writing .pm file with Win32::Registry included <wespres@winternet.com>
     Re: require not working (Andrew M. Langmead)
     Re: require not working (Michael R Weholt)
     Re: Review of CGI/Perl book <joseph@5sigma.com>
     Re: Review of CGI/Perl book snailgem@aol.com
     Re: Run-time naming of packages: possible? <joseph@5sigma.com>
     Re: sending email (Net::SMTP).. problem <spam@spam.spam>
     Re: sending email (Net::SMTP).. problem <dformosa@st.nepean.uws.edu.au>
     Two-byte characters substitution ? (Wu)
     UNIX at job managment module/script? <Barry_Solow@msn.com>
     Re: Use modem as voice speed dialer? roertel@eeyore.stcloudstate.edu
     Using the "pack" function <dperdue@vec.net>
     Re: Using the "pack" function <ebohlman@netcom.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 05 Jan 1998 14:12:55 +0000
From: Jon Sellers <jsellers@manatee.brev.lib.fl.us>
Subject: ADABAS C access: module, odbc, jdbc
Message-Id: <34B0EA67.2AB38ECA@manatee.brev.lib.fl.us>

Hello all,

   I have an ADABAS C database running on two big IBM RS6000's. This is
not the version of ADABAS (D) that is a true RDBMS. I would like to give
WWW access to this data from Perl, but cannot find any way to access it.
Is there a module for ADABAS C? How about an ODBC or (preferrably) a
JDBC interface? I know I can access it with java or tcl, but perl would
better suit our needs. Thanks for any help.

Jon Sellers


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

Date: Mon, 05 Jan 1998 17:51:59 -0800
From: Bob Eisner <boei@trifox.com>
To: Jon Sellers <jsellers@manatee.brev.lib.fl.us>
Subject: Re: ADABAS C access: module, odbc, jdbc
Message-Id: <68s990$c2i@mtinsc03.worldnet.att.net>

Hi Jon,

Have a look at VORTEXperl and VORTEXjdbc from Trifox.  It will
allow you access ADABAS C (via Genesis or ADABAS SQL Server)
from Perl and JAVA applets.

VORTEXperl uses Perl Sockets so there is no need to re-build
the Perl runtime. You can obtain an evaluation copy of VORTEXperl
and VORTEXserver from our WEB site at:

    http://www.trifox.com/vortex/vtxperl.html

VORTEXjdbc is a Type 3 JDBC driver which supports ADABAS C (via
Genesis or ADABAS SQL Server). You can obtain an evaluation copy
of VORTEXjdbc and VORTEXserver from our WEB site at:

     http://www.trifox.com/vortex/vtxjdbc.html

VORTEXodbc is an ODBC driver which support ADABAS C (via Genesis
and ADABAS SQL Server).  It does not require the ENTIRE NET-WORK
product.

Regards,

Bob Eisner
408 369-2392



Jon Sellers wrote:
> 
> Hello all,
> 
>    I have an ADABAS C database running on two big IBM RS6000's. This is
> not the version of ADABAS (D) that is a true RDBMS. I would like to give
> WWW access to this data from Perl, but cannot find any way to access it.
> Is there a module for ADABAS C? How about an ODBC or (preferrably) a
> JDBC interface? I know I can access it with java or tcl, but perl would
> better suit our needs. Thanks for any help.
> 
> Jon Sellers


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

Date: Mon, 5 Jan 1998 19:56:23 -0500
From: "Stephen Warren" <swarren@eclipse.net>
Subject: Re: Capturing STDERR on NT
Message-Id: <68rvm7$sco$1@news.eclipse.net>

>I am having a hard time capturing STDERR on NT 4.0. Has anyone found a
way
>to do this with Perl?

Well, I've been told (and verified) that the following works for batch
files:

file.bat > logfile 2>&1

Will send all stderr and stdout to logfile.

However, I tried this out with "perl file.pl > logfile 2>&1" and the file
gets created, but no output gets written there - it's as though the Perl
startup routines always overwrite the stdout/stderr file descriptors or
something (not that the output gets sent to the console either...)

--
-----------------------------------------------------------------
Stephen Warren, Systems Engineer, Technology House Inc., New York
mailto:swarren@techhouse.com      http://www.techhouse.com/
mailto:swarren@eclipse.net        http://www.eclipse.net/~swarren/
            MIME, S/MIME and HTML mail are acceptable


Todd O'Connor wrote in message ...
>
>I am having a hard time capturing STDERR on NT 4.0. Has anyone found a
way
>to do this with Perl? I have a test that produces a lot of output and
want
>to capture all STDOUT and STDERR to a logfile for reviewing. There is the
>chance that STDERR could scroll off the screen and I wouldn't know it.
>
>
>Thanks,
>Todd
>toconnor@adobe.com



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

Date: Mon, 5 Jan 1998 21:43:42 -0500
From: "David A. Frantz" <wizard@eznet.net>
Subject: Re: Capturing STDERR on NT
Message-Id: <34b1997a.0@news.eznet.net>

Hmm;
I've been having a problem capturing stdout to my text editor.    Could this
be the same problem, it would be nice if there was a solution.

Thanks for any input

dave

Stephen Warren wrote in message <68rvm7$sco$1@news.eclipse.net>...
>>I am having a hard time capturing STDERR on NT 4.0. Has anyone found a
>way
>>to do this with Perl?
>
>Well, I've been told (and verified) that the following works for batch
>files:
>
>file.bat > logfile 2>&1
>
>Will send all stderr and stdout to logfile.
>
>However, I tried this out with "perl file.pl > logfile 2>&1" and the file
>gets created, but no output gets written there - it's as though the Perl
>startup routines always overwrite the stdout/stderr file descriptors or
>something (not that the output gets sent to the console either...)
>
>--
>-----------------------------------------------------------------
>Stephen Warren, Systems Engineer, Technology House Inc., New York
>mailto:swarren@techhouse.com      http://www.techhouse.com/
>mailto:swarren@eclipse.net        http://www.eclipse.net/~swarren/
>            MIME, S/MIME and HTML mail are acceptable
>
>
>Todd O'Connor wrote in message ...
>>
>>I am having a hard time capturing STDERR on NT 4.0. Has anyone found a
>way
>>to do this with Perl? I have a test that produces a lot of output and
>want
>>to capture all STDOUT and STDERR to a logfile for reviewing. There is the
>>chance that STDERR could scroll off the screen and I wouldn't know it.
>>
>>
>>Thanks,
>>Todd
>>toconnor@adobe.com
>




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

Date: 06 Jan 1998 02:39:15 +0100
From: Jens Lautenbacher <jens@tellux.de>
Subject: Compiling Perl w/sfio on HPUX ?????
Message-Id: <ls3ej2nzy4.fsf@britten.tellux.de>


Sorry if I sound desperate, but I am :-)

I need to get perl5.004_04 working with the experimental IO
abstraction layer and libsfio on HPUX 10.20.

It will break with a compile error (with both cc and gcc):


        Making Fcntl (dynamic)
make[1]: Entering directory `/chopin-db/kits/tmp/perl5.004_04/ext/Fcntl'
make[1]: Leaving directory `/chopin-db/kits/tmp/perl5.004_04/ext/Fcntl'
make[1]: Entering directory `/chopin-db/kits/tmp/perl5.004_04/ext/Fcntl'
gcc -c  -D_HPUX_SOURCE -I/usr/local/include -O    -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\" -fpic -I../..  Fcntl.c
In file included from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.7.2.3/include/stdlib.h:330,
                 from /usr/local/include/sfio.h:80,
                 from ../../perlsfio.h:5,
                 from ../../perlio.h:27,
                 from ../../perl.h:181,
                 from Fcntl.xs:2:
/usr/include/pwd.h:77: parse error before `*'
/usr/include/pwd.h:82: parse error before `*'
make[1]: *** [Fcntl.o] Error 1
make[1]: Leaving directory `/chopin-db/kits/tmp/perl5.004_04/ext/Fcntl'
make: *** [lib/auto/Fcntl/Fcntl.sl] Error 2



Also there are warning with any other file it compiles saying:

[for example] 
[...]
`sh  cflags libperl.a perlmain.o`  perlmain.c
          CCCMD =  gcc -DPERL_CORE -c -D_HPUX_SOURCE -I/usr/local/include -O   
In file included from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.7.2.3/include/stdlib.h:330,
                 from /usr/local/include/sfio.h:80,
                 from perlsfio.h:5,
                 from perlio.h:27,
                 from perl.h:181,
                 from perlmain.c:14:
/usr/include/pwd.h:77: warning: `struct _sfio_s' declared inside parameter list
/usr/include/pwd.h:77: warning: its scope is only this definition or declaration,
/usr/include/pwd.h:77: warning: which is probably not what you want.
/usr/include/pwd.h:82: warning: `struct _sfio_s' declared inside parameter list


Is there anybody who manged to get perl & sfio to compile on HPUX? I
didn't have any problems on linux, but simply don't know what to do
with this problem.

Thanks in advance,

	jtl



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

Date: Mon, 05 Jan 1998 16:48:35 +0000
From: igor <igor@iprint.com>
Subject: DBI on NT installation problems
Message-Id: <34B10EE3.AA9@iprint.com>

I am trying to install DBI 0.90 on NT 4.0, perl5.004_04.
I run nmake after "perl makefile.pl" and getting the following error:

DBI.def : error LNK 2001 : unresolved external symbol _boot_DB
DBI.def : error LNK 2001 : unresolved external symbol _boot_DB
blib\arch\auto\DBI\DBI.lib : fatal error LNK 1120 : 2 unresolved
externals
LINK : fatal error LNK1141 : faluire during build of export file
NMAKE : fatal error U1077 : 'link' return code '0x25'



 .. and so on.

Am I using a wrong distribution of DBI or I can get away by modifying
DBI.def (or someother) file contents or what do those errors mean?

Thanks.

Igor Pozdnyakov.


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

Date: Tue, 6 Jan 1998 01:26:00 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: file globbing
Message-Id: <ebohlmanEMC9BD.KMn@netcom.com>

Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk> wrote:

: e.g. Can I combine these two while...defined... bits?  
: # $card_prefix = "Gencard"; 
: while (defined ($card = glob ("$card_prefix*.*")) ){
:    @card_list = (@card_list, $card);
:    }

These three lines could be rewritten as:

push @card_list,glob("$card_prefix*.*");

Of course, if @card_list is initially empty, you might just as well write:

@card_list=glob(...);

: # $icon_prefix = "Genicon"; 
: while (defined ($icon = glob ("$icon_prefix*.*")) ){
:    @card_icons = (@card_icons, $icon);
:    } 

You could do something similar here, but...

: Can I do something neater for the next two lines:
: foreach $card (@card_list) { 
:    $icon = shift(@card_icons); 

OUCH!  You have no guarantee that your two lists are paired up; glob() is 
not required to return filenames in any particular order, and you've just 
been lucky that your particular directory structure has the names in the 
same order.  You'd better change those "push" lines to:

push @card_list,sort glob("$card_prefix*.*");

(and the same thing for @card_icons), which will ensure that the two 
lists are in the same order.


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

Date: Mon, 05 Jan 1998 20:54:55 -0500
From: vox@tomco.net
Subject: GD Win32
Message-Id: <34B18EEF.7E4F@tomco.net>

All,

I tried to install the GD.pm module on NT with recent (month or two old)
activestate port.

I got a parse exception. Saw this in Stein's readme:

    David Roth has done a port to Windows NT/95.  You can find it at:
    http://roth.net/users/rothd/HOME.HTM

   Be sure to download the .DLL library version that is correct for your
   Perl interpreter.  If there is a mismatch, you may encounter a
   "parse error" message.

I don't know what this means. There's a 6/96 and a 10/96 GD. The 10/96
mentions build 106 or greater. I was trying 10/96 copy. Later tried the
6/96 copy on Win95 with build 300+. Links to roth.net didn't seem to
work today.

Please send any clues to rliming@uu.net

Thanks,
Rich


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

Date: 6 Jan 1998 02:10:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how do you get today's date for DateCalc ?
Message-Id: <68s3rh$30v$1@comdyn.comdyn.com.au>

In article <68qoa1$1br11@aken.eed.ericsson.se>,
	eedalf@eed.ericsson.se (Alexander Farber) writes:

> i am using the very comfortable module DateCalc, 

I suppose this is Date::DateCalc?

> But i think it is not the best way: localtime is being
> called 3 times and then the complicated decode_date.
> So what is your way?

How about:

#!/usr/local/bin/perl -w
use strict;
use Date::DateCalc qw(:all);

my @ltime = localtime;

# Since the Date::DateCalc function expect a date in the format
# (yyyy, mm, dd) with mm being from 1 to 12:

my @datecalc_today = ($ltime[5] + 1900, $ltime[4] + 1, $ltime[3]);

# Now just call any Date::DateCalc function with that list:

check_date(@datecalc_today) and
	print date_to_string(@datecalc_today), "\n";

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: 6 Jan 1998 02:58:07 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: I need money [Re: I need a script]
Message-Id: <884055470.317915@cabal>
Keywords: from just another new york perl hacker

In <comdog-ya02408000R0301980358010001@news.panix.com> comdog@computerdog.com (brian d foy) writes:

>In article <34ADDDBB.DF4D1B57@5sigma.com>, joseph@5sigma.com posted:

>>I have a bank account that I want to have users add money.  It would
>>be great if someone could send money to it, using the $20 and $50
>>format please 

>your rates have a granularity of $20?

Interesting fact,  you can get any multipal of 10 greater then 70 by the
combernations of $20 and $50.

For extra points prove the above by use of indution.


--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Mon, 5 Jan 1998 20:33:05 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: Lexical scope and embedded subroutines.
Message-Id: <68sc4k$3p2$1@brokaw.wa.com>

Tom Phoenix wrote in message ...
>Each time you call What_is..., it gets a new my() variable called $param.
>But the $param in embeddedsub is the one from the first call; it's neither
>regenerated with each new call nor somehow connected to the latest or
>current invocation of What_is.... Hope this helps!


Before I read this thread (and perlsub to get the details) I would have
assumed the original code was fine.

This behavior brings up the following questions:
  o Is Perl's behavior some sort of speed optimization?
  o Did the Perl gods just decide that scheme-like behavior was less
important than the pseduo-static variables described in perlsub?
  o Does anyone else find Perl's behavior counter-intuitive?
  o Did programming in scheme destroy my ability to judge a decent language
feature?
  o Have I misremembered how scheme handles these situations?
  o Do Perl programmers really care how much Perl acts like scheme?
  o Should I have stopped this message two or three questions ago?

Aaron Harsh
ajh@rtk.com




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

Date: Mon, 05 Jan 1998 21:25:29 -0500
From: Michael Kishinevsky <mkishine@ix.netcom.com>
Subject: libwww-perl-5 and Win32
Message-Id: <34B19618.2552@ix.netcom.com>

I am trying to use libwww-perl-5 package with WIN32 build of perl.
When I am start lwp-request script with the following command line:

perl  lwp-request.pl http://www.bridge.com/index.html

I recveive the follwoing error:

Can't locate auto/LWP/UserAgent/env_proxy.al in @INC at lwp-request.pl
line 292

When I run the same script under debugger, I receive following:

Can't locate auto/LWP/UserAgent/env_proxy.al in @INC at lwp-request.pl
line 292
Carp::croak called at D:\bin\perl5\lib/AutoLoader.pm line 124
AutoLoader::AUTOLOAD called at lwp-request.pl line 292

Here is the results of runnign perl -V:

Summary of my perl5 (patchlevel 1) configuration:
  Platform:
    osname=MSWin32, osver=3.51, archname=i386-win32
    uname=''
    hint=recommended
  Compiler:
    cc='cl', optimize=''
    cppflags=''
    ccflags =''
    ldflags =''
    stdchar='char', d_stdstdio=, usevfork=false
    voidflags=15, castflags=0, d_casti32=, d_castneg=
    intsize=4, alignbytes=4, usemymalloc=n, randbits=15
  Libraries:
    so=dll
    libpth=
    libs=
    libc=
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=pll, d_dlsymun=
    cccdlflags='', ccdlflags='', lddlflags=''


Characteristics of this binary (from libperl):
  Built under MSWin32
  Compiled at Nov  4 1997 13:30:50
  @INC:
    D:/tmp/libwww-perl-5.00/lib
    D:\bin\perl5\lib\i386-win32
    D:\bin\perl5\lib
    .

If anybody knows how to make libwww-perl-5 work under WIN32, please let
me know.

Thank you.
Michael Kishinevsky.
mkishine@bridge.com



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

Date: Tue, 06 Jan 1998 09:02:06 +0700
From: theo@bangkokpost.net (Theo den Brinker)
Subject: Re: NEWBE: Triming an input string
Message-Id: <theo-0601980902060001@10.0.2.15>

In article <34ad3433.11292567@news.on-net.net>, djboyd@sam.on-net.net wrote:

> How does one trim a string.  That is, like in VB you can issue a
> command such as ltrim which will remove all spaces etc, on the left
> hand of the string and same for rtrim.  How does one do this in perl.
> that is remove spaces, tabs and new line on the right hand side of a
> string.
> ...
> TIA

Use regular expression substitution

$the_string_you_want_to_trim =~ s/^\s*(.*)\s*$/$1/;

(page 73 - Programming Perl - Wall, Christiansen, Schwartz - O'Reilly & Assoc)


My own explanation

 the substute command  s/ - the find bit
                           ^ from the start of the lline
                           \s* 0 or more white space
                           (.*?) any number of characters
                                    - minimal match - the ?
                                    - the brackets save the found test 
                                     to variable $1
                           
                           \s* 0 or more white space to
                           $ end of the line.
                        /$1/ - replace with the text assigned to $1

Theo


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

Date: Mon, 05 Jan 1998 18:58:32 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: newbie question: install perl on solaris 2.5.1
Message-Id: <34B18F22.B61B99D0@5sigma.com>

Beats me.  Really.  How about some output from your install
attempt?  Installing as root should not make any difference.

	-joseph

Achim Selz wrote:
> 
> I try to install perl 5.004_04 on a Sun Netra with Solaris 2.5.1.
> Configure correctly detects the Solaris 2 system and then hangs. Any
> hints? BTW, I am installing as root.


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

Date: Tue, 6 Jan 1998 01:09:31 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: perl manipulation of dbf(dBASE) or db(Paradox) files?
Message-Id: <ebohlmanEMC8Jv.Inr@netcom.com>

Don Hayward <don@marinelab.sarasota.fl.us> wrote:
: I'm looking for perl modules to read, write, etc. (dbf) dBASE and (db)
: Paradox files.  Thanks for any help.

The modules on CPAN for manipulating .dbf files go by the name of XBase 
or Xbase (these are two different modules with somewhat different 
capabilities).  I don't know offhand what's available for Paradox, but if 
there is something, it's likely to be on CPAN.



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

Date: Mon, 05 Jan 1998 21:52:07 -0600
From: Wesley Preston <wespres@winternet.com>
Subject: Problem writing .pm file with Win32::Registry included
Message-Id: <34B1AA66.3AFA4D5A@winternet.com>

Hello there.

I'm trying to write a .pm module file in Perl 5 and am having a
problem.  I have a script that is calling subroutines in the .pm file
that I've built.  Several other subs are called from the .pm file are
run through without problem and return to the parent script.  I am
running into a problem when I call one of the subs that uses
Win32::Registry to read and modify registry settings.  When runnint the
script, I fail on this line:
 $HKEY_LOCAL_MACHINE->Open($Register,$hkey);

I am getting a an error that states:
"Can't call method 'Open' without a package or object reference at
Tiv_inst.pm line..."

I'm calling the sub from the main script with:

    $ret_si = &Shared_dll_increment($filename);

The contents of the sub are shown below. (Shared_dll_increment)

When the subroutine is cut and pasted directly into the .pl file that is
calling the sub (from the .pm file) it works perfectly.

The beginning of the file includes:
-----------------------------------------------
package Tiv_inst;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(Backup Verify Recovery Registry_backup Registry_restore
Semaphor Error Logit Update_latest Shared_dll_increment
Shared_dll_decrement Cleanup);
@EXPORT_OK = qw($ll_abort);
------------------------------------------------
The Perl build I'm using is:
    5.003_07 Build 36 by ActiveWare for Win32

I'm currently running the script on an NT box.

Any help would be appreciated.  Please send responses to both the
newsgroup and my e-mail directly.  I can't see newsgroups from work but
can retrieve my mail.  Thank you.

Wes Preston
wes@forgegroup.com


===========================================
sub Shared_dll_increment {

##
##      Shared_dll_increment
##
# Increases the count on a shared dll registry entry

## Called from the code with:
##
##  $value_name = "$sys32path\\ivtrn09.dll";
##  &Shared_dll_decrement($value_name);
##

 my $key_name = @_[0]; #second passed parameter
 my $Register =
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs";
 my $ll_found = 0;

 my $hkey, $value;
 my %values;
 undef $garbage;

 use Win32::Registry;
 $HKEY_LOCAL_MACHINE->Open($Register,$hkey);
  #'opens' up access to the HKLM keys
 undef %values;
 %values = ();
 $hkey->GetValues(\%values); #puts key values, types, and data into an
array

 foreach $value (keys(%values)) {
  $RegType = $values{$value}->[1];
  $RegValue = $values{$value}->[2];
  $RegKey = $values{$value}->[0];

# This only works for RegType = 4
  if ("\U$RegKey\E" eq "\U$key_name\E") {
   $dec_value = ord $RegValue;
   $dec_value++;
   $hkey->SetValueEx($RegKey,$garbage,$RegType,$dec_value);
   $ll_found = 1;
  }
 }

 if ($ll_found == 0) {
  $RegType = 4;
  $RegValue = 2;
  $RegKey = $key_name;
  $hkey->SetValueEx($RegKey,$garbage,$RegType,$RegValue);
 }

 $hkey->Close();
 $return = 0;
}




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

Date: Tue, 6 Jan 1998 02:21:28 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: require not working
Message-Id: <EMCBvt.12J@world.std.com>

gt2863a@acmey.gatech.edu (Mark) writes:

>: unshift (@INC, "L:\\scripts\\mec\\subs");
>: require ("test_too.pl");

>: I am using this code to get to my test_too.pl subroutine.

>Okay I am hitting a NT server and the script is "not working" in the
>fact that it simply returns "Document contains no data"

When a perl script encounters a compile time or run time error, it
emits some sort of message to the standard diagnostic stream (the same
place that perl puts anything sent to the STDERR filehandle). All of
the error message that perl outputs should be able to be looked up in
the "perldiag" man page for a detailed explaination of the error.

If you server (I assume http server) swallows up these diagnostic
messages without recording them somewhere, that would be, um,
unfortunate.

Check your servers documentation, it might save these errors and
warnings in a log file somewhere. Reading the error messages and
looking them up would probably be more productive than having all of
Usenet guess at the problem. (Of course if you find the error message,
look it up, and are still stumped, we're glad to help.) Also if you
use the CGI module, its companion CGI::Carp module has a
"fatalsToBrowser" mode that redirects error messages to your browser's
window for easy access. Also, you might want to look into some method
of testing your script without a browser, like the CGI module's
offline mode.

Anyway, my guess on what is wrong is that you are not creating a file
that can be properly "require"d. When perl loads a file with
"require", it compiles and runs the code in the file. If the last
statement of that file is not a boolean true value, it treats that as
a condition where the "require"d file is signaling that it determined
some sort of error, and that the program should abort. A sample
library file might look this:

     # this is a sample library file that defines a subroutine named
     # return_list

     sub return_list {
        return 'a' .. 'z';
     }

     # the following line is to tell perl that the library loaded correctly.
     1;

If this isn't the solution, try to find the error message that perl
sends out before it exits. It will make it much easier for us to try
to solve your problem.

-- 
Andrew Langmead


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

Date: Tue, 06 Jan 1998 03:35:02 GMT
From: awnbreel@panix.com (Michael R Weholt)
Subject: Re: require not working
Message-Id: <68s8p6$3d0_002@mrw.panix.com>

In article <EMCBvt.12J@world.std.com>, 
aml@world.std.com (Andrew M. Langmead) wrote:
>gt2863a@acmey.gatech.edu (Mark) writes:
>
>>: unshift (@INC, "L:\\scripts\\mec\\subs");
>>: require ("test_too.pl");
>
>>: I am using this code to get to my test_too.pl subroutine.
>
>>Okay I am hitting a NT server and the script is "not working" in the
>>fact that it simply returns "Document contains no data"
>
>When a perl script encounters a compile time or run time error, it
>emits some sort of message to the standard diagnostic stream (the same
>place that perl puts anything sent to the STDERR filehandle). All of
>the error message that perl outputs should be able to be looked up in
>the "perldiag" man page for a detailed explaination of the error.
>
>If you server (I assume http server) swallows up these diagnostic
>messages without recording them somewhere, that would be, um,
>unfortunate.

I'm not an Expert or anything, but when I was having a problem with a 
"require", I commented out everything in the script except that which 
was required to run the require, then I put the require statement in 
an eval, i.e.:

eval { require("test_too.pl"); };

which put an error message into $@ when the require failed.  I then:

print "Content-type: text/html\n\n";
print $@;

Maybe this was a bonehead way to do it, but I at least got some clue 
as to what the problem was.

-- 
 mrw


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

Date: Mon, 05 Jan 1998 18:54:07 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Review of CGI/Perl book
Message-Id: <34B18E19.7D25B6F2@5sigma.com>

Having gone back to Dejanews to inspect it, I don't think
there was a great abuse of Randal's original quote.  Maybe it
wasn't trimmed exactly as he would have liked, but it wasn't
like they turned black into white.  This is probably more a
lesson for someone writing a review/endorsement than anything 
else.  :-)

	-joseph

brian d foy wrote:
> > 
> read Randal's comments yourself.  it would be a very difficult task to
> assure me that the quote was not taken out of context when Randal has
> already publically demonstrated that it was:


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

Date: Mon, 05 Jan 1998 23:08:50 -0500
From: snailgem@aol.com
Subject: Re: Review of CGI/Perl book
Message-Id: <34B1AE51.57FA@aol.com>

I was intrigued by this thread and decided to follow the advice and read
the comments myself.
My 2 cents: to argue that Randal Schwartz's comments have been taken out
of context is pure sophistry. What's more, had the editor kept the whole
paragraph (without the 'Perl 4 is dead' part, which Randal clearly
didn't expect to make it)  thus keeping it 'in context', Randal's
endorsment of this book would have been even stronger.

brian d foy wrote:

> 
> read Randal's comments yourself.  it would be a very difficult task to
> assure me that the quote was not taken out of context when Randal has
> already publically demonstrated that it was:
> 
>    Subject:      Re: the skinny on my() vs local() -  thanks to all
>    From:         Randal Schwartz <merlyn@stonehenge.com>
>    Date:         1997/12/07
>    Message-ID:   <8cpvn8io5w.fsf@gadget.cscaper.com>
>    Newsgroups:   comp.lang.perl.misc
> 
> --
> brian d foy                                  <comdog@computerdog.com>
> Fifth Avenue Disaster! <URL:http://computerdog.com/brian/fire/>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Mon, 05 Jan 1998 19:00:48 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Run-time naming of packages: possible?
Message-Id: <34B18FAA.ABA70A35@5sigma.com>

You need to use string eval:

  eval "
    package $class;
    ...
  ";

Or using qq quoting:

  eval qq{
    package $class;
    ...
  };

There are also other ways to achieve run-time naming, but they
aren't as obvious the first time through.

	-joseph
	 http://www.effectiveperl.com

Richard West wrote:
> 
> Hi,
> 
> Does anybody know if (and/or how) it's possible to name a module at
> run-time (or should that be load-time)? I want to do something like
> this...
> 
> sub load_module {
>     my $class=shift;
> 
>     eval {
>         package $class;
>         require "$class.pm";
>     };


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

Date: Tue, 06 Jan 1998 03:02:49 +0000
From: catty <spam@spam.spam>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <34B19ED9.34F052A9@spam.spam>

Graham Barr wrote:

> The I would suggest you read up a bit more on mail, before
> you start flaming people.

Good advice ... you should take it.


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

Date: 6 Jan 1998 03:56:01 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: sending email (Net::SMTP).. problem
Message-Id: <884058942.558011@cabal>

In <34B0ED52.CA7BC756@ti.com> Graham Barr <gbarr@ti.com> writes:

[...]

>I know it is legitimate, I did not say it was not, I was just
>trying to point out that SPAMmers use this techneque to avoid
>the "junk mail" being traced back to them. And so is a good
>target for filtering out unwanted mail.

Spammers are more likely to point there devices at totaly unrealated
servers so to relay them and make it difficalt to block.  I haven't ever
heard of your tactic being used.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 6 Jan 1998 04:32:10 GMT
From: weihan@ziyou.math.ncu.edu.tw (Wu)
Subject: Two-byte characters substitution ?
Message-Id: <68sc4a$8vs$1@news.ncu.edu.tw>

I use perl to match Chinese characters which are two-byte oriented.
I know it is not easy for perl to handle the match.  However, here
is the problem that I don't know how to solve.  

I have a Chinese character with rear part of its two-byte is "[" , 
which has special meaning in regexps and will certainly get compilation
error.  How am I supposed to do ?   

--
Wu, Weihan 
weihan@math.ncu.edu.tw


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

Date: Mon, 5 Jan 1998 23:18:49 -0500
From: "Barry and Beverly Solow" <Barry_Solow@msn.com>
Subject: UNIX at job managment module/script?
Message-Id: <eyCqYplG9GA.276@upnetnews03>

I have to write something in perl which will allow people who are not very
familiar with UNIX to schedule, review, and manage a large number of 'at'
jobs.  The specifications are still being worked out but we have some idea
of what it should do. It will have to prompt users for date, time, and the
command to run.  It should allow them to enter dates in MM/DD/YY format but
it need not allow them to enter dates in all the formats 'at' will accept.
It would be nice to allow the scheduling of multiple 'at' jobs by accepting
date ranges. It will have to selectively list jobs based on the commands
they will run and on the dates and times they will run.  It will also have
to display the dates of jobs in comprehensible format and, since the
commands will all be one-liners, the command 'at' will run.

This is a very different, much bigger program than what I am accustomed to
writing.  I would be grateful for any pointers or thoughts.  Has this, or
any part of it, been implemented in perl before?

Thanks for any light you can shed.

Barry Solow
Davis Polk & Wardwell
New York, NY




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

Date: Tue, 06 Jan 1998 03:46:16 GMT
From: roertel@eeyore.stcloudstate.edu
Subject: Re: Use modem as voice speed dialer?
Message-Id: <34b1a88f.25703362@news.msus.edu>

On Sun, 4 Jan 1998 23:11:40 GMT, dougb@world.std.com (doug a
blaisdell) wrote:

>Hi Everybuddy!
>I'd like to use my modem to do my voice telephone dialing for me.
>I know there's a win95 utility for this, but I wanted to do it on
>Linux, preferably using Perl. I've gotten to the point where I can
>do the dialup OK, but I don't know how to tell the modem to give
>control to the telephone, after somebody answers the phone.
>
On my modem, if you simply hang up, the modem will hang up, but the
phone connected to the modem will take over.  For example, when I'm
on-line, I pick up the phone, but there is nothing.  When I disconnect
from the internet, though, the phone hisses.  


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

Date: Mon, 05 Jan 1998 19:59:56 -0500
From: David <dperdue@vec.net>
Subject: Using the "pack" function
Message-Id: <34B1820C.14D58569@vec.net>

Hi,

I'm just begining to learn PERL.  I feel comfortble going thru "Learning
Perl" book, but there is one area that I am having trouble with. the
manpage for perl wasn't a lot of help to me either.

1. Would someone please explain the "Pack" option to me in laymans
terms? 
   The man page shows Soooo  many options for templates that I have no
idea what's going on with this one.

In case your wondering, assume no programming knowledge!

Thanks a lot.

--dp


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

Date: Tue, 6 Jan 1998 01:40:15 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Using the "pack" function
Message-Id: <ebohlmanEMC9z3.MFv@netcom.com>

David <dperdue@vec.net> wrote:
: I'm just begining to learn PERL.  I feel comfortble going thru "Learning
: Perl" book, but there is one area that I am having trouble with. the
: manpage for perl wasn't a lot of help to me either.

: 1. Would someone please explain the "Pack" option to me in laymans
: terms? 
:    The man page shows Soooo  many options for templates that I have no
: idea what's going on with this one.

: In case your wondering, assume no programming knowledge!

Quite seriously, you need to acquire some more programming knowledge 
before any description of what pack() does will make sense to you.  You 
generally need to use it only when you're trying to "pack up" a data 
structure for use by another program or process, so until you find 
yourself needing to do that, you can put off thinking about pack() and 
unpack().  Perl functions are, IMHO, best learned "just in time"; trying 
to memorize them all as you're learning the language is pointless and futile.



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1586
**************************************

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