[6415] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 40 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 3 11:29:38 1997

Date: Mon, 3 Mar 97 08:00:28 -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, 3 Mar 1997     Volume: 8 Number: 40

Today's topics:
     [Q] Extract a regex <vegardb@knoll.hibu.no>
     Re: [Q] Extract a regex (Dave Thomas)
     ANYONE COMPILE PERL 5.003 FOR LINUX? <Larry@softech-consulting.com>
     Re: Are 'or' and '||' *really* equivalent? (Markus Laker)
     Beginner - simple problem (Mark Turner)
     Re: Beginner - simple problem (Dave Thomas)
     Best way to return a hash from XSUB <softstar@pol88a.polito.it>
     Re: Can you create file on the fly with perl? (Christopher Masto)
     File reading error <Joe.Kline@sdrc.com>
     Form Data (Tim McKula)
     Graphical Perl for Win32 (Markus Laker)
     Help needed (Cesar GM)
     Re: HELP: Is there some standard code to filter out htm <meissner@wattenmeer.pixelpark.com>
     Re: How big is big? (M.J.T. Guy)
     Re: How to sort blocks in a file? <flg@vhojd.skovde.se>
     IP Address to Host Name code WANTED (Mark Perkins)
     Re: libdl.a archive... (Matthias Urlichs)
     Re: No "sys/socket.ph" on Solaris? <mcampbel@tvmaster.turner.com>
     Numeric value expected... (Daniel Drennan)
     Re: Numeric value expected... (Dave Thomas)
     Re: Perl on NT 4.0 - HOW? <dean@tbone.biol.sc.edu>
     Re: Perl5/Tk for Win95/NT (Craig S. Riter)
     Re: PerlIS+Win32::ODBC - Can't call method "Sql"... <rothd@roth.netX>
     Re: Problems seeing files thru links/NSF? (Michael Constant)
     Re: system( 'dialog', ...) and redirection (Honza Pazdziora)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Mon, 03 Mar 1997 15:56:24 +0100
From: Vegard Bakke <vegardb@knoll.hibu.no>
Subject: [Q] Extract a regex
Message-Id: <331AE698.67D4@knoll.hibu.no>

I would like to "move" the matching pattern from a regex in
a string to a new variable.

Lets use the three first random cahacters as an example ( /^.{3}/ ).
$OrgStr="1234567890";
$NewStr="";
In this example I would like the result to be:
$OrgStr="4567890";
$NewStr="123";

This is just an example. I after a solution that does this with
any regex. (Not only /^.{3}/.)



Vegard

-- 
                           Vegard Bakke,
                       vegard.bakke@hibu.no
               Kirkegata 9, 3600 Kongsberg, Norway

   "My spelling is Wobbly.  It's good spelling but it Wobbles, 
and the letters get in the wrong places."      --  Winnie the Pooh


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

Date: 3 Mar 1997 15:26:58 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: [Q] Extract a regex
Message-Id: <slrn5hlr7h.tca.dave@fast.thomases.com>

On Mon, 03 Mar 1997 15:56:24 +0100, Vegard Bakke <vegardb@knoll.hibu.no> wrote:
> I would like to "move" the matching pattern from a regex in
> a string to a new variable.
> 
> Lets use the three first random cahacters as an example ( /^.{3}/ ).
> $OrgStr="1234567890";
> $NewStr="";
> In this example I would like the result to be:
> $OrgStr="4567890";
> $NewStr="123";
> 
> This is just an example. I after a solution that does this with
> any regex. (Not only /^.{3}/.)

Well, here's a solution that uses just about every inefficiency in Perl
regex's I can think of:


$pattern = '.{3}';

for $pattern (qw( .{3} 56 [3-6]{2} wombat)) {
  $OrgStr = '1234567890';
  $NewStr;

  if ($OrgStr =~ /$pattern/) {
    ($OrgStr, $NewStr) = ("$`$'", $&);
    write;
  }
  else {
    print "$pattern - no match\n";
  }
}

format STDOUT = 
@<<<<<<<<  @<<<<<<<<<< @<<<<<<<<<<
$pattern,  $OrgStr,    $NewStr
 .




-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Mon, 03 Mar 1997 10:00:18 -0500
From: Larry <Larry@softech-consulting.com>
Subject: ANYONE COMPILE PERL 5.003 FOR LINUX?
Message-Id: <331AE782.389C@softech-consulting.com>

Has anyone successfully compiled PERL 5.003 for LINUX?
I've tried about 100 different response sets for Configure.sh, and
no matter what I do, I get the following message toward the end of
the first make process:

make: *** [makefile] Error 2

This comes after the recursive collection of MAKEDEPEND's
"entering directory" and "leaving directory" messages.

Anyone have any suggestions?  I'd sincerely appreciate it.

Please email to Larry@softech-consulting.com 

Thanks!


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

Date: Mon, 03 Mar 1997 14:44:00 GMT
From: mlaker@contax.co.uk (Markus Laker)
Subject: Re: Are 'or' and '||' *really* equivalent?
Message-Id: <5feo5t$hu0$1@newsserver.dircon.co.uk>

cjewell@cellnet.com (Cal...) wrote:

> #!/bin/perl -w

> my ($falseValue, $trueValue, $result);

> $falseValue = 0;
> $trueValue = 1;

> $result = $falseValue || $trueValue;
> print "\$result is $result\n";
> # yields         $result is 1

> $result = $falseValue or $trueValue;
> print "\$result is $result\n";
> # yields         $result is 0

> I don't get it.

The bug is in the line that says

	$result = $falseValue or $trueValue;

because 'or' has lower precedence than '='.  So this line is parsed as

	($result = $falseValue) or $trueValue;

Try adding some brackets, like this:

	$result = ($falseValue or $trueValue);

and everything will work.

(Those're British brackets, by the way: ours are round by default.  We
also talk about {braces} and [square brackets].)

[Mailed and posted.]


Markus Laker



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

Date: 3 Mar 1997 11:42:48 GMT
From: turnerm@cs.man.ac.uk (Mark Turner)
Subject: Beginner - simple problem
Message-Id: <5fedfo$vv@m1.cs.man.ac.uk>


Hi,

I am a newcomer to perl and as much I am enjoying using perl I have a little problem.  In my program I need the directory path.  I am trying to use the UNIX pwd command from perl, using the system() command, and trying to put the result into a variable $original_dir.  I have tried things like



system("pwd >$original_dir");

system("(pwd; >$original_dir &");




without any success.

Can anybody help please.

Cheers,

Mark Turner....


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

Date: 3 Mar 1997 15:10:30 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Beginner - simple problem
Message-Id: <slrn5hlq8j.tca.dave@fast.thomases.com>

On 3 Mar 1997 11:42:48 GMT, Mark Turner <turnerm@cs.man.ac.uk> wrote: > >
> Hi,  I am a newcomer to perl and as much I am enjoying using perl I have
> a little problem.  In my program I need the directory path.  I am trying to
> use the UNIX pwd command from perl, using the system() command, and trying
> to put the result into a variable $original_dir.  I have tried things like 

> system("pwd >$original_dir");

>From the perlfunc documentation:

      system LIST
                    Does exactly the same thing as "exec LIST" except
                    that a fork is done first, and the parent process
                    waits for the child process to complete.  Note
                    that argument processing varies depending on the
                    number of arguments.  The return value is the exit
                    status of the program as returned by the wait()
                    call.  To get the actual exit value divide by 256.
                    See also the exec entry elsewhere in this
		    document.  This is NOT what you want to use to
                    capture the output from a command, for that you
                    should merely use backticks, as described in the
                    section on STRING in the perlop manpage.

So, 

   $original_dir = `pwd`;
   
However, have you looked at the Cwd module?

Regards

Dave

ps - any way you can enable word wrapping in your news poster? Your post was
all one long line.



-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Mon, 03 Mar 1997 14:54:28 +0100
From: Enrico Badella <softstar@pol88a.polito.it>
Subject: Best way to return a hash from XSUB
Message-Id: <331AD814.3273@pol88a.polito.it>

Hello,

I'm writing some C extensions and need to return an associative array to
the caller.
Currently I am creating my on variable with perl_get_hv(), but probably
the user
would prefer to call my library and assign the resulting hash to his
variable. 

Which is the best way to return a hash from a XSUB? I tried creating a
reference, blessing it then returning but id does not seem to work

	outAA = newRV(result);
    	sv_bless(outAA, gv_stashpv("ebrtest", FALSE));
    	EXTEND(sp, 1);
    P	USHs(sv_2mortal(outAA));    

What am I doing wrong?

Thanks in advance

eb


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

Date: 3 Mar 1997 15:54:30 GMT
From: exidor@nimbus.superior.net (Christopher Masto)
Subject: Re: Can you create file on the fly with perl?
Message-Id: <5fes7m$e6f@news.webspan.net>

In article <331A3BC8.FB37ADB@uconect.net>,
Bill Kuhn  <wkuhn@uconect.net> wrote:
>Christopher Masto wrote:
>> In article <33135689.FFC67E3@uconect.net>,
>> Bill Kuhn  <wkuhn@uconect.net> wrote:
>> >You can open it for writing and close it using
>> >open(FILE,">$filename") ;
>> >close(FILE) ;
>> >of use the unix touch command (if you are on unix) using
>> >system("touch $filename")
>> 
>> $filename = "harmless; rm -rf /";
>
>Are you telling me that whatever I pass to system() will be executed, so
>I shouldn't pass it anything that I don't want executed?  It will do
>exactly what I ask it to?

Actually, I'm pointing out that the use of the one-argument system()
is very dangerous.  Consider what could happen if the user were
prompted for that filename.  It would do exactly what THEY ask it to.

There is the option of system("touch", $filename), which avoids the
/bin/sh, and this this particular problem.

You may be aware of this, but the gentleman who asked the original
question may not be, and since we don't know whence he gets his
filename, caution is indicated.
-- 
Christopher Masto  .   .   .   .   NetMonger Communications
chris@masto.com  .   .   .   .   . Masto Consulting:           info@masto.com



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

Date: Mon, 03 Mar 1997 08:12:38 -0500
From: Joe Kline <Joe.Kline@sdrc.com>
Subject: File reading error
Message-Id: <331ACE45.31DF@sdrc.com>

wizards,

background details: perl4 script being run through a cron job
                    opening a file and writing to it

problem: get the following errors, but the script works fine they
         annoy me to no end

the error:
Read on closed filehandle <MASTERREP> at line 242

the code snippet:
 235  #  open master.rep file and read into memory
   236
   237     $file = "$result_dir/master.rep";
   238     open(MASTERREP,"<$file");
   239
   240  #  sort file and write to an array
   241     @masterrep = ();
   242     @masterrep = sort(<MASTERREP>);
   243     close(MASTERREP);   #  close master.rep file


many thanks,

joe

--

/===================================================\
| Joe Kline                       | Try not.        | insert
| Quality Maintenance and Support | Do or do not.   |   standard
| Product Modeling                | There is no try.|      disclaimer
| Phone (513) 576-5839            |                 |          here
| E-Mail: Joe.Kline@sdrc.com      |      -Yoda      |
\===================================================/


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

Date: 1 Mar 1997 18:57:50 GMT
From: tmckula@citcom.com (Tim McKula)
Subject: Form Data
Message-Id: <5f9u7e$rh0@news1.infoave.net>

I have set my ENCTYPE="multipart/form-data" inside the <FORM ACTION> tag, but 
the data is returned via tha Attachment file. The mime type in my browser is 
set to multipart/form-data. How can I recieve the data without viewing three 
separate documents. Thanks.



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

Date: Mon, 03 Mar 1997 14:59:51 GMT
From: mlaker@contax.co.uk (Markus Laker)
Subject: Graphical Perl for Win32
Message-Id: <5fep3l$i00$1@newsserver.dircon.co.uk>

I use Perl heavily at work, and it's a life saver.  If I could be
granted one wish, though, it would be a graphical version for Win32 so
that I could write little apps with pretty front ends for all my
Windows 95 lusers.  Er, users.

It's pretty obvious from looking around that no such beast exists at
the moment.  But does anyone know of a graphical Perl for Win32 that's
coming in the future?  It wouldn't matter if (for example) I had to
provide my own resource compiler, as long as I didn't have to do
masses of configuration on every machine that was going to run a Perl
script.

In hope,



Markus Laker



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

Date: 3 Mar 1997 15:24:37 GMT
From: cmora@bebe.eleinf.uv.es (Cesar GM)
Subject: Help needed
Message-Id: <5feqfl$18c9@power.ci.uv.es>

I would like to know how can I do the reverse thing to this:

 # Convert %XX from hex numbers to alphanumeric
    $key =~ s/%(..)/pack("c",hex($1))/ge;
    $val =~ s/%(..)/pack("c",hex($1))/ge;

that means putting in $key and $val the hex values of all non-numeric,
non-letters.

Thank you, and please reply to cmora@bebe.uv.es

--


------------------------------------------------------------------------------
Cesar Gomez-Mora Lopez                      '-Hermanos todos somos diferentes! 
Ingenieria Informatica                       -oye, yo no.'   
Universidad de Valencia                      Monthy Phyton's Life of Brian 
Campus de Burjassot 
http://bebe.uv.es/~cmora
------------------------------------------------------------------------------
@)-


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

Date: 03 Mar 1997 15:33:17 +0100
From: Frank Meissner <meissner@wattenmeer.pixelpark.com>
Subject: Re: HELP: Is there some standard code to filter out html tags.
Message-Id: <syvd8thgi4y.fsf@wattenmeer.pixelpark.com>

mark@weymouth.gov.uk (Mark Perkins) writes:

> 
> Hi,
> 
> Well from the subject you can probably tell that Im new to Perl
> although I have a reasonable understanding of unix shell.
> 
> Q. Is there some standard Perl code that I can use to filter out the
> html tags like, <CENTER>  or <B> from text held in a perl variable?
perhaps something like
$_=$VarWhereYourHtmlSourceIs;
s/<[^>]+>//g;
$VarWhereYourHtmlSourceWas=$_;
> 
> Can anyone help please,
> 
> many thanks
> 
> Mark

-- 
 "DOS Computers manufactured by companies such as IBM, Compaq, Tandy, and
  millions of others are by far the most popular, with about 70 million
  machines in use wordwide. Macintosh fans, on the other hand, may note that
  cockroaches are far more numerous than humans, and that numbers alone do
  not denote a higher life form."       (New York Times, November 26, 1991)


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

Date: 3 Mar 1997 15:35:01 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How big is big?
Message-Id: <5fer35$qe@lyra.csx.cam.ac.uk>

Tom Fawcett  <fawcett@nynexst.com> wrote:
>mark@zang.com (Mark (Mookie)) writes:
>> Hi,
>> 
>> This:
>> 
>> sub num {
>>     local($num) = @_;
>>     if ($num < 1000) { return("RET: $num"); }
>>     return("OK: $num");
>> }
>> 
>> $num = &num(8); print "$num\n";
>> $num = &num(78); print "$num\n";
>> $num = &num(678); print "$num\n";
>> $num = &num(5678); print "$num\n";
>> $num = &num(45678); print "$num\n";
>> $num = &num(1000567); print "$num\n";
>> $num = &num(56051004); print "$num\n";
>> $num = &num(556051004); print "$num\n";
>> $num = &num(9556051004); print "$num\n";
>> $num = &num(39556051004); print "$num\n";
>> $num = &num(739556051004); print "$num\n";
>> 
>> Gives me:
>> 
>> RET: 8
>> RET: 78
>> RET: 678
>> OK: 5678
>> OK: 45678
>> OK: 1000567
>> OK: 56051004
>> OK: 556051004
>> RET: 9556051004
>> RET: 39556051004
>> RET: 739556051004
>
>Seems like a bug to me.  Comments?

Yes  -  known bug with integer comparisons around 2**31 (or is it 2**32?).
Mended in developer versions and therefore in 5.004 (due RSN).


Mike Guy


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

Date: Mon, 03 Mar 1997 13:44:06 +0100
From: Fredrik Lindberg <flg@vhojd.skovde.se>
To: tei hou <sp3102th@ex.ecip.osaka-u.ac.jp>
Subject: Re: How to sort blocks in a file?
Message-Id: <331AC796.160A@vhojd.skovde.se>

This is a multi-part message in MIME format.
------------8C766B36A021
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii

tei hou wrote:
> 
> I have a file which is divided into blocks by "##*##" line.
> Now i want to sort the blocks by its label, how can i do it
> with [g]awk or perl[45]?

Hi! Here is one way of doing it.

#!/usr/bin/perl

# Setup record delimiter
########################

$/ = "#########################\n";

# Since the first line of data begins with our
# RS it will return an "empty" record. I'll
# simply throw it way.

$throw_away = <DATA>;  


# Now in the loop I will chomp the line, which removes
# the RS (i e ###############).

while(<>) {
    chomp;       # Removes trailing #########
    push @list, $_;  # stuff it
}

# Okidoki, sort the array and print it. Notice
# that I use the $/ to put back the RS between
# records.
foreach $line (sort @list) {
    print "$/$line\n";
}
__END__
------------8C766B36A021
Content-Transfer-Encoding: quoted-printable
Content-Description: Card for Fredrik Lindberg
Content-Disposition: attachment; filename="nsmailCN.TMP"
Content-Type: text/x-vcard; charset=iso-8859-1; name="nsmailCN.TMP"

BEGIN:VCARD
FN:Fredrik Lindberg
N:Lindberg;Fredrik
ORG:V=E4sterh=F6jdsgymnasiet
ADR:;;Gymnasiegatan 1;541 31 SK=D6VDE;;
EMAIL;INTERNET:flg@vhojd.skovde.se
TITLE:Systemadministrator
TEL;WORK:+46-500-464222
TEL;FAX:+46-500-464203
NOTE:Systemadministrator
X-MOZILLA-HTML:T
END:VCARD


------------8C766B36A021--



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

Date: Mon, 03 Mar 1997 11:56:31 GMT
From: mark@weymouth.gov.uk (Mark Perkins)
Subject: IP Address to Host Name code WANTED
Message-Id: <331abb77.10732674@news.dircon.co.uk>

Hi,

Okay, I guess this is a bit cheeky, but I'm not clever enough to be
able to work this out, has anyone got some code or knows of a way to
do this in perl?

Should'nt this work?

$host = gethostbyaddr($ENV{'REMOTE_HOST'}, AF_INET);
print "$host\n";


Any help greatly appreciated.

Mark



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

Date: 3 Mar 1997 12:56:31 +0100
From: smurf@work.smurf.noris.de (Matthias Urlichs)
Subject: Re: libdl.a archive...
Message-Id: <5fee9f$n7k$1@work.smurf.noris.de>

In comp.lang.perl.tk, article <86endzgo0a.fsf@wmperry.in.aventail.com>,
  wmperry@aventail.com writes:
> "Eric A. Davis" <edavis@nas.nasa.gov> writes:
> 
> > I am trying to build Perl5 and I noticed that I don't have libdl.a.  The
> > libdl.so.x.x exists but not the archive.  Does anyone know what this
> > libraray is used for and where I can get the sources???  I am using the
> > latest Linux Slackware Distribution with kernel 2.0.  Thanks.
> 
You need to symlink libdl.so to libdl.so.x.y.

>   You don't need it.  Actually, I don't even know if libdl.a exists on any
> platforms.  :)

GNU libc does have a static libdl.a.

>                                       In general, if you will be using
> dlopen() and friends, you want to link dynamically anyway.
> 
You want to link dynamically _period_.  ;-)

-- 
The Earth makes one resolution every 24 hours. 
-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP N|rnberg 
Schleiermacherstra_e 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 N|rnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42


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

Date: 03 Mar 1997 06:46:00 -0500
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: No "sys/socket.ph" on Solaris?
Message-Id: <r5vi79tczr.fsf@tvmaster.turner.com>

"Kevin L. Gross" <klg@westweb.com> writes:

> I wrote a Perl script that uses ftp.pl and chat2.pl on BSDI. When I went to
> run the script on Solaris it would not work.
> 
> Seems that ftp.pl calls chat2.pl which in turn calls "sys/socket.ph".
> 
> But on the Solaris version of Perl5.003, there is no /usr/local/sys nor any
> socket.ph.
> 
> How do I use the ftp.pl and chat2.pl on Solaris? Why would the sys/socket.ph
> library get created on BSDI but not Solaris? Why would the chat2.pl library
> (which I gather is used extensively) call a library that doesn't exist? Is
> there some other way to use ftp.pl on Solaris?

The .ph files are created by a perl program called h2ph which takes .h files
and turns them into (hopefully equivalent) .ph files.

This all very perl4-ish, by the way.  A good deal of this, in particular, the
socket stuff, has been deprecated by using Socket.  ("use Socket;" in your
code.)  May require some tweaking.

You may also want to investigate Net::FTP, (I think it's still called that;
others will correct me if that's incorrect), which should accomplish whatever
you need to do using ftp.



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

Date: 3 Mar 1997 13:29:43 GMT
From: xixax@echonyc.com (Daniel Drennan)
Subject: Numeric value expected...
Message-Id: <5fejo7$155@echo2.echonyc.com>


I've gone through my Perl books a hundred times this weekend and am 
hoping someone might have some insight for me into a small problem I've 
run into...

I'm currently using a DBM file that is a simple log that keeps one key 
and one value that increments.

I'm trying to sort the associative array by value, and keep getting an 
error message that the spaceship operator expects a numeric value.

If I use cmp instead, i get a sort based on ASCII, so I know that it works.

I found a tiny footnote in the new Perl book that says that everything in 
a DBM file is treated as a string...why won't Perl do a numeric 
conversion here? What is the proper way to force a numeric evaluation 
here? 

On a side note, while trying to figure stuff out I was printing out the 
values to make sure things were running okay, and most of the time it is 
a number, but sometimes it came up as HASH(#######)   ... is Perl taking 
some of the values for references?

Thanks in advance.

_________________________________________________________________________
Danny Drennan <> Inquisitor Magazine <> <http://www.inquisitor.com/>


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

Date: 3 Mar 1997 15:15:27 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Numeric value expected...
Message-Id: <slrn5hlqhv.tca.dave@fast.thomases.com>

On 3 Mar 1997 13:29:43 GMT, Daniel Drennan <xixax@echonyc.com> wrote:

> I'm trying to sort the associative array by value, and keep getting an 
> error message that the spaceship operator expects a numeric value.
 ...
> On a side note, while trying to figure stuff out I was printing out the 
> values to make sure things were running okay, and most of the time it is 
> a number, but sometimes it came up as HASH(#######)   ... is Perl taking 
> some of the values for references?

So maybe thats the problem....

I'd guess that somewhere in your code you're using '{}' to bracket something
and generating a hash instead. Have you run your code with the -w flag?

Dave

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 03 Mar 1997 10:16:10 -0500
From: Dean Pentcheff <dean@tbone.biol.sc.edu>
Subject: Re: Perl on NT 4.0 - HOW?
Message-Id: <m14tetc8g5.fsf@nauplius.psc.sc.edu>

"Jim" <Jim@pbs1.com> writes:
> I have just loaded perl 5 on my NT server.  I seems as if I can run perl
> scripts from the dos prompt, but I cannot run them from the web browser. 
> Does anyone have any insight on how to get perl working properly on NT 4.

It sounds as though Perl is working just fine.  The problem you're
having has to do with your WWW server, not Perl.  Newsgroups you might
try include:

comp.infosystems.www.servers.misc
comp.infosystems.www.authoring.cgi
comp.infosystems.www.advocacy
comp.infosystems.www.misc
comp.infosystems.www.servers.ms-windows

Hope that's helpful!

-Dean
-- 
N. Dean Pentcheff   <pentcheff@acm.org>   WWW: http://tbone.biol.sc.edu/~dean/
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-3936)
PGP ID=768/22A1A015 Keyprint=2D 53 87 53 72 4A F2 83  A0 BF CB C0 D1 0E 76 C0 
Get PGP keys and information with the command: "finger dean@tbone.biol.sc.edu"


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

Date: Mon, 03 Mar 1997 14:19:49 GMT
From: criter@lucent.com (Craig S. Riter)
Subject: Re: Perl5/Tk for Win95/NT
Message-Id: <331b0102.25210901@nntp.cb.lucent.com>

What version of the Perl interpreter are you using?  I did not get
this message when trying to use flock in the version I have.  Although
I do remember gettig it with v5.001.

Output from 'perl -v'
This is perl, version 5.003_07

Copyright 1987-1996, Larry Wall

        + suidperl security patch
        Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
                All rights reserved.
        Developed by ActiveWare Internet Corp.,
http://www.ActiveWare.com

Perl for Win32 Build 303 - Built 14:27:31 Jan 29 1997

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.


Craig 
criter@riter.com
On 26 Feb 1997 14:18:29 GMT, nvp@shore.net (Nathan V. Patwardhan)
wrote:

>Charles K. Kincaid (Webmaster@UniversalClassifieds.com) wrote:
>
>: I got the files from ActiveWare some time ago (week).  The only
>: problem that I have had is the message "flock not supported under
>: Win95".  I don't understand why they letft this out.  Makes testing my
>
>I dunno - does NT have a file-locking exclusive-write mechanism?
>
>--
>Nathan V. Patwardhan
>nvp@shore.net
>"What is the wind speed of a sparrow?"

______________________________________________________________________
Craig S. Riter         criter@riter.com         criter@povpartners.com
www.riter.com                           PGP key available upon request
It infuriates me to be wrong when I know I'm right.           -Moliere


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

Date: 3 Mar 1997 14:58:11 GMT
From: "Roth Consulting" <rothd@roth.netX>
Subject: Re: PerlIS+Win32::ODBC - Can't call method "Sql"...
Message-Id: <01bc27e2$e8fd0740$0100a8c0@www>



Bill Cowan <billc@tibinc.com> wrote in article
<331A17B6.251B@tibinc.com>...
> Dirk Leas wrote:
> > 
> > On Sun, 02 Mar 1997 05:16:46 GMT, dirkl@midak.com (Dirk Leas) wrote:
> > 
> > >I have a simple script that executes fine under perl.exe, but under
> > >perlIS I get the error:  "Can't call method "Sql" without a package or
> > >object reference at c:\work\scripts\getCourseList.pl line 15.".
> > >
> > >I've checked the FAQ, but still a newbie, so be gentle ; - )
> > >
> > >Adios,
> > >Dirk
> > 
> > DOOOOOOOOOOOHHHHHHHHHH...
> > 
> > Here's sample source code (again, works great with perl, not with
> > perlis):
> > 
> > use Win32::ODBC;                        # odbc services
> > 
> > $html = '';
> > $prereqs = '';
> > $outline = '';
> > $cid = $ENV{'QUERY_STRING'};
> > $template = 'course.htm';
> > 
> > # load standard template
> > open(FP, $template);
> > @templateStream = <FP>;
> > $_ = "@templateStream";
> > close(FP);
> > 
> > # grab course info
> > $data = new Win32::ODBC("midak");
> 
> [Start cruel action]
> Where is your error checking?  Was there an error here? 
> [End of cruel action]

YES! Error checking rocks!
Try changing the connection line from:
	$data = new Win32::ODBC("midak");
to:
	if (!($data = new Win32::ODBC("midak"))){
		print "Could not connect to DSN:\nError: " . Win32::ODBC::Error() . "\n";
		exit;
	}
or something similar. This will print out the error.
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: 3 Mar 1997 04:00:37 -0800
From: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: Problems seeing files thru links/NSF?
Message-Id: <5feeh5$nc3@soda.CSUA.Berkeley.EDU>

Albert W. Dorrington <awdorrin@ictest.delcoelect.com> wrote:
>Ack, it figures 5 minutes after I post the question I figure out
>what I'm doing wrong.
>
>I had a newline on the end of my filename, so Perl was tring to look
>for '/dir/path/filename\n' instead of just '/dir/path/filename'

Running your program with perl -w can help you find this sort of
thing even faster:

    Unsuccessful stat on filename containing newline at ./foo line 1.

You're not alone in forgetting simple things like removing newlines
from filenames -- everyone does it, which is why perl -w checks for
those things and warns you about them.  See perlrun(1) for details.
-- 
        Michael Constant (mconst@soda.csua.berkeley.edu)


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

Date: Mon, 3 Mar 1997 09:53:15 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: system( 'dialog', ...) and redirection
Message-Id: <adelton.857382795@aisa.fi.muni.cz>

Horst Fickenscher <fickensc@it.erlm.siemens.de> writes:

> exec (and system) can have an array as parameters, and will then not
> use a shell (more efficient).
> 
> But how can I do redirection of stdout and stderr then?
> 
> I have read Perl FAQ 5.15 !
> 
> We use Savio Lam's dialog program in many shell scripts. It would
> be nice to have perl scripts instead of shell scripts. As a fast
> approach I decided to write an interface to dialog which uses
> "system", and that's the reason for my question. Note that dialog
> uses a lot of parameters and it would be easier and faster not to
> pass them as one big string. dialog returns its values on stderr.

You may want to check the dialog.pl that comes with dialog. It might
give you some hints,

> By the way, is anybody else interested in using dialog from perl?
> I think about rewriting dialog as real perl code using William
> Setzer's Curses.

Yes, that yould be good. Or something like Tk in text mode. Perlmenu
is hard to use and Curses.pm is too low level.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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

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