[11606] in Perl-Users-Digest
Perl-Users Digest, Issue: 5206 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 23 11:07:28 1999
Date: Tue, 23 Mar 99 08:00:35 -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 Tue, 23 Mar 1999 Volume: 8 Number: 5206
Today's topics:
<< string definer (Timothy Larson)
Re: AnyDBM_File vs. size (Steve van der Burg)
Bad Byte Count bryan.c.spann@nationsbank.com
Re: CGI.pm questions <fty@utk.edu>
Re: CGI.pm questions (Randal L. Schwartz)
Re: CGI.pm questions melLA@west.net
Re: Checking Directories contents.. <jdf@pobox.com>
Re: Checking Directories contents.. <Michael.Cameron@REMOVETHIS.technologist.com>
Re: Checking Directories contents.. <Michael.Cameron@REMOVETHIS.technologist.com>
cookie value is an array elvis@NOTGRACELANDclark.net
Re: Database suggestion <fty@utk.edu>
Re: date in perl under nt <mpmcgill@bellatlantic.net>
Date/Time calculation: % through current month? <tony@crux.blackstar.co.uk>
Re: Encryption Problem <donny@impulsesoftware.com>
Re: help with loops <Michael.Cameron@REMOVETHIS.technologist.com>
Re: help with loops (Dan Wilga)
Re: How to redirect in new window? <Michael.Cameron@REMOVETHIS.technologist.com>
How to watch socket connections? <naren@injersey.com>
Re: How to watch socket connections? <Michael.Cameron@REMOVETHIS.technologist.com>
Re: HTML in email (I.J. Garlick)
Re: listing Changed deleted and new files (Aart Koelewijn)
LWP Question <donny@impulsesoftware.com>
Q : Best way to implement a C struct? <gkd1@keystonenet.com>
Re: Script to download a file from https site <harald.nospam@duerr-online.de>
Starting programs under Win95 (Matti Johannes Kdrki)
Re: View CGI source <gsx97@usa.net>
Re: Why don't wildcards expand on cmd line- win32 v5.00 ran@netgate.net
Re: Why don't wildcards expand on cmd line- win32 v5.00 (Bart Lateur)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Mar 1999 15:23:29 GMT
From: larsot2@krypton.mankato.msus.edu (Timothy Larson)
Subject: << string definer
Message-Id: <7d8blh$dv8$1@nitrogen.mankato.msus.edu>
In _Teach Yourself Perl in 21 Days_ I found a neat use of << to define
multiline strings. I tried it with Perl 5.004 on linux and it doesn't
work. OK, the book is an old one, so I was thinking maybe this use of
<< has been dropped. Does anyone know? I haven't found a mention of it
so far. I just thought it would be a convenient way to make my comment
block into a string that could be shown to the user if something goes
wrong.
Tim
PS I'll keep looking and post if I find anything.
------------------------------
Date: Tue, 23 Mar 1999 14:53:56 GMT
From: steve.vanderburg@lhsc.on.ca (Steve van der Burg)
Subject: Re: AnyDBM_File vs. size
Message-Id: <7d89ls$e5@falcon.ccs.uwo.ca>
In article <36f6f3d4$0$211@nntp1.ba.best.com>, "J. David Eisenberg" <nessus@shell5.ba.best.com> wrote:
>I have a text file with some 27000 records in it.
>Each file begins with an eight-digit (unique) number.
>
>When, on my PC running Linux and perl 5.005_02, I create a database
>using the eight-character digit string as key and the
>entire line as a value, the 4 megabyte file grows to about
>7 megabytes; not a big problem. (The resultant file is
>called "mydata.db")
>
>When I transfer the perl code and original text file to
>a different Unix system (I think it's sgi) and run perl
>5.005_02, the program generates about 3000 records before
>it dies, as the resulting file ("mydata.pag") is over 90
>megabytes and I'm out of room. There's also a file called
>"mydata.dir" I could expect a small difference in resultant
>file sizes, but this is way out of proportion.
>
On the SGI, it looks like AnyDBM is using NDBM_File, which uses ndbm
databases, which are sparse files (ie. they have large holes, and appear much
larger than they are to things like "ls"). Also, ndbm files have size
restrictions on keys and values, which is why the database populate step is
failing. On the Linux box, ndbm is either not being used, or is being
emulated by something like gdbm, which doesn't have size limitations and
doesn't use sparse files.
One solution would be to use DB_File or GDBM_File on the SGI, which will
require you to install Berkeley DB or GNU gdbm.
..Steve
--
Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Email: steve.vanderburg@lhsc.on.ca
------------------------------
Date: Tue, 23 Mar 1999 15:34:44 GMT
From: bryan.c.spann@nationsbank.com
Subject: Bad Byte Count
Message-Id: <7d8cak$ct$1@nnrp1.dejanews.com>
Hello All!
Here is a problem that seems to be causing major havok with the group I
work in(E-Mail A.K.A Exchange Server).
THE PROBLEM: we have a script that goes out and grabs a snapshot of the
priv.edb and pub.edb files that are in the exchange server directory, we are
trying to find out how much space is free and how much is used by employee's
public folders, the only problem is that if the number it returns is 9 digits
or above it will give us a skewed answer. For example the number is either
completely wrong or there is a negative sign in front of it.
THE CODE:
open (cfgfile,"cfg.txt");
$sername = <cfgfile>;
open ( outfile,">output.txt");
printf outfile ("ServerName\tPriv\tPub\n");
while($sername)
{
$sername =~ s/\n//g;
$privpath = sprintf("\\\\%s\\d\$\\exchsrvr\\mdbdata\\priv.edb",$sername);
$pubpath = sprintf("\\\\%s\\d\$\\exchsrvr\\mdbdata\\pub.edb",$sername);
$privsize = 0;
scalar($privpath) = @filearr;
$privsize = -s $privpath;
$privsize = scalar($privsize);
$pubsize = -s $pubpath;
printf ("$privpath\n");
printf ("%s\n",$privsize);
printf ("%s\n",$privsize);
printf outfile ("%s\t%s\t%s\n",$sername,$privsize,$pubsize);
$sername = <cfgfile>;
}
If anyone can figure out this truncating problem I would worship you as a PERL
GOD!
Thanks
Bryan Spann
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 23 Mar 1999 08:00:24 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: CGI.pm questions
Message-Id: <36F79068.483A8DD@utk.edu>
ffchopin@worldnet.att.net wrote:
>
> Use the errorsToBrowser feature of CGI.pm to send errors to the
> browser. I forget the syntax offhand, but I think it is just:
>
> use cgi(errorsToBrowser)
>
> If I am mistaken, please post a follow-up.
Not quite. Like this:
#!/usr/bin/perl -Tw
use CGI;
use CGI::Carp qw(fatalsToBrowser);
...
__END__
Take care of your shoes...jay
------------------------------
Date: 23 Mar 1999 06:43:22 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CGI.pm questions
Message-Id: <m1d8205ks5.fsf@halfdome.holdit.com>
>>>>> "melLA" == melLA <melLA@west.net> writes:
melLA> I'm in the process of chucking my Perl 4 form-processing
melLA> routines and start from scratch using the magnificent CGI.pm
melLA> routines. I just read the entire CGI.pm documentation and have
melLA> some questions in that regard.
Yeah! Welcome to the late 90's. :)
Besides the other places that people are likely to suggest, you can
find *many* examples of using CGI.pm in my monthly WebTechniques Perl
column, archived online through a generous arrangement with the
publisher at <URL:http://www.stonehenge.com/merlyn/WebTechniques/>.
And, if you have CGI-related Perl questions, the best place to ask is
comp.infosystems.www.authoring.cgi, not here.
print "Just another Perl hacker and web-whacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 23 Mar 1999 15:33:18 GMT
From: melLA@west.net
Subject: Re: CGI.pm questions
Message-Id: <36f7b2a2.52574254@news.west.net>
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>>>>>> "melLA" == melLA <melLA@west.net> writes:
>
>melLA> I'm in the process of chucking my Perl 4 form-processing
>melLA> routines and start from scratch using the magnificent CGI.pm
>melLA> routines. I just read the entire CGI.pm documentation and have
>melLA> some questions in that regard.
>
[snipped worthless recommendations]
>
>And, if you have CGI-related Perl questions, the best place to ask is
>comp.infosystems.www.authoring.cgi, not here.
>
>Name: Randal L. Schwartz
Randall, you're wrong. If you had not snipped my original post beyond
comprehension, it would have shown that my specific questions were
germaine to the CGI.pm module, which is written in Perl. My questions
were not CGI related in any specific sense -- they were definitely
Perl related. comp.infosystems.www.authoring.cgi threads are not
language specific. Please try again with worthwhile advice if you have
any.
Milt
(remove all CAPS from my e-addr)
x-no-archive: yes
------------------------------
Date: 23 Mar 1999 09:46:06 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Mick <horizon@internetexpress.com.au>
Subject: Re: Checking Directories contents..
Message-Id: <m3yakouuvl.fsf@joshua.panix.com>
Mick <horizon@internetexpress.com.au> writes:
> $type = ( -d "$user_path$p_month\\$entry" ) ? "dir" :
> Which doesn't work (It picks up . and .. I think)....The problem is
> this does work in DOS? why?
Because you're using a backwhack as the path separator.
@files = grep { -f "$userpath/$pmonth/$entry" } readdir DIR;
will work in WinDos and Unix.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 23 Mar 1999 14:57:39 +0000
From: Michael Cameron <Michael.Cameron@REMOVETHIS.technologist.com>
To: Mick <horizon@internetexpress.com.au>
Subject: Re: Checking Directories contents..
Message-Id: <36F7ABE3.24336B41@REMOVETHIS.technologist.com>
Mick wrote:
> Hi...is there a simple way to check if a directory contains any files?
>
You could use the following to create an array of files in the current
directory except for those with name . and ..
opendir(DIR, $directory) or die "Could not open directory
($directory) $!";
my @filelist = grep { !/^\.\.?$/ } readdir(DIR);
You can easily test @filelist, e.g.
if (@filelist) {
print "There are files!\n"
}
if you only want plain files you can use map to create full paths and add
another grep which includes a test on the file type, e.g.
my @filelist = grep { -f } map {"$directory/$_" } grep {
!/^\.\.?$/ } readdir(DIR);
HTH,
Michael
------------------------------
Date: Tue, 23 Mar 1999 14:59:37 +0000
From: Michael Cameron <Michael.Cameron@REMOVETHIS.technologist.com>
Subject: Re: Checking Directories contents..
Message-Id: <36F7AC59.6BE2334A@REMOVETHIS.technologist.com>
> You could use the following to create an array of files in the current
> directory except for those with name . and ..
>
Did I say current? Of course I meant named...
------------------------------
Date: 23 Mar 1999 13:40:00 GMT
From: elvis@NOTGRACELANDclark.net
Subject: cookie value is an array
Message-Id: <7d85jg$36b$1@callisto.clark.net>
I can write a cookie and send a hash fine:
$cookie1 = cookie(
-name => 'PROFILE',
-value => \%some_value_hash,
-expires => '+1h',
) ;
print "Set-Cookie: $cookie1\n" ;A
however if I try to write an array to the cookie
\@arrayname
or @arrayname
for the value
I only see the names of the params passed, but not the contents.
For example if I have a webpage that passes form data "age" and "income" and I collect the data:
@arrayname = param ;
then try to write it to a cookie
$cookie1 = cookie(
-name => 'MYCOOKIE',
-value => \@arrayname,
-expires => '+1h',
) ;
print "Set-Cookie: $cookie1\n" ;
when I view the cookie contens in the webbrowser when the cookie is sent I only see
blah blah cookie to be set with name and value of
MYCOOKIE=age&income
if that was a hash I see
MYCOOKIE=age&value&income&value
Any ideas on what I am doing wrong?
--
Bill
elvis@clark.net
------------------------------
Date: Tue, 23 Mar 1999 08:08:30 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: Database suggestion
Message-Id: <36F7924E.844BB10B@utk.edu>
Neil Prater wrote:
>
> What would be the best possible database tool to run with perl on a unix
> platform. I currently dump my output to a text file and just go from there,
> but I want to be more efficient. I've read about oraperl, but I'm not sure
> what my options are. I'm the only perl programmer
> in the area, so I'm kinda limited when I ask for suggestions. Anything you
> got would be greatly appreciated.
> Thank you
If you know SQL then take a look at mySQL ( www.mysql.com ). Then you
can use the DBI/DBD modules off of CPAN. Good luck.
Take care of your shoes...jay
------------------------------
Date: Tue, 23 Mar 1999 08:34:58 -0500
From: Michael P McGill <mpmcgill@bellatlantic.net>
Subject: Re: date in perl under nt
Message-Id: <36F79882.517A6A23@bellatlantic.net>
"r|digerD" wrote:
>
> this is my first contact with newsgroups
> working with a little perlscript to print out date and time there is no
> problem with my linux.
> the line:
> $date_command = " /bin/date";
> what is the correct syntax under nt to get the actually time and date?
> thanx for your help
The following works on 98, I guess it would work the same on NT
$now = localtime;
print "Current time: $now\n";
------------------------------
Date: 23 Mar 1999 15:09:46 GMT
From: Tony Bowden <tony@crux.blackstar.co.uk>
Subject: Date/Time calculation: % through current month?
Message-Id: <922201774.843113@news.tibus.net>
I've been trying to produce some pretty basic stats, whereby knowing how
many times an event has happened so far this month, I want to estimate
how many times it's likely to happen in the month.
This is quite simple once I work out how far into the current month it is...
but actually finding that out is relatively tricky!
My basic logic is that I find out
a) how many seconds into the month it is
b) how many seconds are in this month
This obviously involves knowing
1) the date/time it is now
2) when this month started
3) how long this month is, _or_ 4) when next month starts
I figure that if I need to know (2) then it's easier to get (4) than
worry about days_in_month type stuff to do 3, so I'm left with a basic
equation of:
now - start_of_month
-----------------------------
end_of_month - start_of_month
I've played with a variety of the Date and Time modules, but I can't find
one that will neatly give me all this information. Time::ParseDate has
promise, but I can't calculate the start / end of month stuff from it.
Date::DateManip or Date::DateCalcLib seem useful for this, but this all
seems like a lot of overhead, for what should surely be a relatively
straightforward calculation....
So, is there
a) any easier way I'm missing to get this figure?
or
b) any way of getting it using just one pre-existing module?
and if not, is it worth writing a module for something like this? It seems
this wouldn't be that unusual a task ...
Thanks
Tony
--
-----------------------------------------------------------------------------
Tony Bowden | tony@blackstar.co.uk http://www.blackstar.co.uk/
Black Star | The UK's Biggest Video & DVD store * Free Postage Worldwide
-----------------------------------------------------------------------------
------------------------------
Date: Tue, 23 Mar 1999 15:44:05 GMT
From: Donny Widjaja <donny@impulsesoftware.com>
Subject: Re: Encryption Problem
Message-Id: <36F7B762.46A9C159@impulsesoftware.com>
Use the international version. http://www.pgpinternational.com
"Tobias C. Wilhelm" wrote:
>
> I'm in the middle of setting up a store front for one of our customers
> and it turns out that they can not use PGP since their offices are
> located overseas. Is there any other options, such as 40-bit encryption
> that work nicely in a CGI script and are easy to be decrypted using NC
> or IE ???
> Any help is appreciated ...
>
> Tobias C. Wilhelm
> --
> ****************************************
> * Tobias C. Wilhelm *
> * CEO / Vice President *
> * webmaster@unicorn-soft.com *
> ****************************************
> * Unicorn Software Development Inc. *
> * *
> * Visit Our Website *
> * http://www.unicorn-soft.com *
> ****************************************
------------------------------
Date: Tue, 23 Mar 1999 15:02:48 +0000
From: Michael Cameron <Michael.Cameron@REMOVETHIS.technologist.com>
To: Chris Denman <c-denman@dircon.co.uk>
Subject: Re: help with loops
Message-Id: <36F7AD18.34C5863@REMOVETHIS.technologist.com>
Chris Denman wrote:
> I have a program which gets into a loop. There are many parts to this
> program, so it is hard to find out which sub has the loop.
>
> Is there any way of finding out where a program has got into a loop. I have
> the perl DK and the debugger, but the debugger gets into a loop also. I
> have not found a way to stop the debugger and get the line number that it is
> at.
>
> I could manually work through the code, but I have a deadline to stick to.
>
> Cheers for any help,
>
> Chris D
Are you using s or n to step through the code in the debugger? It could make
all the difference.
DB<1> h s
s [expr] Single step [in expr].
DB<2> h n
n [expr] Next, steps over subroutine calls [in expr].
DB<3>
HTH,
Michael
------------------------------
Date: Tue, 23 Mar 1999 10:10:37 -0500
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: help with loops
Message-Id: <dwilgaREMOVE-2303991010370001@wilga.mtholyoke.edu>
> Is there any way of finding out where a program has got into a loop. I have
> the perl DK and the debugger, but the debugger gets into a loop also. I
> have not found a way to stop the debugger and get the line number that it is
> at.
If you're using Unix, you *should* be able to ^C to get the debugger to
stop. However, I've found some cases where Perl won't respond to SIGINT
during tight loops. I can even ^Z the program and `kill -s SIGINT` it, and
it still won't respond.
If you're not using Unix, the above probably doesn't apply :-)
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: Tue, 23 Mar 1999 15:18:39 +0000
From: Michael Cameron <Michael.Cameron@REMOVETHIS.technologist.com>
To: Tracey Bobek <tbobek@vlnk.net>
Subject: Re: How to redirect in new window?
Message-Id: <36F7B0CF.183E89D5@REMOVETHIS.technologist.com>
Tracey Bobek wrote:
> I know how to create a list box the redirects the user to another website
> within the same browser window. How do you redirect the user to another
> website in a new window? (Like the "TARGET=_blank" tag in HTML?)
>
> I think the answer is simple, but I'm having trouble.
>
> Thanks for the help,
>
> Chris
And I expect that simple answer is found on one of the relevant newsgroups.
But I suspect not this one...
------------------------------
Date: Mon, 22 Mar 1999 20:29:07 -0500
From: Narendra Ravi <naren@injersey.com>
Subject: How to watch socket connections?
Message-Id: <36F6EE63.3AA27F05@injersey.com>
Hi,
I'd appreciate any help in the following scenario.
Scenario: A TCP client
The client has some socket connections (typically 4) and a STDIN,
STDOUT. I would like to be able to watch the socket connections
and reconnect if the server I connect to closes a socket connection.
The usual behavior of the program is that after reading in a command
on STDIN, I send the command to a socket (the command determines which
socket). Then I read the socket until the end of the command response
has been received. But sometimes, the response takes a few minutes,
and that socket connection can be killed.
If this happens, I would like to close the concerned connection and
try to re-establish the connection with the server.
How would I do this in Perl? My earlier solution involved C++ with a
proprietary event-management library and a proprietary sessions level
protocol. I'm trying to rewrite this in Perl to make it easier to
maintain.
Please reply-to if this is not of general interest, or post otherwise.
Thank you,
-- Narendra Ravi (naren@injersey.com)
------------------------------
Date: Tue, 23 Mar 1999 15:12:49 +0000
From: Michael Cameron <Michael.Cameron@REMOVETHIS.technologist.com>
To: narendra@spiff.hr.att.com, naren@injersey.com
Subject: Re: How to watch socket connections?
Message-Id: <36F7AF71.FAE15CAD@REMOVETHIS.technologist.com>
Narendra Ravi wrote:
> Hi,
>
> I'd appreciate any help in the following scenario.
>
> Scenario: A TCP client
>
The following all have information which can help:
perlfunc
Socket
IO::Socket
Programming Perl
perlipc
The Perl Cookbook
I would highly reccommend the latter, Chapter 17, Section 1, "Writing a
TCP Client"
HTH,
Michael
------------------------------
Date: Tue, 23 Mar 1999 14:15:56 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: HTML in email
Message-Id: <F91wyK.4Kv@csc.liv.ac.uk>
In article <8D91C9940phoenyx@news.southwind.net>,
Karen J. Cravens <silver+web@wirebird.com> writes:
> "Brian" brian@removethisnet-weaver.com wrote in
> <7d3tcg$cgi$1@winter.news.rcn.net>:
>
>
>> print MAIL "From: $in{'author'}\n";
>> print MAIL "Subject: Article Submission\n\n";
>> print MAIL "Content-Type: \"text/html;\"\n\n";
>
> You'll also want to add the header:
> Mime-Version: 1.0
>
No not necessarily. He could have a misguided idea of rfc1049.
I will agree it is the most likely scenario but the inclusion of a
Content-Type does not automatically mean it's a MIME encoded message. With
a value of text/html it should. I mean it's conceivable (improbable) that
he only read upto rfc1049. :-) Yeah Ok, I am stretching it, but hopefully
you see what I am getting at.
Besides I don't think this has anything to do with Perl anymore.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Egotist, n.:
A person of low taste, more interested in himself than me.
-- Ambrose Bierce, "The Devil's Dictionary"
------------------------------
Date: 23 Mar 1999 13:13:40 GMT
From: aart@mtack.xs4all.nl (Aart Koelewijn)
Subject: Re: listing Changed deleted and new files
Message-Id: <7d8424$98s$2@mtack.xs4all.nl>
In article <7d6ef2$1lou$1@midnight.cs.hut.fi>,
jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni) writes:
> Has anyone created a solution that can get list
> of changed,deleted and new files on certain tree.
>
> DATA::Dumper, MD5 and FILE::Find should do it, but i am sure that
> i am not the first one that has had need for thing like this, so
> the is no idea for reinventing an obsolate code..
>
> And non perlish(unix) solutions are ok too.
>
> My idea is to have a computer to replicate all changed files to another
> computer over a slow network.
>
There is a (Linux) C program, Sitecopy which I think will do what you
want.
The sitecopy.lsm file:
Title: sitecopy
Version: 0.4.0
Entered-date: 01FEB99
Description: sitecopy is for easily maintaining remote web sites.
With a single command, the program will upload files
to the server which have been changed locally, and
delete files from the server which have been removed
locally, to keep the remote site synchronized with the
local site. FTP and WebDAV servers are supported.
Keywords: www, web, site, management, remote, upload, FTP, WebDAV
Author: joe@orton.demon.co.uk (Joe Orton)
Primary-site: sunsite.unc.edu /pub/Linux/apps/www/misc/
71kb sitecopy-0.4.0.tar.gz
Platforms: Linux, FreeBSD (maybe others)
Copying-policy: GPL
Hope this helps.
Aart
--
Aart Koelewijn | Linux 2.0.36
E-mail: aart@mtack.xs4all.nl | my newsserver kills all
http://www.xs4all.nl/~mtack/ | Content-Type: multipart/* messages
------------------------------
Date: Tue, 23 Mar 1999 15:59:03 GMT
From: Donny Widjaja <donny@impulsesoftware.com>
Subject: LWP Question
Message-Id: <36F7BAE5.BE9436D3@impulsesoftware.com>
Hi,
I am trying to make a connection with another server to process a credit
card transaction. I pass all the information by using LWP::UserAgent
module. The method I use is $agent->request($request_info,
\&parseReturn);
Inside the parseReturn procedure, I process the return value from the
request and need to return two variables back to the main program, but I
don't know how can I return those value.
Can someone help me?
Thank you.
------------------------------
Date: 23 Mar 1999 15:19:17 GMT
From: "Gregory K. Deal" <gkd1@keystonenet.com>
Subject: Q : Best way to implement a C struct?
Message-Id: <01be7540$bffae440$41a208cf@TR-DEALGKREM.tr.unisys.com>
My data structure can be thought of as a 2 dimensional array with the
first dimension being a cluster number, and the second dimension pointing
to various attributes of a particluar cluster. But, some of these
attributes want to be another array of numbers, so I just continued with
the dimensioning and seem to be working OK with 3 dimensional access. My
concern is that, although this seems to be working, it is not the best/most
efficient/elegant/etc. way of doing it. I've reviewed Programming Perl,
Chapter 4, "References and nested data structures", and see their use of
multidimensional array access, but with their examples of lists of lists,
hashes of hashes, etc., I suspect I'm not making use of important
features/ideas. The perldoc files I have seem to just be a summary of the
book. So, the question is : Is there a standard way of turning a general C
struct (or Pascal record) into a Perl data structure? All my subscripts are
numeric, so general use of hashes doesn't seem needed, but are they
better/faster/easier to make multidimensional? Thanks for any help or
guidance.
------------------------------
Date: Tue, 23 Mar 1999 13:02:58 +0100
From: "News" <harald.nospam@duerr-online.de>
Subject: Re: Script to download a file from https site
Message-Id: <7d7vhk$ppp$1@kilbeggan.xlink.net>
Use module Net::SSLeay
You'r also going to need the SSLeay library.
William P. <spark@alertcom.com> wrote in message
news:36F68F1A.4F19AFE@alertcom.com...
> Does anybody have a script that downloads a text file from https site? I
> have a script that downloads file from ftp site from NT server but now I
> have to download a file from https site for security reason.
>
> Any help on this would be really appreciated.
>
>
>
------------------------------
Date: 23 Mar 1999 14:51:45 GMT
From: makarki.NOSPAM@news.hit.fi (Matti Johannes Kdrki)
Subject: Starting programs under Win95
Message-Id: <7d89q1$sv8$1@news.hit.fi>
I'm starting a web browser (IE4.0) under Windows 95 with following line:
`start index.html`;
or
system("start index.html");
For some reason this will halt my perl script for about 15 seconds. I'm
using Perl 5.005_03 (ActiveState Perl).
Is there any way to execute that command line any faster? That 'start'
part is required because I cannot be sure that IE is the default browser.
(Is there any way to check the full path name for the default browser
under Win95 or NT4 with Perl?)
--
Matti J. Kdrki
------------------------------
Date: Tue, 23 Mar 1999 09:40:16 -0500
From: "J. Parsons" <gsx97@usa.net>
Subject: Re: View CGI source
Message-Id: <7d890s$i6j@news1.snet.net>
Nope, not of the actual script. It can be done if the site that shows it is
demonstrating the script for download, they may display it as a text file
like http://www.freecode.com does. For some reason, this doesn't quite sound
like the case though.
Buy a book. Read. Learn. Do it. You'll be happier in the long run. Learn to
fish...eat for a lifetime, you know?
Good luck.
> I've seen a CGI script which I want to use, but I can't find the source
> anywhere.
> Is there a possibility to view the CGI source straight from a page?
------------------------------
Date: Tue, 23 Mar 1999 13:15:27 GMT
From: ran@netgate.net
Subject: Re: Why don't wildcards expand on cmd line- win32 v5.005_02
Message-Id: <922194927.972.82@news.remarQ.com>
In <36F6D569.AABBBB24@bellatlantic.net>, Michael P McGill <mpmcgill@bellatlantic.net> writes:
>If I
>specify all the files I want to process on the command line, my program
>works great, but I don't think this is how it is supposed to be.
It's a "design philosophy thing": shells for the *nix family of OSes do
all the wildcard expansion on the command line before passing it to the
program. Ones from the RT-11 family (CP/M, MS-DOS, etc) don't, and
leave that job to the program.
If you're trying to make a port of a *nix-based tool, you have a tough
choice: do you make it handle arguments like *nix, for portability?
Or do you make it work like DOS, for compatibility with other tools the
user may be accustomed to? Most people doing ports lean toward the
former, and hide the "translation". Looks like ActiveState decided to
"go native", and make the new version work like other tools in the DOS
box.
If you prefer the *nix style, you should consider using one of the free
ports of Bourne or Korn shell. They're much nicer environments, if
you're a programmer, and mostly transparent if you're not (so you can
let non-techies use it without much fear). Except for one unfortunate
difference: there are a few DOS commands (like "rename" and "copy")
whose syntax depends heavily on the *program* doing wildcard expansion,
and on DOS filenames being "two-part" (name and extension). If you've
had a lot of years to get used to that, it can trip you up.
Your next best choice is to put the patches back in ActiveState to do
the expansion for you. But it needs to be aware of whether the calling
shell has already done that: see below.
Doing your own expansion can be risky, because it's hard to be certain
that it hasn't been done already. You could wind up doing filename
globbing on a wildcard character the user had escaped on the command
line.
There's definitely a design trade-off here, of compatibility with
"native look-n-feel" vs "portability". It probably makes more sense to
lean toward the "portability" side, because it's unlikely that you
installed Perl just to run this one program, and you don't want to be
jumping through the globbing hoops every time you add another *nix-based
tool to your toolkit.
Ran
------------------------------
Date: Tue, 23 Mar 1999 14:16:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why don't wildcards expand on cmd line- win32 v5.005_02
Message-Id: <36f7a1f8.415507@news.skynet.be>
Michael P McGill wrote:
>Why do I get the message:
>"Can't open *.log: No such file or directory"
>
>from the following command line:
>"C:\Data>perl chk_log.pl *.log"
Are there any *.log files? I noticed in DJPerl on DOS that if there is
no file matchiung the wildcard, thze wildcard isn't expanded (to
nothing). Could be the case here, too.
HTH,
Bart.
------------------------------
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 5206
**************************************