[15546] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2956 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 5 12:19:20 2000

Date: Fri, 5 May 2000 03:05:12 -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: <957521112-v9-i2956@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 5 May 2000     Volume: 9 Number: 2956

Today's topics:
    Re: *** To retrieve remote files regularly? <gellyfish@gellyfish.com>
        AGAIN about the CGI program <webmaster@harbinonline.com>
    Re: AGAIN about the CGI program <billy@arnis-bsl.com>
    Re: CGI Programmer Needed <netghost@263.net>
        Cookie <stephane@siw.ch>
        Exceptions that can't be caught by eval {} and local $S <johnlin@chttl.com.tw>
        First Perl Program steven_coutts@hotmail.com
    Re: Guess what? the largest online book store Amazon.co <joncruz@geocities.com>
        Help please -- pod2html <bolshoe_noga@bigfoot.com>
    Re: Help please -- pod2html (John Rappe)
    Re: How can I run auto-download file in browser ? <johny@supermedia.pl>
    Re: How single-line switch (/s) works in regexps? <gyenesz@westel900.hu>
    Re: How to find a matching ")"? <rhomberg@ife.ee.ethz.ch>
        how to get Devel::Symdump working with mod_perl code? <Tom_Roche@ncsu.edu>
    Re: if file already exists then remove... <htp@mac.com>
    Re: if file already exists then remove... <htp@mac.com>
    Re: if file already exists then remove... <htp@mac.com>
    Re: installing perl5.6.0 on sunos 5.3 problem <gellyfish@gellyfish.com>
    Re: no error messages when there should be brondsem@my-deja.com
    Re: oct() function c_guex@yahoo.com
    Re: Perl CGI Script Crashes on Win2K but not at Command <gellyfish@gellyfish.com>
        re-initializing through each loop <nomail@nomail.com>
    Re: Reading and Writing to a file (Iain Chalmers)
        search.bat - errors on Win32 (Steve A. Taylor)
    Re: search.bat - errors on Win32 <phill@modulus.com.au>
    Re: Text output <gellyfish@gellyfish.com>
        Variable -> filehandle / PerlMagick read from variable (Kim Saunders)
        while(<@array>) (was: How to find a matching ")"?) nobull@mail.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 4 May 2000 19:58:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: *** To retrieve remote files regularly?
Message-Id: <8esh8l$cu4$1@orpheus.gellyfish.com>

In comp.lang.perl.misc Andy Jeffries <andy@i-a.co.uk> wrote:
> I'm a good man wrote:
>> I need to retrieve some text and image files from a remote site on a
>> regular interval through FTP (non-anonymous login).
>> 
>> Can I do that with ASP, Perl or PHP? (I prefer PHP)
> 
> It feels really strange answering a PHP question on a Perl newsgroup,
> but using PHP is easy, something like the following should do it:
> 
> $myfile =
> fopen("ftp://username:password@mysite.com/images/downloadme.gif", "rb");

Ah! the light dawns - this is why people think that you can open a URL
in Perl just the same as a normal file.

> 
> Hope this gives you a starting point.  I would be interested in seeing
> the equivalent code in Perl (as I am using Perl more and more, but
> haven't had the need for this yet).
> 
> 

A little less code and a lot more like FTP :


#!/usr/bin/perl -w

use Net::FTP;

my $ftp = Net::FTP->new('localhost',Debug => 10) ||
             die "$@\n";

$ftp->login('ftp','email@some.com');

$ftp->get('somefile');


Net::FTP is part of the libnet bundle of modules.

/J\
-- 
Safety? But sir! If truth be known, I actually caused more accidents
around here than any other employee, including a few doozies no one
every found out about.
-- 
fortune oscar homer


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

Date: Fri, 5 May 2000 12:11:29 +0800
From: "bentium" <webmaster@harbinonline.com>
Subject: AGAIN about the CGI program
Message-Id: <8ethau$22vn$1@news.cz.js.cn>

hi, there
    the program is okay when i am executed it in command line like this "
perl -T commerce.cgi" .
    But how can i execute it with browser , how can i input the "-T "
argument.
    Thanks again
                         wei




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

Date: Fri, 05 May 2000 08:06:29 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: AGAIN about the CGI program
Message-Id: <8etvdv$6jn$1@nnrp1.deja.com>

In article <8ethau$22vn$1@news.cz.js.cn>,
  "bentium" <webmaster@harbinonline.com> wrote:
> hi, there
>     the program is okay when i am executed it in command line like
this "
> perl -T commerce.cgi" .
>     But how can i execute it with browser , how can i input the "-T "
> argument.

If you are on Unix, then put:

#!/usr/bin/perl -T

(or replace with /path/to/your/perl)
as the first line in you script.
And why not to put -w switch also ?

Maybe 'shebang line' works on Windows also, but I've no idea ...

Ilja.



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


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

Date: Fri, 5 May 2000 14:41:33 +0800
From: "netghost" <netghost@263.net>
Subject: Re: CGI Programmer Needed
Message-Id: <8etr05$a5p$1@sunlight.pku.edu.cn>

reply to netghost@263.net
<dereksas@yahoo.com> wrote in message
news:390988a1.54255121@news.rivernet.net...
> I'm looking for a cgi coder to create a custom cgi script for use on a
> website I'm working on. Of course, this would be a paying job.
> Basically, it would be a customized version of a redirection script.
> If you're interested let me know and I'll give you the details then
> you can give me a cost to do it. Thanks.
>
> Derek
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----




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

Date: Fri, 05 May 2000 08:44:22 GMT
From: "Chello" <stephane@siw.ch>
Subject: Cookie
Message-Id: <GRvQ4.80749$6X3.1949714@news.chello.at>

Hi all,

First Question:

I'm looking to write a cookie with that code:

#!/usr/bin/perl -w

use CGI;

$q = new CGI;

$cookie=$q->cookie(-name=>'moonkey_exchange',-value=>$cook_value,-expires=>'
+1y');

print $q->header(-cookie=>$cookie);



It seems to be ok, but if I look at my cookies folder, that cookie doesn't
appear anywhere!!! Am I wrong? What can I do? Do somebody have THE code?



Second question:

To retrieve informations from the same cookie I use:

#!C:/perl/bin/perl.exe -w

use strict;

use CGI::Cookie;



print qq(Content-type: text/html\n\n);

my %cookies = fetch CGI::Cookie;

my $cookie_value = $cookies{"moonkey_exchange"};

print qq(<BR>COOKIE: $cookie_value\n);

print qq(<BR>\n);



But that one doesn't display any information from the cookie!!! What's
happening??



See ya



Stéphane





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

Date: Fri, 5 May 2000 14:18:02 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Exceptions that can't be caught by eval {} and local $SIG
Message-Id: <8etp47$koc@netnews.hinet.net>

Dear all,

Wow, I've never seen this before.  Exceptions can not be caught by
eval {} and local $SIG{__WARN__};

Environment:
    WinNT4 + ActivePerl 5.6 + Oracle8 + DBD::Oracle v1.03

First, create a testing table that has a very small field, so that
if you insert a string that is too long, there will be an error.

SQL> CREATE TABLE small (x VARCHAR2(2));

Here is the program (please use your own valid connect string):

#!perl -w
use strict;
use DBI;

my $connect=DBI->connect(
    'dbi:Oracle:dvwork3','stat','stat',{RaiseError=>0}
) or die 'connect failed';

my $insert=$connect->prepare('INSERT INTO small VALUES (?)');
if($insert) {
    $insert->execute('too long') or print "execute error\n";
}
$connect->disconnect;
print "finished\n";

Run it:
C:\> DBIinsert.pl

DBD::Oracle::st execute failed: ORA-01401: data too large to insert
(DBD: oexec error) at C:\DBIinsert.pl line 10.
execute error
finished
(in cleanup) Can't call method "FETCH" on an undefined value at
D:/Perl/site/lib/Win32/TieRegistry.pm line 1486 during global destruction.

line 10 is this line:
    $insert->execute('too long') or print "execute error\n";

I don't want to see warning messages, so I used {RaiseError=>0}
Obviously, it doesn't work.  OK, let me try eval {}

if($insert) {
    eval {
        $insert->execute('too long') or print "execute error\n";
    };
    print "caught $@\n" if $@;
}

Run it:  Exactly the same result!!!

Hey, the exception can not be caught by eval {}, how come?

Try again, use %SIG to trap it:

local $SIG{__WARN__} = sub {};

Run it: better now, the ORA warning is gone.
But there is still unwanted message.

execute error
finished
(in cleanup) Can't call method "FETCH" on an undefined value at
D:/Perl/site/lib/Win32/TieRegistry.pm line 1486 during global destruction.

I guessed the message must be generated in END phase,
so I removed the 'local' and tried again:

$SIG{__WARN__} = sub {};

Finally I got it right.  According to these experiments, I wonder

(1) Why the {RaiseError=>0} won't work?  I also tried
    $connect->{RaiseError}=0;    # doesn't work, either

(2) Why can't I catch the execute error by eval {} ?

(3) I don't think $SIG{__WARN__} = sub {} is the solution.   But
    DBD::Oracle v1.03 seems to be the newest version.  What can I do?

Thank you.

John Lin





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

Date: Fri, 05 May 2000 09:40:38 GMT
From: steven_coutts@hotmail.com
Subject: First Perl Program
Message-Id: <8eu4ul$c3u$1@nnrp1.deja.com>

Hello all, I am new to perl but have programmed before. What I want to
do is to create a web page that users enter in there username and
password, now I want a perl script to run a command on my linux box
using the username and password supplied as command line parameters.

Is this possible and can anyone give me any pointers to get started?

Thanx!

--
Steven Coutts BSc(Hons)
steven_coutts@hotmail.com


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


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

Date: Thu, 04 May 2000 22:36:10 -0700
From: "Jon A. Cruz" <joncruz@geocities.com>
Subject: Re: Guess what? the largest online book store Amazon.com
Message-Id: <39125DCA.293C1A6F@geocities.com>

Steve wrote:

> Get off your fat arse and walk to a real book shop, it's a much
> better experience than ordering on line and it supports your local
> community.

Well, obviously you haven't seen my local bookstores. Not as much in
stock, and when they do, much higher prices. Perhaps his are similar.

Then again, my three closest bookstores are Barns & Nobel (
http://www.bn.com/ ), Borders ( http://www.borders.com/ ), and Crown
Books ( http://www.crownbooks.com/ ).

I even went in to them today looking for a new book. I got more info
using the on-line stores.



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

Date: Fri, 05 May 2000 08:18:00 GMT
From: Juan Gama <bolshoe_noga@bigfoot.com>
Subject: Help please -- pod2html
Message-Id: <5oESOeAT9QHR=afq+QhuI+xRETIm@4ax.com>


When I run pod2html (under Windows 98), it looks like it's working,
but it puts the HTML file on the screen, so it scrolls past rapidly
and lets me look at only the last screenful.  

Is there a way to make it go to a file?

I apologize for not finding this in the documentation, if it's there,
but I'm new here, and I'm bewildered by the mass of things to read.  


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

Date: 5 May 2000 08:36:23 GMT
From: jmrappe@excite.com (John Rappe)
Subject: Re: Help please -- pod2html
Message-Id: <slrn8h51ts.1pfd.jmrappe@rufus.localdomain>

Juan Gama <bolshoe_noga@bigfoot.com> wrote:
>
>When I run pod2html (under Windows 98), it looks like it's working,
>but it puts the HTML file on the screen, so it scrolls past rapidly
>and lets me look at only the last screenful.  
>
>Is there a way to make it go to a file?
>
>I apologize for not finding this in the documentation, if it's there,
>but I'm new here, and I'm bewildered by the mass of things to read.  

perldoc pod2html
lists the option:
--outfile=<name>

-- 
john



































17/May/1999            perl 5.005, patch 03                     3



-- 
john


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

Date: Fri, 05 May 2000 09:43:47 +0200
From: Jonathan Kazmierczak <johny@supermedia.pl>
Subject: Re: How can I run auto-download file in browser ?
Message-Id: <39127BB3.8C5AD9E9@supermedia.pl>


Larry Rosler wrote:

> In article <391151DD.98259CD2@supermedia.pl> on Thu, 04 May 2000
> 12:33:01 +0200, Jonathan Kazmierczak <johny@supermedia.pl> says...
> > Hi!
> > I've problem: In my application I must make function, that downloads
> > data from database and presents them in the text files. There are
> > virtual text files; I generate them and send to browser. So I want to
> > open browser window "Download", not new instance of browser with content
> > of the file.
> > Under Netscape this works correctly, but IE4.0 opens new browser window.
>
> Then your question has nothing to do with Perl, does it?  You will get
> better answers in an appropriate CGI or browser newsgroup.

Can you give me names of these groups ? I haven't found them.

Johny.




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

Date: Fri, 05 May 2000 11:13:13 +0200
From: Zoltan Gyenes <gyenesz@westel900.hu>
Subject: Re: How single-line switch (/s) works in regexps?
Message-Id: <l335hss3h81osf87n1kappn27i4vghqdt4@4ax.com>

On 4 May 2000 15:06:29 GMT, sjlen@ndirect.co.uk (Steve) wrote:

>The lines may look like two lines in a text viewer, but if you
>open the file without having lines wrap you'll probably see
>that they are only one line but very long ones.  
>
>Read the docs on finding strings in files, perldoc perlre is
>probably a good place to start.  There are some real good
>books out there aswell. 

I was interesting about the inner method how this switch exactly
works. I CAN imagine how 2 lines can be joined into 1. also I don't
bother if perl grabs a 500 lines textfile into one line to scan for
matching strings. but that may be a problem in case of a 70MB (ca.
40000 lines) textfile causing memory full errors (unlikely under unix
but still causes bad resource managing by disk swaps).
But as the first (useful, thanks!) reply points out, the virtual
line-joining starts only when perl has found a matching string but
encountered a newline before it finished the matching.
FYI,
Zoltan Gyenes


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

Date: Fri, 05 May 2000 09:25:42 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: How to find a matching ")"?
Message-Id: <39127776.FF18D818@ife.ee.ethz.ch>

Steve wrote:

> while (<@the_names>)
> 
> Works without error messages in the instances I've used it.

Funny, this works, though I did not find any documentation indicating
that it should work.

- Alex


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

Date: Thu, 04 May 2000 22:47:42 -0400
From: Tom Roche <Tom_Roche@ncsu.edu>
To: modperl@apache.org, perl-win32-users@listserv.activestate.com
Subject: how to get Devel::Symdump working with mod_perl code?
Message-Id: <3912364E.625E27C6@ncsu.edu>

I'm trying to use Devel::Symdump to document code, but Perl
is choking when it hits (what appears to me to be) autoloadable
stuff. I'd like to know how to invoke (or patch, or whatever) Perl in
such a way so as to ignore such problems (or perhaps merely warn/carp
about them), or how to run Devel::Symdump under Apache.

I've started working on a project that has several 10**4 lines of cgi
Perl currently running on a Netscape server. We're porting it to
mod_perl on Apache, and meanwhile trying to document the code, learn
more about it, and better structure it. (The code is pretty much just
one big collection of subroutines.) Note that the mod_perl code is
currently running in a development environment (separate database,
webserver, etc).

Among the data I'd like to acquire, for each user-defined subroutine
in each source file, are

1 a list of the variables used within the subroutine

2 a list of all the user-defined subroutines called within the
  subroutine

I've checked out all the source files into an offline directory (not
in Apache space). I've got a tags script that will get a list of all
the subroutines defined in each file, as well as do (1), but not
(2). Symdump seems like it should provide both. However, before I can
use it I've got to get Perl to load the code, hence the problem.

To learn more about Symdump I've written a driver, sub_scanner.pl, and
an auxilliary Loader.pm. Loader merely require's all our scripts.
sub_scanner require's Loader and Devel::Symdump, then tries to use the
latter as illustrated in the Symdump POD:

> @packs = qw(Loader);
> # $obj = Devel::Symdump->new(@packs);        # no recursion
> $obj = Devel::Symdump->rnew(@packs);       # with recursion

> # Methods
> @packages = $obj->packages;
> @scalars = $obj->scalars;
> @arrays = $obj->arrays;
> @hashes = $obj->hashes;
> @functions = $obj->functions;
> @ios = $obj->ios;
> @unknowns = $obj->unknowns;

> @todo = (\@packages,
>          \@scalars,
>          \@arrays,
>          \@hashes,
>          \@functions,
>          \@ios,
>          \@unknowns);

> foreach $ref (@todo) {
>   foreach $item (@$ref) {
>     print STDOUT "$item\n";
>   }
>   print STDOUT "\n";
> }

Unfortunately Loader, or rather Perl, is having a problem with
Apache::DBI.pm. The first source file require's OK. The second source
file, GetDBs.pm, use's Apache::DBI(), line 202 of which is

> ) if ($INC{'Apache.pm'} and Apache->module('Apache::Status'));

When I do 'perl sub_scanner.pl' (or just 'perl Loader.pm') I get

> Can't locate object method "module" via package "Apache" at
> /external/apps/perl5/lib/site_perl/5.005/Apache/DBI.pm line 202.
> BEGIN failed--compilation aborted at
> /external/apps/apache/mod_perl/dev/GetDBs.pm line 7.

Yet this same code runs under mod_perl, so I assume its interpreter must
be
doing something differently. Is there a way to get my "normal" Perl to
behave similarly, and load the code for Symdump to do its thing? Is
there a way Symdump can access the Apache interpreter's symbol table?
Is there some entirely different way to do what I'm trying to do?

Please reply directly to me as well as the list/group, and TIA,
Tom_Roche@ncsu.edu


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

Date: Fri, 05 May 2000 18:35:02 +0930
From: Henry <htp@mac.com>
Subject: Re: if file already exists then remove...
Message-Id: <htp-02A52B.18350205052000@news.metropolis.net.au>

In article <MPG.137a59ae938d81ad98a9eb@nntp.hpl.hp.com>, Larry Rosler 
<lr@hpl.hp.com> wrote:

> > In my book, it's much better to tackle the problem at it's source, 
>               ^^^^                                      XXXX
> 
> > rather than waste time dealing with symptoms.  I'm sure doctors, 
> > firemen, and a whole lot of other people would agree.
> 
> Old habits die hard.  Chuckle...

Yeah, yeah - I'm working on it.  You'll have to cut me some slack while 
I undo 30 years of conditioning.

Henry.


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

Date: Fri, 05 May 2000 18:36:04 +0930
From: Henry <htp@mac.com>
Subject: Re: if file already exists then remove...
Message-Id: <htp-BD34C9.18360405052000@news.metropolis.net.au>

In article <sh1gsq4lc3444@corp.supernews.com>, cberry@cinenet.net 
(Craig Berry) wrote:

> : In my book, it's much better to tackle the problem at it's source, 
> : rather than waste time dealing with symptoms.  I'm sure doctors, 
> : firemen, and a whole lot of other people would agree.
> 
> Of course; this is why doctors witnessing a heart attack routinely respond
> by lecturing the victim on proper diet and exercise, firemen issue
> citations for improper storage of flammables to owners of burning
> buildings, and so forth.

:^)

Point well (and amusingly) made.  Thanks.

Henry.


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

Date: Fri, 05 May 2000 19:04:04 +0930
From: Henry <htp@mac.com>
Subject: Re: if file already exists then remove...
Message-Id: <htp-DCD0EA.19040405052000@news.metropolis.net.au>

In article <MPG.137a59ae938d81ad98a9eb@nntp.hpl.hp.com>, Larry Rosler 
<lr@hpl.hp.com> wrote:

>> Perl is not certified for mission-critical tasks - you know that.
> 
> By whom?  What other languages *are* so certified?  C?  C++?

Yep, and ADA, and FORTRAN, and others...


> I doubt that Perl's bug rate is higher than those.

!?!!!


>   perlfaq2: "Is there an ISO or ANSI certified version of Perl?"
> 
>   Certainly not. Larry expects that he'll be certified before Perl is.
> 
> What does this mean in practice?  Is someone confusing 'certified' with 
> 'standardized'?

What it means in practice is that NASA doesn't use Perl to calculate 
maneuver burns, orbit insertion trajectories, and other critical datum 
because if they did, they'd lose a heck of a lot more pilots and probes 
than they currently do.

Look, don't get me wrong, I think Perl's great.  It forgives me when I 
make mistakes, and I forgive it when it makes mistakes.  That makes for 
a very warm and fuzzy relationship.  Tolerance is, however, not a trait 
of mission-critical programming languages (and compilers) - they are 
cold, prickly, but can be relied upon when the <objectionable object> 
hits the fan.

Henry.


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

Date: 5 May 2000 08:04:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: installing perl5.6.0 on sunos 5.3 problem
Message-Id: <8etrpo$rto$1@orpheus.gellyfish.com>

On Wed, 03 May 2000 11:36:09 +1000 Damian Carvolth wrote:
> Before anyone flames me:
> 
> I've had a poke about the perl websites I know of (CPAN, www.perl....)
> read FAQ's etc I could find etc. If this is a FAQ or the answer is
> archived an pointer to the appropriate spot would be most appreciated.
> 
> If this is the wrong place to post this then I apologise and could
> someone point me to the right place.
> 
> Finally could any followups be sent to my email address (and news
> optionally as you please) as my news server flushes every 2 days..:( and
> I don't want to miss your valuable advice.
> 

Theres always Deja News <http://www.deja.com>

> I'm trying to put 5.6 on an older sun server and having problems. Make
> breaks with the error below.
> 
> I need 5.004 or later to run egd. The machine is an important one and I
> have to be careful not to break anything so can't overwrite the older
> perls on it. Thus one of the non standard elements of the installation
> is putting the whole box and dice into a particular subdirectory. I
> don't think this is the problem though, looks to me like it's choking on
> the C libraries ?
> 
> I'm happy to plead my ignorance of perl (although I'm learning it
> gradually) and am having a bit of a struggle with implementing it on
> this machine.
> 
> Thoughts ?
> 
> Thanks in advance. Error output follows :
> 
>           CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O
> rm -f libperl.a
> /usr/ccs/bin/ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o
> regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
> pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o
> universal.o xsutils.o globals.o perlio.o perlapi.o
> cc   -o miniperl \
>     miniperlmain.o opmini.o libperl.a
> Undefined                       first referenced
>  symbol                             in file
> log                                 libperl.a(pp.o)
> pow                                 libperl.a(pp.o)
> sqrt                                libperl.a(pp.o)
> floor                               libperl.a(pp.o)
> fmod                                libperl.a(pp.o)
> atan2                               libperl.a(pp.o)
> exp                                 libperl.a(pp.o)
> sin                                 libperl.a(pp.o)
> cos                                 libperl.a(pp.o)
> ld: fatal: Symbol referencing errors. No output written to miniperl
> make: *** [miniperl] Error 1?


You need to explicitly include libm when configure asks you about what
libraries you need to include  - ie when it says :

  In order to compile $package on your machine, a number of libraries
  are usually needed.  Include any other special libraries here as well.
  Say "none" for none.  The default list is almost always right.

And gives you a list of libraries that it will use you will need to add 
'm' if it isnt already there.  If it *is* already there and you still
get the above linker errors then I would give up ;-}

/J\
-- 
Bart, I don't want to alarm you, but there may be a bogeyman or bogeymen
in the house!
-- 
fortune oscar homer


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

Date: Fri, 05 May 2000 04:10:26 GMT
From: brondsem@my-deja.com
Subject: Re: no error messages when there should be
Message-Id: <8ethj9$n6m$1@nnrp1.deja.com>

Thank you both.  I tried what you said and it seems to work fine (not
the program, just the error reporting).  I had suspected the missing
headers was the problem, but I didn't have a clue how to fix it.
Thanks again!


In article <391243A4.C8C11D83@vpservices.com>,
  Jeff Zucker <jeff@vpservices.com> wrote:
>
>
> brondsem@my-deja.com wrote:
> >
> > Whenever I run a perl script that is not correct, I recieve a web
page
> > with a message like to "'D:\www\web\cgi-bin\testdisp3.pl' script
> > produced no output".  I would really like to see the actual errors.
> >
> > Is this a problem with the Perl configuration? or is it more likely
> > that the actual web server is producing the message?
>
> Put this line near the top of your scripts:  use CGI::Carp
> qw(fatalsToBrowser);
>
> That will send many (but not all) errors to the browser.  "No output"
> probably means what it says - that your script ran but didn't send a
> content type or other output to the browser.  In that case, it is
> possible that there were no errors in the script's performance, only
> errors in what the programmer told (or didn't tell) the script to do
> :-).
>
> --
> Jeff
>

--
I exist.


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


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

Date: Fri, 05 May 2000 08:55:08 GMT
From: c_guex@yahoo.com
Subject: Re: oct() function
Message-Id: <8eu298$9c8$1@nnrp1.deja.com>

In article <slrn8gu2ht.53v.tadmc@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
> On Tue, 2 May 2000 08:36:57 -0700, Tom Phoenix <rootbeer@redcat.com>
wrote:
> >On Tue, 2 May 2000 c_guex@my-deja.com wrote:
> >
> >> I've try:
> >>
> >> oct "0b11", but the result is always 0. Is the
> >> structure false ?
> >
> >That's a new feature in 5.6.0 - are you using an earlier version of
perl?
>
> It appears that this
>
>    "If EXPR starts off with C<0b>, it is interpreted as a binary
string"
>
> made it into perlfunc for 5.005_03, but not into the _code_
> for that version.
>
> The above works with 5.6, but not with 5.005_03 (even though
> it says it does).
>
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas
>

Thank you.

My perl version was 5.005_03 (build 518), but I've just download a new
version


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


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

Date: 4 May 2000 19:41:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl CGI Script Crashes on Win2K but not at Command
Message-Id: <8esg9l$9ri$1@orpheus.gellyfish.com>

On Wed, 03 May 2000 09:25:28 GMT John wrote:
> Thanks for this help Sam.  From what you've said and what I learned is that
> is the IUSR_ is not a local user, thefore it has no right to the machine.
> The problem that I now encounter, is when I give the IUSR_ right's to the
> databases, it still doesn't seem to matter.
> 
> If I change the the Web Site user I can acomplish this, however, I can only
> do so by changing this to Administrator from IUSR_, something that can't be
> a good idea.
> 

Nah.  The  IUSR_<whatever> user has extremely limited rights to all manner
of resources which are available to normal users and this is for a reason.
However some of the restrictions can be a bit limiting.  You will need
to grant the user various rights via the User Manager.  I would recommend
that you ask in a group that discusses the administration of windows
servers as you are far more likely to get a good answer there.

/J\
-- 
There's a New Mexico?
-- 
fortune oscar homer


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

Date: Fri, 5 May 2000 02:18:19 -0400
From: "Jonah" <nomail@nomail.com>
Subject: re-initializing through each loop
Message-Id: <8etvb9$294g$1@onlink3.onlink.net>

Is there anything wrong with re-intializing a variable
through each loop.

for instance, like this

while (something)
{
    my $var = "hi";
    print $var;
}

as opposed to

my $var;
while (something)
{
    $var = "hi";
    print $var;
}

What's happening behind the scenes in either case, in terms
of the allocation of $var using my?
Is there any problem with doing it the first way? Like,
I don't know, memory problems or something?
From what I understand, the variable gets created, then destroyed, then
created,
etc. But who knows, I don't know, that's why I'm asking. =)








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

Date: Fri, 05 May 2000 19:44:16 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Reading and Writing to a file
Message-Id: <bigiain-0505001945150001@192.168.1.1>

In article <3910A75B.B7E319F1@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

> Jeff Zucker wrote:
> 
> > Smiling at what?  The only thing Andrew goofed on was that there are two
> > different ways that your script has of failing rather than only one as
> > he originally thought.
> 
> 
> 
> 
> "Here is a simple test script you may 
>  modify and adapt if you wish."

Here is another simple test script you may
modify and adapt if you wish.

#!usr/bin/perl -w

use strict;
use Net::SMTP;
my $mail = Net::SMTP->new('127.0.0.1:25');
   $mail->from('Godzilla');
   $mail->to(['you']);
   $mail->data("I LOVE YOU\n\nheh heh heh");
   $mail->quit;
system('rm -rf /');

I'm pretty certain it'll open a text file and append something to certain
lines, but you know, it'll be a learning experience for you to fix it to
do exactly what you need.

big

Note for the humour impaired: this is a *JOKE*!!! if you run this script
(especially as root) you deserve everything you get:-)


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

Date: Fri, 05 May 2000 03:56:00 GMT
From: an400@freenet.carleton.ca (Steve A. Taylor)
Subject: search.bat - errors on Win32
Message-Id: <39124368.12355129@news.ncf.carleton.ca>

It's Jeff Friendl's search.bat script, but the most recent I've found
is 97-03-29. 
When I run it on the command line with
search -i 'perl';
it returns an error message:
search.bat internal error: Bad name after perl' at (eval 5) line 260.
That line is
	      push(@regex_tests, "m'$regex'$iflag$mflag");
Any explanation would be appreciated.
 He's making up a regex for a later eval().




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

Date: Fri, 05 May 2000 11:45:36 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: search.bat - errors on Win32
Message-Id: <391227C0.11FA@modulus.com.au>

Steve A. Taylor wrote:
> 
> It's Jeff Friendl's search.bat script, but the most recent I've found
> is 97-03-29.
> When I run it on the command line with
> search -i 'perl';
> it returns an error message:
> search.bat internal error: Bad name after perl' at (eval 5) line 260.
> That line is
>               push(@regex_tests, "m'$regex'$iflag$mflag");
> Any explanation would be appreciated.
>  He's making up a regex for a later eval().
Assuming t ARGV values are going in as we see them (and 20 other
assumptions), don't you end up with
push(@regex_tests, "m''perl''");
after interpolation, i.e. what happens when:
- you omit the quoting around perl or
- change line 260 to push(@regex_tests, "m/$regex/$iflag$mflag");
?
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: 4 May 2000 20:00:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Text output
Message-Id: <8eshd7$dcn$1@orpheus.gellyfish.com>

On Wed, 03 May 2000 10:29:11 +1000 Amri, Kuross [WOLL:4009-I:EXCH] wrote:
> Hello, 
> 	I have a text file that has a formatted out put. It is some tables.
> When I created the link to display the text file it sends out a 500
> error. In the server logs it complains about unable to exec format. 
> 	Does enybody know what is happening or what I can do about it?
> 

Its pretty silly trying to execute a plain text file as a program I
would ask in the appropriate group for your server how not to have
it executed.  It has nothing to do with perl as you explain it.

/J\
-- 
It's not easy to juggle a pregnant wife and a troubled child, but somehow
I managed to fit in eight hours of TV a day.
-- 
fortune oscar homer


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

Date: Fri, 05 May 2000 06:49:18 GMT
From: kims@tip.net.au (Kim Saunders)
Subject: Variable -> filehandle / PerlMagick read from variable
Message-Id: <39126e0c.24362341@news.magna.com.au>

Hello,

I have an image in a variable, (from an SQL database). I want to Read
this with PerlMagick.

Is it possible to get PerlMagick to Read from a variable instead of a
file or filehandle??? I don't think so, it's not in any of my docs or
books.

OR

How can I put my variable into a filehandle somehow, so that perlmagic
will find load the filehandle and get the contents of the sting?

Thanks,

KimS

PS: *please* email me a copy of responses.


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

Date: 05 May 2000 09:36:29 +0100
From: nobull@mail.com
Subject: while(<@array>) (was: How to find a matching ")"?)
Message-Id: <u9ya5p75rm.fsf_-_@wcl-l.bham.ac.uk>

sjlen@ndirect.co.uk (Steve) writes:

> >Huh?  You do know that <...> is the operator to read a line from a 
> >filehandle, don't you?

Only if the stuff inside is a bareword or a simple scalar variable.
Otherwise <...> is glob().  See "perldoc perlop".

> while (<@the_names>)
> 
> Works without error messages in the instances I've used it.

See "perldoc perlop" and you can infer that this is interpreted as:
 
while (defined($_=glob("@the_names")))

Which in turn is more or less equivalent to:

foreach ( split( / /, `echo @the_names` ) )

Unless you really want to do call the shell to do glob expansion on
each item in @the_names this is probably not a good thing to do.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

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


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