[10873] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4474 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 21 17:07:28 1998

Date: Mon, 21 Dec 98 14: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, 21 Dec 1998     Volume: 8 Number: 4474

Today's topics:
        'make test ' to test Oracle connectivity using DBD fail <bageshpu@pa.dec.com>
    Re: arccos, arcsin,... <jim.michael@gecm.com>
    Re: ASP-like Session variables (Martien Verbruggen)
    Re: CGI Scripting (brian d foy)
        File Upload Script <bimmy@hotmail.com>
    Re: help!!! (brian d foy)
        How to read an Audio CD's TOC under LINUX (Sideliner)
    Re: installation error. need help (Martien Verbruggen)
    Re: need info on oraperl (John D Groenveld)
    Re: Nested sorting <uri@sysarch.com>
    Re: numbers in base 36 droby@copyright.com
    Re: Oracle 8.0.4 and Perl (John D Groenveld)
        Packaging a module with a script <chrislee@lavash.ius.cs.cmu.edu>
    Re: Perl Training - Worth it? (brian d foy)
        posting form data to 2 scripts at once <harvey@us1internet.com>
    Re: rename a large file problem (Mark-Jason Dominus)
    Re: rename a large file problem <guillaume@sandtechnology.com>
    Re: rename a large file problem <guillaume@sandtechnology.com>
        running perl commands in background (Neil Prater)
    Re: Running Perl for Win32 -- Beginner Question (Stephen C. Smith)
    Re: Splitting a line at |'s (Martien Verbruggen)
    Re: SSL (brian d foy)
    Re: SSL (Martien Verbruggen)
    Re: Stumped Perl Newbie - read all the FAQ's (Martien Verbruggen)
        what's wrong with this bit of code? :) <gavin@optus.net.au.dontspam.myass>
    Re: what's wrong with this bit of code? :) (Bart Lateur)
    Re: what's wrong with this bit of code? :) (Martien Verbruggen)
    Re: what's wrong with this bit of code? :) (brian d foy)
    Re: what's wrong with this bit of code? :) <jeromeo@atrieva.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 21 Dec 1998 13:26:36 -0800
From: Asha Bageshpura <bageshpu@pa.dec.com>
Subject: 'make test ' to test Oracle connectivity using DBD fails
Message-Id: <367EBD0C.429E7F8F@pa.dec.com>

Hi,
    I  have installed DBD Oracle . I tried to use 'make test' and it
fails with the following
    error  messages

make test
PERL_DL_NONLAZY=1 /log/perlmodules/perl4/bin/perl -I./blib/arch
-I./blib/lib -I/
log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
-I/log/perlmodules/perl4/lib -e
'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
t/*.t
t/base..............Can't locate DBI.pm in @INC (@INC contains:
 ./blib/arch ./bl
ib/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/l
ib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/lib/alpha-dec_osf/5.00404 /log/p
erlmodules/perl4/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlm
odules/perl4/lib/alpha-dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodul
es/perl4/lib/site_perl/alpha-dec_osf
/log/perlmodules/perl4/lib/site_perl/alpha-
dec_osf /log/perlmodules/perl4/lib/site_perl .
/log/perlmodules/perl4/lib/alpha-
dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodules/perl4/lib/site_perl/
alpha-dec_osf /log/perlmodules/perl4/lib/site_perl .) at t/base.t line
7.
dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-5
        Failed 5/5 tests, 0.00% okay
t/general...........Can't locate DBI.pm in @INC (@INC contains:
 ./blib/arch ./bl
ib/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/l
ib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/lib/alpha-dec_osf/5.00404 /log/p
erlmodules/perl4/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlm
odules/perl4/lib/alpha-dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodul
es/perl4/lib/site_perl/alpha-dec_osf
/log/perlmodules/perl4/lib/site_perl/alpha-
dec_osf /log/perlmodules/perl4/lib/site_perl .
/log/perlmodules/perl4/lib/alpha-
dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodules/perl4/lib/site_perl/
alpha-dec_osf /log/perlmodules/perl4/lib/site_perl .) at t/general.t
line 15.
BEGIN failed--compilation aborted at t/general.t line 15.
dubious
        Test returned status 2 (wstat 512, 0x200)
t/plsql.............Can't locate DBI.pm in @INC (@INC contains:
 ./blib/arch ./bl
ib/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/l
ib/alpha-dec_osf/5.00404
/log/perlmodules/perl4/lib/alpha-dec_osf/5.00404 /log/p
erlmodules/perl4/lib /log/perlmodules/perl4/lib/alpha-dec_osf/5.00404
/log/perlm
odules/perl4/lib/alpha-dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodul
es/perl4/lib/site_perl/alpha-dec_osf
/log/perlmodules/perl4/lib/site_perl/alpha-
dec_osf /log/perlmodules/perl4/lib/site_perl .
/log/perlmodules/perl4/lib/alpha-
dec_osf/5.00404 /log/perlmodules/perl4/lib
/log/perlmodules/perl4/lib/site_perl/
alpha-dec_osf /log/perlmodules/perl4/lib/site_perl .) at t/plsql.t line
15.
BEGIN failed--compilation aborted at t/plsql.t line 15.
dubious
        Test returned status 2 (wstat 512, 0x200)
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------

t/base.t          2   512     5    5 100.00%  1-5
t/general.t       2   512    ??   ??       %  ??
t/plsql.t         2   512    ??   ??       %  ??
Failed 3/3 test scripts, 0.00% okay. 5/5 subtests failed, 0.00% okay.
*** Exit 2
Stop.



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

Date: Mon, 21 Dec 1998 14:59:46 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: arccos, arcsin,...
Message-Id: <367EA8B2.26A@gecm.com>

Earl Westerlund wrote:
> 
> Christian wrote:
> >
> > hi
> hi
howdy
> > can anyone tell me how i can calc. the arccos ... with a perl script?
> 
> page 153 of the Blue Camel can.

Also, 

perldoc -f cos

HTH.

Cheers,

Jim


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

Date: Mon, 21 Dec 1998 21:17:00 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ASP-like Session variables
Message-Id: <gVyf2.9$%V5.183@nsw.nnrp.telstra.net>

In article <75lnqc$lp6$1@nickel.uunet.be>,
	"Joel Galvez" <svp95goj@student1.lu.se> writes:

> Do I have to do all this identification/timeout myself?
> And if I don't use embedded perl or such how do I store my session
> variables? Named pipe to a home written "Session-daemon"?

if I remember correctly, someone else asked this question a few weeks
ago, and there was quite a bit of discussion on it. You might find
what you need if you go to www.dejanews.com, and search the perl
newsgroups. (probably a search for ASP will give you the ones you
need)

Otherwise, the way you keep state for a CGI sequence is not really
perl specific. The people in comp.infosystems.www.* might have a
better idea off-hand on how to do it (there's a cgi group in there
somewhere)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd.       | am.
NSW, Australia                      | 


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

Date: Mon, 21 Dec 1998 15:07:28 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI Scripting
Message-Id: <comdog-ya02408000R2112981507280001@news.panix.com>

In article <75lu6q$bou$1@nnrp1.dejanews.com>, the3_amigos@hotmail.com posted:

> i was wondering if anybody here knew about CGI Scripting because i would like
> to learn. If you could maybe send some small files for me to look at a learn,
> that'd be great!

start with the CGI Meta FAQ, then ask questions in comp.infosystems.www.authoring.cgi.

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Mon, 21 Dec 1998 20:12:23 GMT
From: "jim" <bimmy@hotmail.com>
Subject: File Upload Script
Message-Id: <HYxf2.706$kY5.995@nnrp1.ptd.net>

Hello,

    I am working on a web site which I would like to incorporate a file
upload script into. I have found several of these scripts but none of them
seem to have everything I need. I am fairly new to PERL so I am having some
problems figuring out how to make the needed modifications. To make things
worse, the web site I am creating is specifically for Christmas. I am no
longer able to figure out how to create this script due to the lack of time.
If anyone is interested in helping me either find one or create one, I will
unfortunately not be able to pay, cash at least, but I will give you full
credit for the script with several links throughout the site back to you.
This web site could see more than a few thousand hits by the end of the
week! What I need is a file upload script that uploads to an admin specified
directory, only allows specific files to be uploaded, such as .jpg and .gif
files. One that also limits file size. If possible the script should also be
able to remove the uploaded files after a certain period of time on the
server. If you can help me with  this task then please e-mail me as soon as
possible! Thanks for your time!

-jim




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

Date: Mon, 21 Dec 1998 15:11:42 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: help!!!
Message-Id: <comdog-ya02408000R2112981511420001@news.panix.com>

In article <75m20m$f4j$1@nnrp1.dejanews.com>, nguyen.van@imvi.bls.com posted:

> I got stuck with this CGI script. Following is my script.
> 
> ___________________________________________________________
> 
> #! /opt/net/solaris/bin/perl -w
> 
> use CGI;
> use CGI::Carp;
> use Date::Manip qw(ParseDate UnixDate);
> $query = new CGI;
> $| = 1; #this is important b/c it autoflush the output. Script hang without it
> print "Content-type:text/html\n\n";
> 
> #print $query->header;
> 
> $event_dir = "/prod_share/eventlog";
> 
> read ( STDIN, $request_string, $ENV{'CONTENT_LENGTH'});
> 
> ( $key, $value ) = split ( /=/, $request_string );
[snip]

why are you using CGI.pm then doing this yourself?



> $view_all = $query->param('see'); $date = ParseDate('$view_all'); #if
> (!$date) #{ #  print "Bad date string: $date\n"; #} #else #{  my ($year,
> $month, $day) = UnixDate($date, "%Y", "%m", "%d"); #  print
> "$year\t$month\t$day\n";  if ( -e "$event_dir/event_log.$month$day$year" )  {
>  open ( FROM_EVENT_LOG, "<$event_dir/event_log.$month$day$year") or die "co

i think your script is missing line breaks (and maybe carriage returns
depending on your platform).  did you seriously expect anyone to try to
decipher this morass?

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Mon, 21 Dec 1998 21:27:45 GMT
From: Sideliner@somewhere.com (Sideliner)
Subject: How to read an Audio CD's TOC under LINUX
Message-Id: <367ebb57.5554998@news.netcomuk.co.uk>

Can anybody help me with this?

I would really like to read the Table Of Contents from an Audio CD in
PERL, under LINUX.

I need to be able to read the tracks list including sector offsets etc
from both IDE and SCSI CD-ROMS.

I have searched CPAN but can't find anything that comes close - any
hints or suggestions would be most welcome.

Please keep it as simple as possible as I am a newbie to PERL.

thanks,

Graham...

PS. I would appreciate it if any replies could also be sent to me by
email: perl@netcomuk.co.uk so I don't miss them!


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

Date: Mon, 21 Dec 1998 21:30:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: installation error. need help
Message-Id: <H5zf2.14$%V5.183@nsw.nnrp.telstra.net>

In article <367ea1f6.0@jolt.pagesat.net>,
	"joe chu" <wchu@evodata.net> writes:

> LD_RUN_PATH="" ld -o ../../lib/auto/B/B.so  none -L/usr/local/lib B.o
> ld: No such file or directory for none

It looks like you answered 'none' somewhere during the Configure
process, and it ended up being a literal name in there. You may have
to redo the configuration, and make sure to use only the answers it
expects.

If it isn't somehting you did, then you may need to inspect all the
files.

try starting again with a 'make distclean' to remove all possible
problems. or at least with a 'rm -f config.sh Policy.sh'.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about its friends.
NSW, Australia                      | 


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

Date: 21 Dec 1998 15:09:44 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: need info on oraperl
Message-Id: <75m9u8$ngv$1@tholian.cse.psu.edu>

Have your DBA install the Oracle client software for your webserver. Its
even available for Linux.
John
groenveld@acm.org


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

Date: 21 Dec 1998 15:19:46 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Nested sorting
Message-Id: <x7vhj5jli5.fsf@sysarch.com>

>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:

  Uri> if ( $key =~ /^!(.*)$/ ) {

  Uri> push( @sort_list, [$key, undef, $1] ) ;
  Uri> }
  Uri> else {
  Uri> push( @sort_list, [$key, $key, undef] ) ;

i would have used ?: but i felt the need for more verbose code as i was
demonstrating a logical point, not writing tight code.

  RLS> Nearly any time I see something of the form:

  RLS> 	for (@one_list) {
  RLS> 		push @another_list, some-func-of-$_;
  RLS> 	}

  RLS> 	@sort_list = map {
  RLS> 		/^!(.*)$/ ?
  RLS> 			[$_, undef, $1] :
  RLS> 			[$_, $_, undef]
  RLS> 	} @sort_input;

or 

push( @sort_list, /^!(.*)$/ ?
		[$key, undef, $1] :
		[$key, $key, undef] ) foreach @input_list ;

hey randal, i know what i was doing. i was just trying to demonstrate a
preprocessing sort idea without the extra confusion of explaining the ST
and maps. the original poster was having enough problems understanding
why you don't do processing work in the compare sub. this was just a way
to show hoe to break up the up and down keys into something that would
make for a faster sort.

also sometimes, there may be a need for separate phases of ST. let's say
in that case the ways keys are munged and managed is very runtime
dependent, then you might want to have seperate subs to to the input and
output phases of the "normalized" ST. so map is not needed. also it has
been shown somewhere here (larry?) that pushing and a foreach modifier
can be/is faster than map. why map is so slow is a curiosity. it looks
like it should be fast but it doesn't always act that way. i would have
done the push

  RLS> Of course TIMTOWTDI, but this seems, clearer to me.  And you can stack
  RLS> it with the other part of what you published just fine to make a truly
  RLS> normalized Schwartzian Transform.

you (and your namesake transform) are never "normal"! :-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 21 Dec 1998 21:07:11 GMT
From: droby@copyright.com
Subject: Re: numbers in base 36
Message-Id: <75md9s$os6$1@nnrp1.dejanews.com>

In article <comdog-ya02408000R1812981450020001@news.panix.com>,
  comdog@computerdog.com (brian d foy) wrote:
> # sub base2base
> # input: < cardinal number>
> #        < base of input number, in decimal >
> #        < base of output number, in decimal >
> #
> # output: number in output base
> #
> # LIMIT! works up to base 36 (we rely on 36 symbols to represent
digits)

Well, you could add a few odd symbols, say ' ', '$', '.', '%', to bring it up
to 40, then rearrange the order a bit and call it rad50.  ;-)

> sub base2base
>    {
>    my $num      = lc shift;
>    my $in_base  = shift;
>    my $out_base = shift;
>
>    my @digits = (0..9,'A'..'Z');
>
>    $in_base  = 10 unless $in_base  =~ /^\d+$/;
>    $out_base = 10 unless $out_base =~ /^\d+$/;
>
>    return $num if $in_base == $out_base;
>
>    #convert to a machine format
>    my $temp_num = 0;
>    my $count    = 0;
>    foreach my $digit ( reverse(split //, $num) )
>       {
>       $temp_num += $digit =~ m/^[0-9]$/ ?
>         $digit * ($in_base ** $count++) :
>         ord($digit) - 55;
>       }
>
>    #find the highest power of the output base
>    my $higher_power = int(log($temp_num)/log($out_base)); #God == Math
>
>    my $output = '';
>    foreach my $power ( reverse 0 .. $higher_power )
>       {
>       my $order = int( $temp_num / ($out_base**$power));
>       $temp_num = $temp_num - $order * ($out_base**$power);
>
>       $output .= $digits[$order];
>       }
>
>     return $output;
>     }
>

While I of course agree with the God == Math, this might be a little more
efficient:



    my @output = ();

    while ($temp_num) {
        unshift @output, $digits[$temp_num % $out_base];
        $temp_num = int($temp_num/$out_base);
    }

    return join('', @output);
    }

You don't really need those logs and exponentiations if you just do things
backwards.

--
Don Roby
droby@copyright.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 21 Dec 1998 15:07:37 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oracle 8.0.4 and Perl
Message-Id: <75m9q9$ng8$1@tholian.cse.psu.edu>

Goto CPAN, find your nearest mirror, download DBI/DBD::Oracle (Perl too if
you're running < perl5.004_04), read the README's.
http://www.cpan.org/
Happy Perl'ng
John
groenveld@acm.org


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

Date: 21 Dec 1998 15:02:46 -0500
From: Christopher Lee <chrislee@lavash.ius.cs.cmu.edu>
Subject: Packaging a module with a script
Message-Id: <68zp8h461l.fsf@lavash.ius.cs.cmu.edu>


I am finishing a perl script for use in tasks such as figuring out how
to link program to BLAS/LAPACK/FFTPACK on a given system --- I wrote
it to simplify my configure.in shell-scripts for building some
numerical libraries I have written.  The perl script, 'libdeps',
relies on a simple extendable text-file database module I wrote this
week, and I would like to distribute the script and the module
together.  The module is my first significant perl code, so I don't
want to distrubute it on its own at this time and I don't want to put
it anywhere too polluting on people's systems when 'libdeps' is
installed.

My question is: where is a good place to install my module when the
libdeps script is installed?  I don't want to clutter anyone's module
directory too badly with my newbie code.

My initial thinking is to accept a --perl-module-dir=<dir> directive
in the ./configure script which generates the Makefile, and to look at
perl's configuration for the default module location if this directive
is not used.  Then, I would put the module in
<module-dir>/apps/<script-name>/<module>.pm.

Does this match with standard Perl practice, or does anyone have a
better recommendation?  Thanks for any suggestions.

-- 
Christopher Lee
http://www.cs.cmu.edu/~chrislee
chrislee at ri.cmu.edu


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

Date: Mon, 21 Dec 1998 15:06:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Training - Worth it?
Message-Id: <comdog-ya02408000R2112981506490001@news.panix.com>

In article <F4BnAw.Joo@news.boeing.com>, "Sam Patton" <samuel.patton@wichita.boeing.com> posted:

> My only problem with the training that I have seen available is that its all
> geared to
> UNIX.  I and some of my associates would very much like to find a good class
> on
> on using PERL in the WIN32 environment.

i'm not sure what you mean by "geared towards UNIX" since any self
respecting Perl class would be teaching you "how to use Perl" rather
than "how to use Perl's system() function". 

perhaps you should take a class that teaches Perl, then pick up 
the bits for Win* from books such as "Learning Perl on Win32".  IMO
there's not enough Win* specific material to fill a course that
would be worth paying for.

however, if you really want a Win* Perl course, i'm sure any of the
companies advertising Perl training in TPJ would be more than
happy to create one for you :)

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Mon, 21 Dec 1998 20:21:11 GMT
From: Harvey Brodzki <harvey@us1internet.com>
Subject: posting form data to 2 scripts at once
Message-Id: <367EAE16.8D067F07@us1internet.com>

Being extremely new to perl, I have problem.
Is there a way to write a little script that can post form data
to 2 different scripts on different servers?
I want to silently send all the data to formmail.pl on my server.
And I need to send the user to another form processing script located
elsewhere.
It would be great if you could just do 2 posts with one submit.
All help is appreciated.
Harvey



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

Date: 21 Dec 1998 15:12:28 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: rename a large file problem
Message-Id: <75ma3c$5st$1@monet.op.net>

In article <75m218$lcu$1@agate.berkeley.edu>,
Dong Wang <dwang@nature.Berkeley.EDU> wrote:
># before unzip, delete the .bak file first
>unlink("oldfile.bak")
>|| die("Can't delete the oldfile.bak file.\n");
># rename the oldfile file to oldfile.bak
>rename("oldfile", "oldfile.bak") || die("Can't rename oldfile.\n");

Oh, don't do that. Get rid of the `unlink'.  The whole point of
`rename' is that if it fails, you still have the original files.  

Also, most `die' should look like this:

	die("Can't rename oldfile: $!; aborting";

Because then, if it fails, you get a more useful message.  Instead of

	Can't rename oldfile.

you get:

	Can't rename oldfile: Permission denied; aborting at q.pl line 17

The `permission denied' can put you on the track to finding out what
the problem is.

But I suspect that there's something important you're not telling us,
because `rename' is guaranteed to leave the file intact, either under
the old name, or the new name, but not both.  But you say

>oldfile.bak is deleted. And "oldfile" is missing too. Now I have only 
>the newfile.gz left. 

Which suggests that you omitted something from your problem
description.  (Or else you have an extremely broken system---and in my
experience, the former is much more likely.)

>What's the cause of this problem? Any suggestions are appreciated.

You've gone to some trouble to suppress or ignore all the diagnostic
information that the program is trying to give you about what is
wrong.    Add `$!' to all the `die's, and get rid of the 2>&1 in the `gunzip':

>die("Can't unzip newfile.\n") if `gunzip newfile.gz 2>&1`;

Or at the very least, replace it with 

 die("Can't unzip newfile.\n") if `gunzip newfile.gz 2>/tmp/q.pl.gunzip.err`;

or some such.  Then if something goes wrong with gunzip you can find
out what it was.

Without better diagnostics, it's hard to offer better advice.



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

Date: 21 Dec 1998 12:16:45 PST
From: Guillaume Dupuis <guillaume@sandtechnology.com>
Subject: Re: rename a large file problem
Message-Id: <367EAD86.A74B22F5@sandtechnology.com>

> unlink("oldfile.bak")
> || die("Can't delete the oldfile.bak file.\n");

First, be sure that your file is really erased, because I've tried to
rename a file with a name that already existed, and unlike it is written
in the books, it did not over-write it (I use perl under NT).

> rename("oldfile", "oldfile.bak") || die("Can't rename oldfile.\n");

What I did is:
###########

$new_file = "data\.gz";
$bak_file = "data\.gz\.bak";
rename($new_file,$bak_file);

############

Dont forget the "\" or else it will take the "." for a literal
character...
I also tried to use rename with the literal file names:

rename(data\.gz, data\.gz\.bak);

 ...
but it does't work, I get compilation errors.
And if I do it without the "\", I don't get any errors messages, nor
results...


-- 
Guillaume Dupuis,
Nucleus QA

mailto:guillaume@sandtechnology.com
http://www.sandtechnology.com


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

Date: 21 Dec 1998 12:30:22 PST
From: Guillaume Dupuis <guillaume@sandtechnology.com>
Subject: Re: rename a large file problem
Message-Id: <367EB0B7.70C37E89@sandtechnology.com>

Ooooooooops!

> rename(data\.gz, data\.gz\.bak);
> but it does't work, I get compilation errors.

I screwed-up here.....
If I do:

rename("data.gz", "data.gz.bak");
 ...
It works.

So I guess that you should just be sure that your source file is
erased...
(Which I verified, and your syntax works...)

-- 
Guillaume Dupuis,
Nucleus QA

mailto:guillaume@sandtechnology.com
http://www.sandtechnology.com


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

Date: Mon, 21 Dec 1998 11:39:34 -0800
From: neil.prater@ype.gmpt.gmeds.com (Neil Prater)
Subject: running perl commands in background
Message-Id: <Xtxf2.2268$n4.19670150@WReNphoon2>

In my perl program I am running a unix command to display a text box
message. When run, my perl script will not continue until the process for
the unix command dies. Is there a way to run perl commands in the
background, allowing the program to continue? This is what my line currently
looks like:
     `/usr/bin/X11/xdialog &`;
The & allows unix commands to be run in the background, but the perl program
still halts until I kill the xdialog process. Any help would be grateful.



*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***


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

Date: Mon, 21 Dec 1998 21:07:16 GMT
From: homeplate@halostorm.com (Stephen C. Smith)
Subject: Re: Running Perl for Win32 -- Beginner Question
Message-Id: <367eb935.3991607@news>

	To one and all ... a Good Samaritan e-mailed me the solution.  It
involved setting the Properties for the DOS window, disabling an
advanced feature that prevents MS-DOS programs from detecting Windows.
Once I turned that off, the DOS window remained open after the Perl
program executed.
	Thanks again to everyone who helped.
	Stephen


Visit the "Anaheim Angels and Lake Elsinore Storm" Web Site
http://www.halostorm.com


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

Date: Mon, 21 Dec 1998 21:08:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Splitting a line at |'s
Message-Id: <yNyf2.6$%V5.183@nsw.nnrp.telstra.net>

In article <adrade-2112980127370001@pool1-054.wwa.com>,
	adrade@wwa.com (Adam Levy) writes:
> In article <367D3E44.FDA9C016@home.com>, Rick Delaney
> <rick.delaney@home.com> wrote:

>>     ($one,$two,$three) = split(/\|/,$vartobesplit,3);
> 
> Of course I meant that, you self declared idiot. If you had read the

If you meant that, then you should have written that. If you post
wrong code, you can expect it to be corrected by someone who spots the
error. If you can't handle that, then you shouldn't post code. If your
error was not corrected, then the readers of this newsgroup who don't
know already that it's wrong will learn something wrong.

You should lighten up a little.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Advertising:  The science of arresting
Commercial Dynamics Pty. Ltd.       | the human intelligence long enough to
NSW, Australia                      | get money from it.


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

Date: Mon, 21 Dec 1998 15:08:36 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: SSL
Message-Id: <comdog-ya02408000R2112981508360001@news.panix.com>

In article <nfxf2.488$YD4.22872185@news.randori.com>, "HJB" <hjbraendle@gmx.net> posted:

> just before I spending hours on trying this out:
> Does ae1 know if and how I can access secure server pages (SSL) via cgi
> scripts?

yes.

> Can I use LWP and the normal functions to access HTML pages?

yes.

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Mon, 21 Dec 1998 21:26:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: SSL
Message-Id: <z2zf2.12$%V5.183@nsw.nnrp.telstra.net>

In article <nfxf2.488$YD4.22872185@news.randori.com>,
	"HJB" <hjbraendle@gmx.net> writes:

> Does ae1 know if and how I can access secure server pages (SSL) via cgi
> scripts?

I don't really know if ae1 knows that. Ae1 normally doesn't post here,
at least not that I know. But since your question is about SSL and
CGI, maybe you are looking for the ae1 that lives in one of the
comp.infosystems.www.* groups, possibly
comp.infosystems.www.authoring.cgi.

> Can I use LWP and the normal functions to access HTML pages?

Since you didn't specifically mention that you want ae1 to answer this
question, I'll have a stab at it:

Sure.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Mon, 21 Dec 1998 21:10:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Stumped Perl Newbie - read all the FAQ's
Message-Id: <bPyf2.8$%V5.183@nsw.nnrp.telstra.net>

In article <367dcc80.0@nemo.idirect.com>,
	"Roger McIlmoyle" <roger_mcilmoyle@woodbridgegroup.com> writes:
> I've been trying to get perl to execute / generate HTML.
> 
> From the command line it generated a good html file that works.
> 
> When I call it from the browser (Microsoft's), I get a server 500 errror.
> I have: #! c:\Perl\5.005\bin\MSWin32-x86-object\perl.exe

Your code looks ok to me on first glance. Maybe you should check your
server's error logs to find out what the exact error message was.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about its friends.
NSW, Australia                      | 


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

Date: Mon, 21 Dec 1998 20:41:00 GMT
From: "Gavin Cato" <gavin@optus.net.au.dontspam.myass>
Subject: what's wrong with this bit of code? :)
Message-Id: <wnyf2.1$i04.186794@news0.optus.net.au>

This don't work! It compiles ok in perl but doesnt send a message, I can't
see anything in the log by sendmail sayinf it has sent it / tried to. In
short it's a mystery.

Any ideas guru's? :)

sub mailatt {


open MAIL, "|$sendmail -t -i";
print MAIL "To: $destination\n";
print MAIL "From: $replyto\n";
print MAIL "Route update as follows, from $replyto - $companyname \n\n";
print MAIL "Origin AS:\t$as\n";
print MAIL "Transit AS:\t7474\n";
print MAIL "Action:\tADD\n";
print MAIL "Route registered in:\tRADB\n";
print MAIL "Neighbour Address:\t$peer\n";
print MAIL "\n";
print MAIL "Routes:\n";
print MAIL "\n";
print MAIL "$network $mask\n";
close MAIL;

print "Message sent\n";

}




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

Date: Mon, 21 Dec 1998 21:05:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <367fb7fd.1754579@news.skynet.be>

Sorry to rub your nose in a clichi, but:

Gavin Cato wrote:

>open MAIL, "|$sendmail -t -i";

You should check the result of the open. It could well be that launching
sendmail doesn't work.

	open MAIL, "|$sendmail -t -i" 
		or die "Oops! Can't use sendmail: $!";

Also, where's your separation between headers and message?

>print MAIL "Route update as follows, from $replyto - $companyname \n\n";

This isn't a valid header. You need a blank line before the body of the
message (usually recognized by the two "\n"s in a row). And where's you
subject line?

   HTH,
   Bart.


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

Date: Mon, 21 Dec 1998 21:40:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <Efzf2.15$%V5.183@nsw.nnrp.telstra.net>

In article <wnyf2.1$i04.186794@news0.optus.net.au>,
	"Gavin Cato" <gavin@optus.net.au.dontspam.myass> writes:

> This don't work! It compiles ok in perl but doesnt send a message, I
> can't see anything in the log by sendmail sayinf it has sent it /
> tried to. In short it's a mystery.

Very likely, sendmail never got executed, but you never check for
that. You also don't tell us what is in $sendmail:

> open MAIL, "|$sendmail -t -i";

You should check the return code of this to see if the fork succeeded.
You may also want to have a look at the return of the close.

open(MAIL, "| $sendmail -t -i") || die "Couldn't fork: $!";

> print MAIL "To: $destination\n";

All of these prints are better written with a here-doc syntax (perldoc
perldata)

> print MAIL "From: $replyto\n";
[SNIP]
> close MAIL;

close(MAIL) || die "Couldn't close: $!";

Those two checks should tell you whether sendmail ever ran, and if it
ran, whether it closed properly.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.       | the people out there are dumber.
NSW, Australia                      | 


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

Date: Mon, 21 Dec 1998 16:47:44 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <comdog-ya02408000R2112981647440001@news.panix.com>

In article <wnyf2.1$i04.186794@news0.optus.net.au>, "Gavin Cato" <gavin@optus.net.au.dontspam.myass> posted:

> This don't work! It compiles ok in perl but doesnt send a message, I can't
> see anything in the log by sendmail sayinf it has sent it / tried to. In
> short it's a mystery.

hmmm... no error checking and it doesn't look like a proper mail
message.  where does the header end and the body begin?



> open MAIL, "|$sendmail -t -i";
> print MAIL "To: $destination\n";
> print MAIL "From: $replyto\n";
> print MAIL "Route update as follows, from $replyto - $companyname \n\n";
> print MAIL "Origin AS:\t$as\n";
> print MAIL "Transit AS:\t7474\n";
> print MAIL "Action:\tADD\n";
> print MAIL "Route registered in:\tRADB\n";
> print MAIL "Neighbour Address:\t$peer\n";
> print MAIL "\n";
> print MAIL "Routes:\n";
> print MAIL "\n";
> print MAIL "$network $mask\n";
> close MAIL;

-- 
brian d foy                     <brianNOSPAM@NOSPAM.smithrenaud.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
remove NOSPAM or don't.  it doesn't matter either way.


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

Date: Mon, 21 Dec 1998 13:35:11 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <367EBF0F.DF4255A1@atrieva.com>

Bart Lateur wrote:

> Gavin Cato wrote:
> >open MAIL, "|$sendmail -t -i";
> 
> You should check the result of the open. It could well be that launching
> sendmail doesn't work.
> 
>         open MAIL, "|$sendmail -t -i"
>                 or die "Oops! Can't use sendmail: $!";

Because it is opening for a write, this my not be effective.  This
person should be reading perlipc, while paying special attention to the
following:

"Be careful to check both the open() and the close() return values. If
you're writing to a pipe, you should also trap SIGPIPE. Otherwise, think
of what happens when you start up a pipe to a command that doesn't
exist: the open() will in all likelihood succeed (it only reflects the
fork()'s success), but then your output will fail--spectacularly. Perl
can't know whether the command worked because your command is actually
running in a separate process whose
exec() might have failed. Therefore, while readers of bogus commands
return just a quick end of file, writers to bogus command will trigger a
signal they'd better be prepared to handle."

Checking the return value of open() is always a Good Thing, but
sometimes 'die' isn't enough to do it.


Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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