[15553] in Perl-Users-Digest
Perl-Users Digest, Issue: 2966 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 6 14:05:47 2000
Date: Sat, 6 May 2000 11:05:19 -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: <957636318-v9-i2966@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 6 May 2000 Volume: 9 Number: 2966
Today's topics:
@array holding %hash <ganix#gmx.net>
Re: @array holding %hash <tony_curtis32@yahoo.com>
Re: @array holding %hash <lr@hpl.hp.com>
ANNOUNCE: Parse-Yapp-1.02 released <francois@fdesar.net>
beginner: read in variable <david@celtic1888.fsbusiness.co.uk>
Re: beginner: read in variable (Clay Irving)
Re: beginner: read in variable <dave@dave.org.uk>
Re: Can I open an http stream using perl as CGI ? <lyndon@xellent.co.uk>
Re: Can I open an http stream using perl as CGI ? <tony_curtis32@yahoo.com>
Re: CGI problem !! Need Help!! <gellyfish@gellyfish.com>
cgi script log file <chris@texas.net>
Re: cgi script log file <tony_curtis32@yahoo.com>
Re: cgi script log file <andy@u2me3.com>
Clinet/Server and inetd <thomas2@dalnet.se>
Re: Clinet/Server and inetd <calle@lysator.liu.se>
Re: Color under MSDOS/NT <gellyfish@gellyfish.com>
control the browser from a CGI or Perl <efelemban@yahoo.com>
Re: control the browser from a CGI or Perl <tony_curtis32@yahoo.com>
Re: control the browser from a CGI or Perl (David Efflandt)
Re: date manipulations/library <detroitpulse100@NO-SPAM.hotmail.com>
Re: date manipulations/library (Clay Irving)
Re: DCOM in Perl <carvdawg@patriot.net>
Re: Dialing a Modem with Perl markhunnibell@my-deja.com
Re: Error at line 0 ? [Was: Exceptions that can't be ca <rootbeer@redcat.com>
Re: file upload <flavell@mail.cern.ch>
Flame my code <preble@ipass.net>
Re: Flame my code <gene01@smalltime.com>
Re: gethostbyaddre: Address family not supported by pro <flavell@mail.cern.ch>
Re: Help meeded with web to mail cgi without response <flavell@mail.cern.ch>
Help! Which disrtibution should I get? <prestoncheung@hongkong.com>
Re: Help! Which disrtibution should I get? <lr@hpl.hp.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 6 May 2000 18:03:19 +0200
From: "Ganix" <ganix#gmx.net>
Subject: @array holding %hash
Message-Id: <8Ly3gc3t$GA.50@news-02.uni.net>
Hi!
I'm writing a cgi script, that reads in some sets of data from
a text file. Since every set consist of several lines, I think it
is wise to create an @array that holds one %hash for each
set of data.
Now my problem is that I am not able to put these hashes
into the array.
I have tried all I can think about. The most reasonable way
seems to me:
push @array, %table;
But this fills the array with the single keys and values.
Then I tried:
push @array, [%table];
But now the problem is to read the %table back.
I'll be gracefull for every hint.
Thanks for reading.
------------------------------
Date: 06 May 2000 11:26:44 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: @array holding %hash
Message-Id: <8766srve4b.fsf@shleppie.uh.edu>
>> On Sat, 6 May 2000 18:03:19 +0200,
>> "Ganix" <ganix#gmx.net> said:
> Hi! I'm writing a cgi script, that reads in some sets
> of data from a text file. Since every set consist of
> several lines, I think it is wise to create an @array
> that holds one %hash for each set of data. Now my
> problem is that I am not able to put these hashes into
> the array. I have tried all I can think about. The most
> reasonable way seems to me: push @array, %table; But
> this fills the array with the single keys and values.
> Then I tried: push @array, [%table]; But now the problem
> is to read the %table back.
Is this the kind of thing you're trying to do?
my @array; # array = bad variable name, should be more descriptive
while (<DATA>) {
chomp;
my @entries = split /\s+/;
my %hash;
for (@entries) {
my ($k, $v) = split /=/;
$hash{$k} = $v;
}
push @array, \%hash;
}
foreach my $a (@array) {
print join(', ', map {"$_=$$a{$_}"} keys %$a), "\n";
}
__DATA__
x=1 y=2
tony=34
z=7
The key is to derefence the hash.
hth
t
------------------------------
Date: Sat, 6 May 2000 09:57:01 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: @array holding %hash
Message-Id: <MPG.137deeb44f136f5e98aa15@nntp.hpl.hp.com>
In article <8Ly3gc3t$GA.50@news-02.uni.net> on Sat, 6 May 2000 18:03:19
+0200, "Ganix" <ganix#gmx.net> <"Ganix" <ganix#gmx.net>> says...
> I'm writing a cgi script, that reads in some sets of data from
> a text file. Since every set consist of several lines, I think it
> is wise to create an @array that holds one %hash for each
> set of data.
> Now my problem is that I am not able to put these hashes
> into the array.
> I have tried all I can think about. The most reasonable way
> seems to me:
> push @array, %table;
> But this fills the array with the single keys and values.
> Then I tried:
> push @array, [%table];
> But now the problem is to read the %table back.
Your attempt creates an anonymous array, which unrolls the elements of
the hash into a list of key-value pairs. It is better to create a
reference to an anonymous hash instead:
push @array, { %table };
Now to get back the first (say) hash,
%{$array[0]}
The best place to read about this is probably the Data Structure
Cookbook.
perldoc perldsc
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 01 May 2000 13:28:18 +0200
From: François Désarménien <francois@fdesar.net>
Subject: ANNOUNCE: Parse-Yapp-1.02 released
Message-Id: <8f12cl$vef$1@play.inetarena.com>
Parse-Yapp-1.02 has just been uploaded to CPAN. It should be
available soon on your nearest CPAN mirror.
This version is mostly a bug fix.
There was a *bad* bug in Lalr.pm
which could, in a few cases, generate erroneous parsers. A valid
input was always correctly parsed, but in some very rare cases, a
bad token could be accepted which would lead to trigger wrong
reductions.
So you should consider to upgrade as soon as possible.
I also added a new method, YYLexer, which returns a reference to
the lexer routine, and corrected a bug in the driver, so using
YYErrok in error recovery routine will effectively resume parsing.
If you have questions or ideas on how to improve Parse::Yapp, don't
hesitate to email me.
Enjoy,
François Désarménien
Here is the README file:
Parse::Yapp - Parse::Yapp Yet Another Perl Parser compiler
Compiles yacc-like LALR grammars to generate Perl OO parser modules.
COPYRIGHT
(c) 1998-2000 Francois Desarmenien, all rights reserved.
(see the Copyright section in Yapp.pm for usage and distribution rights)
IMPORTANT NOTES
While I'll will maintain and improve it through your comments and bug
reports, further developments will go in another version numbering
scheme I haven't choosed yet (probably "a la linux", with even sub-numbers
beeing production. Advises are, of course, very welcome).
Note that with future versions, the interface *may* change and be
incompatible with previous version, although I'll try hard not to break
backward compatibility, I'll always choose efficiency as a first
criteria.
The Parse::Yapp pod section is the main documentation and it assumes
you already have a good knowledge of yacc. If not, I suggest the GNU
Bison manual which is a very good tutorial to LALR parsing and yacc
grammar syntax.
The yapp frontend has now its own documentation using either
'perldoc yapp' or (on systems with man pages) 'man yapp'.
The documentation is (still) only a draft and should be rewritten (I think).
Any help on this issue would be very welcome.
DESCRIPTION
This is production release 1.02 of the Parse::Yapp parser generator.
It lets you create Perl OO fully reentrant LALR(1) parser
modules (see the Yapp.pm pod pages for more details) and has
been designed to be functionnaly as close as possible to yacc,
but using the full power of Perl and opened for enhancements.
REQUIREMENTS
Requires perl5.004 or better :)
It is written only in Perl, with standard distribution modules,
so you don't need any compiler nor special modules.
INSTALLATION
perl Makefile.PL
make
make test
make install
WARRANTY
This software comes with absolutly NO WARRANTY of any kind.
I just hope it can be useful.
FEEDBACK
Send feedback, comments and bug reports to:
Francois Desarmenien <francois@fdesar.net>
------------------------------
Date: Sat, 6 May 2000 13:18:28 +0100
From: "David" <david@celtic1888.fsbusiness.co.uk>
Subject: beginner: read in variable
Message-Id: <8f1js9$u8r$1@news8.svr.pol.co.uk>
Hi, i'm just learning perl on Win95(with some help from perl5 by example)
and I am wondering if there is some way to read in a value to my perl
thingies and assign it to a variable (i'm from a Pascal background). The
prorgam i'm trying to create has two arrays
@array1 (1..5)
@array2 ("David", "Paul", "Jim", "Pat", "Tam")
and I want it to read a number 1 to 5 and print out the corresponding name,
for example I type in 1 and it is placed into the code to print out "David",
something like
print array2( numberthatItyped - 1) <-- ought to print out the first element
of array2, which is David, my question is how do I read in the initial
number and then place it into that print statement? I know my code above
isn't perfect, but I know how to do the array stuff- it's in my book...
TIA
--David--
------------------------------
Date: 6 May 2000 17:21:30 GMT
From: clay@kozmik.skechers.com (Clay Irving)
Subject: Re: beginner: read in variable
Message-Id: <8f1kap$e6q$1@news.panix.com>
On Sat, 6 May 2000 13:18:28 +0100,
David <david@celtic1888.fsbusiness.co.uk> wrote:
>Hi, i'm just learning perl on Win95(with some help from perl5 by example)
>and I am wondering if there is some way to read in a value to my perl
>thingies and assign it to a variable (i'm from a Pascal background). The
>prorgam i'm trying to create has two arrays
>
>@array1 (1..5)
>@array2 ("David", "Paul", "Jim", "Pat", "Tam")
>
>and I want it to read a number 1 to 5 and print out the corresponding name,
>for example I type in 1 and it is placed into the code to print out "David",
>something like
The first element of the array is 0, not 1.
>print array2( numberthatItyped - 1) <-- ought to print out the first element
>of array2, which is David, my question is how do I read in the initial
>number and then place it into that print statement? I know my code above
>isn't perfect, but I know how to do the array stuff- it's in my book...
This program:
#!/usr/local/bin/perl -w
@array1 = (0..4);
@array2 = ("David", "Paul", "Jim", "Pat", "Tam");
foreach $number(@array1) {
if ($array2[$number]) {
print "$number - $array2[$number]\n";
}
}
prints:
0 - David
1 - Paul
2 - Jim
3 - Pat
4 - Tam
--
Clay Irving
clay@panix.com
------------------------------
Date: Sat, 06 May 2000 19:01:44 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: beginner: read in variable
Message-Id: <jcn8hsk8iuaqf0fubji6q36v4v9ibrbd56@4ax.com>
On 6 May 2000 17:21:30 GMT, clay@kozmik.skechers.com (Clay Irving)
wrote:
>On Sat, 6 May 2000 13:18:28 +0100,
>David <david@celtic1888.fsbusiness.co.uk> wrote:
>
>>Hi, i'm just learning perl on Win95(with some help from perl5 by example)
>>and I am wondering if there is some way to read in a value to my perl
>>thingies and assign it to a variable (i'm from a Pascal background). The
>>prorgam i'm trying to create has two arrays
>>
>>@array1 (1..5)
>>@array2 ("David", "Paul", "Jim", "Pat", "Tam")
>>
>>and I want it to read a number 1 to 5 and print out the corresponding name,
>>for example I type in 1 and it is placed into the code to print out "David",
>>something like
>
>The first element of the array is 0, not 1.
>
>>print array2( numberthatItyped - 1) <-- ought to print out the first element
>>of array2, which is David, my question is how do I read in the initial
>>number and then place it into that print statement? I know my code above
>>isn't perfect, but I know how to do the array stuff- it's in my book...
>
>This program:
>
> #!/usr/local/bin/perl -w
>
> @array1 = (0..4);
> @array2 = ("David", "Paul", "Jim", "Pat", "Tam");
>
> foreach $number(@array1) {
> if ($array2[$number]) {
> print "$number - $array2[$number]\n";
> }
> }
>
>prints:
>
> 0 - David
> 1 - Paul
> 2 - Jim
> 3 - Pat
> 4 - Tam
I think that the OP's question was more about reading a user's input
from the keyboard so that a user can enter a number from 1 to 5 and
the script displays the appropriate name.
If I'm right, then he should probably read the section on I/O
operators in the perlop man page.
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
YAPC::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Sat, 6 May 2000 16:51:19 +0100
From: "Lyndon Leggate" <lyndon@xellent.co.uk>
Subject: Re: Can I open an http stream using perl as CGI ?
Message-Id: <391440c1@news.server.worldonline.co.uk>
I have managed to do this, however it only works on Win32 and so might not
work for you, but anyway here it is:
use Win32::Internet;
$inet = new Win32::Internet();
@htmlfile = $inet->FetchURL("http://www.someaddress.com");
The data returned is in ascii format ... which is where I am currently stuck
.... because things are much easier (in my opinion) if it could be in
binary! Anyone know how to change it from ascii to binary?
Lyndon
"George & Michelle Wilkinson" <ragnad@erols.com> wrote in message
news:8efin1$1pi$1@bob.news.rcn.net...
> Hi,
>
> I'm looking to open a web page as a file so I can
> parse and extract selected data.
>
> I (naively) tried
>
> open (HFILE, "<" . "http:/www.somedomain.com/hfile.html") ||
> die "No dice !\n";
>
> But this didn't work.
>
> I searched for a simple solution with no luck.
>
> Is it possible to do this ?
>
> Thanks,
> George
>
>
------------------------------
Date: 06 May 2000 11:00:26 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Can I open an http stream using perl as CGI ?
Message-Id: <87bt2jvfc5.fsf@shleppie.uh.edu>
>> On Sat, 6 May 2000 16:51:19 +0100,
>> "Lyndon Leggate" <lyndon@xellent.co.uk> said:
[ please post the original article and then put your
reply/additions after it, otherwise noone can work out how
the articles are threaded ]
> I have managed to do this, however it only works on
> Win32 and so might not work for you, but anyway here it
> is:
> use Win32::Internet; $inet = new Win32::Internet();
> @htmlfile =
> $inet->FetchURL("http://www.someaddress.com");
> "George & Michelle Wilkinson" <ragnad@erols.com> wrote
> in message news:8efin1$1pi$1@bob.news.rcn.net...
>> Hi,
>>
>> I'm looking to open a web page as a file so I can parse
>> and extract selected data.
>>
>> I (naively) tried
>>
>> open (HFILE, "<"
>> . "http:/www.somedomain.com/hfile.html") || die "No
>> dice !\n";
>>
>> But this didn't work.
>>
>> I searched for a simple solution with no luck.
perldoc LWP::Simple
should do what you want. And it's portable :-)
http://search.cpan.org/
if it's not installed. Use cpan or ppm to install it as
Bundle::LWP
hth
t
------------------------------
Date: 6 May 2000 14:09:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI problem !! Need Help!!
Message-Id: <8f15io$ifr$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Kelvin <k2_1999@hotmail.com> wrote:
> I've wrote a script and put it on the server.
> It works fine when I call it with the following argument:
> http://poseidon.ultraservers.net/~10206/cgi-bin/vote/vote.cgi?show=1
> but when I call it with the following argument:
> http://poseidon.ultraservers.net/~10206/cgi-bin/vote/vote.cgi?game=4wd
> The script would not run and ask me to download it!
>
The mist is clearing, I see a bug, possibly in line 17 of your program,
a bug wherein if the second argument is passed the program will output
an incorrect 'Content-Type:' header. Oh the spirits are fading ....
/J\
--
I don't want to go, so if he asks me to go, I'll just say, 'Yes!'
--
fortune oscar homer
------------------------------
Date: Sat, 06 May 2000 10:20:01 -0700
From: Chris <chris@texas.net>
Subject: cgi script log file
Message-Id: <39145441.640A2CC2@texas.net>
Please can you help me, I am trying to write a CGI script that behaves
as follows;
every time a browser requests an image from a particular page, the
script captures
the IP address of the browser and appends it to a file.
This 'log-file' needs to be in the form of an HTML document.
------------------------------
Date: 06 May 2000 10:55:57 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: cgi script log file
Message-Id: <87em7fvfjl.fsf@shleppie.uh.edu>
>> On Sat, 06 May 2000 10:20:01 -0700,
>> Chris <chris@texas.net> said:
> Please can you help me, I am trying to write a CGI
> script that behaves as follows; every time a browser
> requests an image from a particular page, the script
> captures the IP address of the browser and appends it to
> a file. This 'log-file' needs to be in the form of an
> HTML document.
The best solution within the framework of your question
might be to configure your WWW server to handle this image
request via CGI: the program updates its files and returns
the image stream, but that's outside the scope of this
group.
use CGI;
my $client_addr = remote_host(); # may need to try a name lookup here
Then you need to write this to a file in some format
(CGI.pm provides nice HTML shortcut methods) so
use CGI qw(:html3);
or something similar, q.v.
Don't forget to lock the file you're writing to in case 2
requests are being processed at the same time,
$ perldoc -q lock
On the other hand, why not just parse the logfile that the
WWW server keeps for you after the fact?
$ perldoc Logfile
http://search.cpan.org/
hth
t
------------------------------
Date: Sat, 6 May 2000 18:50:08 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: cgi script log file
Message-Id: <8f1lvh$66k$1@uranium.btinternet.com>
Hey,
A better way to do it would be to use the logging feature of your web site's
web server (i.e. Apache, Zeus etc.), and then write a simple script to strip
out the relative information and format it with html every once in a while
...
Executing a CGI script everytime an image is hit would be pretty resource
intensive.
Thanks, Andy.
andy@u2me3.com
------------------------------
Date: Sat, 06 May 2000 14:55:25 GMT
From: "Thomas Åhlen" <thomas2@dalnet.se>
Subject: Clinet/Server and inetd
Message-Id: <xnWQ4.28$c2.4084@dummy.bahnhof.se>
Hi!
My perl server take advantage of inetd handling socket connections.
Q: What is the best way to get ip's of clients connecting to my server?
Since i only got STDIN, STDOUT, STDERR to play with and i need the socket
from
inetd to get this information. Do i have to skip inetd and write my own
socket connection
code to get this information or does inted pass it to my server in some way?
-Thomas
------------------------------
Date: 06 May 2000 17:28:57 +0200
From: Calle Dybedahl <calle@lysator.liu.se>
Subject: Re: Clinet/Server and inetd
Message-Id: <86r9bf3dfq.fsf@tezcatlipoca.algonet.se>
>>>>> "Thomas" == Thomas Åhlen <thomas2@dalnet.se> writes:
> Since i only got STDIN, STDOUT, STDERR to play with and i need the
> socket from inetd to get this information.
STDIN is the socket from inetd.
--
Calle Dybedahl, Vasav. 82, S-177 52 Jaerfaella,SWEDEN | calle@lysator.liu.se
"I'd rather hang on to madness than normality" -- KaTe Bush
------------------------------
Date: 5 May 2000 23:26:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Color under MSDOS/NT
Message-Id: <8evhqc$dmp$1@orpheus.gellyfish.com>
On Fri, 05 May 2000 16:21:38 GMT Aurelien wrote:
> Hello !
>
> I have a problem to have color under MS-DOS (Windows NT). I have installed
> ActivePerl with PPM. I have installed the Termios-ANSIColor module and when
> I run my script I don't have color but I have the colors codes. What can I
> do to have color ?
>
I answered one of your colleagues. You need the ANSI.sys driver or the
NT equivalent. Ask in an NT group about how to install and load it.
/J\
--
Now what is a wedding? Well, Webster's dictionary describes a wedding
as the process of removing weeds from one's garden.
--
fortune oscar homer
------------------------------
Date: Sat, 06 May 2000 10:30:04 GMT
From: <efelemban@yahoo.com>
Subject: control the browser from a CGI or Perl
Message-Id: <sh7t1cemoju158@corp.supernews.com>
Can I control the Browser from my cgi program somthing like
open new window
create a shortcut
or close the browser window ?
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 06 May 2000 09:29:53 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: control the browser from a CGI or Perl
Message-Id: <87k8h7vjj2.fsf@shleppie.uh.edu>
>> On Sat, 06 May 2000 10:30:04 GMT,
>> <efelemban@yahoo.com> said:
> Can I control the Browser from my cgi program somthing
> like open new window
> create a shortcut
(a shortcut to what?)
> or close the browser window ?
No. Or to be more exact: for whatever you try in your
program on the server-side, you can come up with valid
browser/user-agent counter-examples that don't behave as
you wanted.
hth
t
------------------------------
Date: 6 May 2000 15:18:28 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: control the browser from a CGI or Perl
Message-Id: <slrn8h8dua.jqf.efflandt@efflandt.xnet.com>
On Sat, 06 May 2000, efelemban@yahoo.com <efelemban@yahoo.com> wrote:
>Can I control the Browser from my cgi program somthing like
> open new window
> create a shortcut
>or close the browser window ?
Maybe, if your CGI outputs browser side scripting that is a suitable
version for the browser and that scripting method is not disabled in the
browser. But that is not a Perl issue.
For a shortcut, I assume you mean a link, which you can do as long as you
escape quoted quotes or quote quotes with a different kind of quotes.
Or simply use CGI.pm.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sat, 06 May 2000 13:22:43 GMT
From: "Jeff L." <detroitpulse100@NO-SPAM.hotmail.com>
Subject: Re: date manipulations/library
Message-Id: <D0VQ4.3767$9Q5.432463@typhoon.mw.mediaone.net>
You're looking for Date::Calc, find it on CPAN.
"Randon Loeb" <rloebusenet@cticonsulting.net> wrote in message
news:39135A4E.B63E514D@cticonsulting.net...
> I am looking for a library that will do things like allow me to add and
> subtract days from a given date, giving me the new date. It would take
> into account # of days in each month, etc.. Most languages have some
> function called dateserial, something like this. I'm finding hard to
> explain, if you understand and have an answer please email me.
> Thanks,
> --
> Randon Loeb
> CTI Consulting and Training
> rloeb@cticonsulting.net
> 954-971-6888
> DO NOT ADD THIS ADDRESS TO ANY JOKE LISTS OR OTHER LISTS
------------------------------
Date: 6 May 2000 16:24:05 GMT
From: clay@kozmik.skechers.com (Clay Irving)
Subject: Re: date manipulations/library
Message-Id: <8f1gv5$daj$1@news.panix.com>
On Fri, 05 May 2000 18:33:34 -0500,
Randon Loeb <rloebusenet@cticonsulting.net> wrote:
>I am looking for a library that will do things like allow me to add and
>subtract days from a given date, giving me the new date. It would take
>into account # of days in each month, etc.. Most languages have some
>function called dateserial, something like this. I'm finding hard to
>explain, if you understand and have an answer please email me.
Perl Reference -> time
http://www.perl.com/reference/query.cgi?time
--
Clay Irving
clay@panix.com
------------------------------
Date: Sat, 06 May 2000 09:41:00 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: DCOM in Perl
Message-Id: <391420EC.C03F3466@patriot.net>
Win32::OLE
dpao@go.to wrote:
> Greetings,
>
> Does anyone know of a Perl module that allows DCOM access.
> Has anyone ever done anything with DCOM in Perl?
> If you did please give me some pointers/resources.
>
> --
> Posted via CNET Help.com
> http://www.help.com/
------------------------------
Date: Sat, 06 May 2000 17:11:29 GMT
From: markhunnibell@my-deja.com
Subject: Re: Dialing a Modem with Perl
Message-Id: <8f1jnm$2k8$1@nnrp1.deja.com>
In article <3911DCA7.2AE856CC@My-Deja.com>,
Makarand Kulkarni <makarand_kulkarni@My-Deja.com> wrote:
> > I searched CPAN and
> > came up essentially empty, which surprised me,
>
> Search on CPAN came up with
> Modem::Vgetty
Thanks for the reply. I saw that one and bypassed it because it
seems to be specific about voicemodems which I understood to be
different from standard modems.
Thanks for the reference to the program code.
Mark Hunnibell
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 6 May 2000 09:13:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Error at line 0 ? [Was: Exceptions that can't be caught by eval {} and local $SIG]
Message-Id: <Pine.GSO.4.10.10005060912140.6766-100000@user2.teleport.com>
On Sat, 6 May 2000, John Lin wrote:
> called at C:\DBIinsert.pl line 0
> require 0 called at C:\DBIinsert.pl line 0
That's got to be a bug. Use perlbug to report it. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 6 May 2000 17:50:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: file upload
Message-Id: <Pine.GHP.4.21.0005061748210.2874-100000@hpplus01.cern.ch>
On Fri, 5 May 2000, Veronica Adams wrote:
> use cgi.pm
What's that? I'd use CGI.pm.
> If your host doesn't have it installed
If your host doesn't have CGI.pm installed, then it isn't a competent
installation of Perl. Either it is hopelessly out of date (and
therefore has known security holes), or they deliberately removed this
standard component of the installation (and thus presumably wouldn't
welcome you installing your own copy).
------------------------------
Date: Sat, 6 May 2000 13:24:18 -0400
From: "E. Preble" <preble@ipass.net>
Subject: Flame my code
Message-Id: <5zYQ4.271$c71.1009@saturn.ipass.net>
I have a code snippet below. Can it be better? (of course
it can)
purpose:
Search a list of names in a array and create a new array
with unique names only.
For Example, if the array is:
file1.txt
file2.txt
file2.txt
file3.txt
file2.txt
The new array will have:
file1.txt
file2.txt
file3.txt
with NO duplicate entries of file2.txt. Here's my code
(written in PerlAmateur v1.0):
foreach $FileName (@File) {
$found = 0;
foreach $Entry (@ListOfFileNames) {
if ($FileName eq $Entry) {
$found=1;
}
}
if ($found == 0) {
@ListOfFileNames = (@ListOfFileNames, "$FileName");
}
}
Thanks ahead for input.
Edward Preble
------------------------------
Date: 06 May 2000 14:02:14 EDT
From: gene <gene01@smalltime.com>
Subject: Re: Flame my code
Message-Id: <gene01-AF78FC.11021406052000@news.concentric.net>
In article <5zYQ4.271$c71.1009@saturn.ipass.net>, "E. Preble"
<preble@ipass.net> wrote:
>I have a code snippet below. Can it be better? (of course
>it can)
>
>purpose:
>Search a list of names in a array and create a new array
>with unique names only.
>For Example, if the array is:
>file1.txt
>file2.txt
>file2.txt
>file3.txt
>file2.txt
>
>The new array will have:
>file1.txt
>file2.txt
>file3.txt
>
>with NO duplicate entries of file2.txt. Here's my code
>(written in PerlAmateur v1.0):
>
>foreach $FileName (@File) {
> $found = 0;
> foreach $Entry (@ListOfFileNames) {
> if ($FileName eq $Entry) {
> $found=1;
> }
> }
> if ($found == 0) {
> @ListOfFileNames = (@ListOfFileNames, "$FileName");
> }
>}
>
>
What about :
my %hash;
my @UniqueFiles;
@hash{@File} = ();
@UniqueFiles = sort keys %hash;
the end.
--
------------------------------
Date: Sat, 6 May 2000 17:32:16 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: gethostbyaddre: Address family not supported by protocol
Message-Id: <Pine.GHP.4.21.0005061724430.2874-100000@hpplus01.cern.ch>
On Fri, 5 May 2000, Darin Dugan wrote:
> Oops.. Works much better with quotes around the IP address:
> ...inet_aton("129.186.107.10").....
Yes, although single quotes would suffice, as you aren't trying to
interpolate anything there.
------------------------------
Date: Sat, 6 May 2000 18:15:38 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Help meeded with web to mail cgi without response
Message-Id: <Pine.GHP.4.21.0005061806240.2874-100000@hpplus01.cern.ch>
On Thu, 4 May 2000, Makarand Kulkarni wrote:
> > what I am after is
> > a similar script that allows the user to enter some data on a form and post
> > it to the server without the server generating any form of reply.
>
> let the server sent HTTP status code 204
Yes, this is technically correct, indeed. However, be aware that many
users will be concerned at the apparent lack of response and, thinking
that it didn't work, will try again several times, before deciding
that they may as well give up and go somewhere else. Right or wrong,
this _is_ how actual users are likely to behave, it seems.
In other words, I would recommend using this only when there is some
other independent confirmation that the transaction has been
successful. An example of a successful use was where the web page
contained control buttons for a separate (server-side) application,
and the application itself was displaying in another (client) window.
Success was confirmed by the reaction in the application window, and
so there was no need for an explicit confirmation in the browser
window, thus the status-204 response was fine.
all the best
------------------------------
Date: Sun, 07 May 2000 00:19:26 +0800
From: Preston <prestoncheung@hongkong.com>
Subject: Help! Which disrtibution should I get?
Message-Id: <3914460E.80303A50@hongkong.com>
I'm a beginner to perl.
I'm intended to write perl scripts to be run on Debian Linux Server.
However, my system is Win98. I see on activestate.com that there are two
binary distribution (one for Win9X, one for Debian Linux).
Which one should i get?
do perl scripts writen in perl for win32 work in debian linux server?
Please help me.
------------------------------
Date: Sat, 6 May 2000 10:13:07 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Help! Which disrtibution should I get?
Message-Id: <MPG.137df277bd214fe298aa16@nntp.hpl.hp.com>
In article <3914460E.80303A50@hongkong.com> on Sun, 07 May 2000 00:19:26
+0800, Preston <prestoncheung@hongkong.com> says...
> I'm a beginner to perl.
> I'm intended to write perl scripts to be run on Debian Linux Server.
> However, my system is Win98. I see on activestate.com that there are two
> binary distribution (one for Win9X, one for Debian Linux).
> Which one should i get?
Why would you want a Linux executable for your Windows system?
> do perl scripts writen in perl for win32 work in debian linux server?
If written with due regard for portability considerations.
perldoc perlport
Using the Linux exectable for perl, of course. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
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 2966
**************************************