[11920] in Perl-Users-Digest
Perl-Users Digest, Issue: 5520 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 29 17:07:16 1999
Date: Thu, 29 Apr 99 14:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 29 Apr 1999 Volume: 8 Number: 5520
Today's topics:
Re: "learning perl" does not seem to be written well <emschwar@rmi.net>
Re: "learning perl" does not seem to be written well birgitt@my-dejanews.com
a complex associative array problem bing-du@tamu.edu
A Small problem (Candice Nitto)
An explanation of sort matt@matt.com
Re: An explanation of sort (Chris Nandor)
Re: An explanation of sort (Larry Rosler)
Calling functions iteratively <vinger@ford.com>
Re: Calling functions iteratively (Andrew Allen)
Re: cgi-html generated in different frame <t-armbruster@ti.com>
Re: Count Linenumber (Abigail)
Re: Does "progress bar" exist in Tk? (Andrew Allen)
Example Server Code <Steve.Crump@uc.edu>
HELP! Atan2 conversion arbiggs@my-dejanews.com
IIS 3.0 and Perl configutation <jim.ray@west.boeing.com>
Re: Modfiying excel with Perl bayla@gatewayinternet.com
Re: Need an idea to do Perl-debugging in embedded Perl (Andrew Allen)
Re: Net::FTP question (Stefaan A Eeckels)
perl and Relational Databases wax_man@my-dejanews.com
Perl Conference <gala@sonic.net>
Problem with Date::Manip and Holidays... <shah@xnet.com>
Re: problem <x30407@wrek1.mar.lmco.com>
Re: Searching a Text File by key (Brand Hilton)
Re: simple problem <mali@hrz.tu-chemnitz.de>
use of FindBin on OS2 <kiranl@us.ibm.com>
Using a reference to an array (Daniel)
Re: Using a reference to an array (Graham Ashton)
Re: Using a reference to an array <dgris@moiraine.dimensional.com>
Re: Using a reference to an array (Daniel)
Re: Win95/98 file locking (Scott McMahan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Apr 1999 13:41:08 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <xkfk8uvmcyz.fsf@valdemar.col.hp.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> Perl[0-4] came with a nice concise single manpage called "man perl".
> No need for perldoc, because man found the single page rather nicely.
Yeah, but by the time I'd found my way around that, I'd figured out =~.
It wasn't *hard*, I want to emphasize. It was just a different sort of
operation (*to me*), that's all. It only took writing a couple of Perl
scripts to understand what's up with =~, and then I was fine. I really
don't remember how we got on this silly discussion. Anybody want pizza?
-=Eric
------------------------------
Date: Thu, 29 Apr 1999 19:47:29 GMT
From: birgitt@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7gad0f$1q3$1@nnrp1.dejanews.com>
In article <372492dc@cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, mikecard@my-dejanews.com writes:
> :I look forward to the next chapters and hopefully will be ready to move
> :on to "Programming Perl" before long!
>
> As others have pointed out, _Learning_Perl_ (the LLama) is really only
> tuned for those programmers (not non-programmers aka Prisoners of Bill)
> already conversant with the small-script culture that gave birth to
> Perl; that is, the Unix sysadmin cum toolsmith culture. There is a
> conceptual leap from non-programmer to lightweight programmer that
> Learning Perl does not attempt to handle. Nor, to be honest, does it
> tackle the growth path from accidental to professional programmer --
> but I don't think that that is your problem.
>
> After you're done gnashing your teeth over _Learning_Perl_, instead of
> jumping right into the full-blown reference that is _Programming_Perl_
> (the Camel), you might have better luck looking at _The_Perl_Cookbook_
> (the Ram), which does a better job at providing results-oriented examples.
> You can download the code examples from the book as a sampler from
>
> ftp://ftp.oreilly.com/published/oreilly/perl/cookbook/
>
> And view other materials, including a complete chapter, at
>
> http://www.ora.com/catalog/cookbook/
>
> I'm hardly a disinterested party, but if you read the covers off all
> three cited creatures, you will see that I might perhaps know what I'm
> talking about. :-)
>
> You should probably peruse Amazon, Slashdot, and other sources of online
> reviews to get a feel for the variety of Perl books. Some allege to
> cater more to those of lesser experiences, although with the possible
> exception of _Cross_Platform_Perl_, I don't think they deliver, but then
> again I may not be the best judge of that. For serious and self-confident
> programmers, _Perl:_The_Programmers_Companion_ is a much better book than
> the LLama. The Ram should have something in it for everyone from acolyte
> to grand vizier. You might also check out the _Perl_Desktop_Reference_
> (for like $6.95) for a quickref approach.
>
> --tom
> --
> English is a 5-tuple ... --dmr
All nice and good, but the basic problem is that even Larry Wall pointed
out that Perl should not be used as the first programming language to learn.
Therefore a Perl book which addresses the non-programmer has not been written
yet, AFAIK.
Fact is that there are many people out there who come into programming
through their exposure to Perl and they do want to learn programming WITH
Perl as their first language.
And I am somewhat disappointed that the Perl community is a bit in
denial about it. So far I have not found a convincing or really acceptable
reason for not learning to become a programmer and using Perl for doing so.
Basically I just read a bunch of books about C and Perl and that helps.
I never could do it with just one or two.
Somewhere I read an announcement about a book about "Algorithms in Perl".
I am looking forward to it.
B.Funk
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 19:29:00 GMT
From: bing-du@tamu.edu
Subject: a complex associative array problem
Message-Id: <7gabtl$m7$1@nnrp1.dejanews.com>
Hello there,
I expect the following code to give me the result like this:
xxxx:
------
xxxx: xxxx
xxx: xx
....
xxx:
------
xxxx: xxx
xxx: xx
...
...
But I just got the above result inside 'sample' subroutine (if those comments
were removed) but not outside.
The print statements outside 'sample' only showed me the first level keys:
It seemed the associative array was constructed and displayed inside the
subroutine. Just when it was passed out, something wrong happened.
xxxx:
-----
xxx:
-----
"-w" option did not show me any hints.
How to fix this problem?
Any idea and suggestion would be greatly appreciated.
Bing
------------------------------------------------------
#!/usr/local/bin/perl -w
my ($a,$b,%out);
%out = &sample;
foreach $a (keys %out)
{
print "$a:\n";
print "------\n";
foreach $b (keys %{$out{$a}})
{
print "\t$b: $out{$a}{$b}\n";
}
}
sub sample {
my $a;
my $b;
my %in;
### set up %in here ###
# foreach $a (keys %in)
# {
# print "$a:\n";
# print "------\n";
# foreach $b (keys %{$in{$a}})
# {
# print "\t$b: $in{$a}{$b}\n";
# }
# }
return (%in);
}
------------------------------------------------------
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 10:44:50 -0700
From: cmnitto@mtu.edu (Candice Nitto)
Subject: A Small problem
Message-Id: <yam7788.2520.124857192@smtp.best.com>
I don't know if it is a bug or something I am doing wrong because I am new
to using Perl in this capacity. The note below describes the problem I am
having which no one seems to have an answer for.
I have written a CGI script utilize CGI, DBI, DBD::XBase.
Everything is working find expect one thing. My fetch returns the row
expected but
after the rows are return the script hangs for 30 seconds before it prints
the
lines after the while loop. ( The way I figured out that there was a 30
second
delay before the code
after the while loop printed was by running it via the command line. When I
run it using the browser it doesn't display the returned row because the
ending html tags are not being printed. ) The browser seems to think that
the
script has ended during the 30 second hang
and reports done and then the lines after the while loop never get
printed. Can anyone see anything wrong with this loop. Is there another way
I should do this statement or a way to speed up the fetch so the line after
my while statement get printed right away. Below is my code minus all the
if statements.
I have a test form on www.blazt.com/TestForm.html if you enter IBM as
the manufacturer you will get back several rows. If you do this in Internet
Explorer you will actually be able to see the rows. If you do in
Netscape you will see only the background and you will have to view source
to see
the rows returned because the last tags are not there.
-Giovanni Moro and Candice Nitto
#!/usr/bin/perl5 -w
$|=1;
use vars qw($query);
use lib '/users/u1/typer/tmp';
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use DBI;
use XBase;
$query = new CGI;
print $query->header;
&GetRecord($query);
sub GetRecord {
$datasource = "DBI:XBase:."; ##datasource does not need db
name
$table = "Magn.dbf"; ##table in dbase format
$part = $query->param('part'); ##fetching the form field value
$desc = $query->param('desc'); ##fetching the form field value
$manu = $query->param('manu'); ##fetching the form field value
$p = 0; ##check if any row as printed
##
## Connect to the database
##
$dbh = DBI->connect($datasource,'','') || die $DBD::XBase::errstr;
##This will be executed if part has an entry but no others
if ((($part ne "")&&($part ne " "))&&(($desc eq "")||($desc eq "
"))
&&(($manu eq "")||($manu eq " "))){
$sql="SELECT PREFIX, PART_NO, MFG, DC, DESCR, QTY
FROM
$table WHERE PART_NO LIKE '$part'";
}
$sth = $dbh->prepare($sql);
if(!$sth){
die $DBD::XBase::errstr;
}
if(!$sth->execute){
die $DBD::XBase::errstr;
}
print "<HTML>\n<HEAD>\n";
print "<TITLE>Inventory Results</TITLE></HEAD>\n";
print "<body text=FFFFFF bgcolor=05315E link=FFFF00
vlink=8080FF alink=FF00FF background=../images/magbkg.jpg
NOSAVE
print "<TABLE>";
print "<TR><TH>Prefix</TH><TH>Part
Number</TH><TH>Manufacturer</TH>";
print "<TH>Dc</TH><TH>Package</TH><TH>Quantity</TH></TR>\n";
while (@row=$sth->fetchrow){
print "<tr>";
foreach(@row){
print "<td valign='top' align='center'><font
face='Verdana' size='1'>$_</font></td>\n";
}
$cnt=$cnt+1;
print "</tr>\n";
}
print "<TH>$cnt</TH>\n";
print "</TABLE>\n";
print "</BODY>\n</HTML>\n";
$dbh->disconnect;
------------------------------
Date: Thu, 29 Apr 1999 19:24:55 GMT
From: matt@matt.com
Subject: An explanation of sort
Message-Id: <3728b13a.163509750@news.infonent.com>
Hello
I've gotten sort to work in the past, but I'm entirely confused as to
its logic.
>From POD:
@new = sort { ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0] } @old;
This does a reverse numerical search on the (last) digit following =
in list @old.
I see the match and that makes sense. What I can't understand is the
presence of [0]. What does it refer to?
--matt
------------------------------
Date: Thu, 29 Apr 1999 16:03:41 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: An explanation of sort
Message-Id: <pudge-2904991603410001@192.168.0.77>
In article <3728b13a.163509750@news.infonent.com>, matt@matt.com wrote:
# @new = sort { ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0] } @old;
#
# This does a reverse numerical search on the (last) digit following =
# in list @old.
DigitS, actually.
# I see the match and that makes sense. What I can't understand is the
# presence of [0]. What does it refer to?
It has nothing to do with sort. It means "take the first element in the
list enclosed by () and return it". It's a list slice.
$x = (0..9)[3]; # 3
$x = (11..21)[5]; # 16
$x = ('bar' =~ /^(.)(.)(.)$/)[1]; # 'a'
The same sort could have been accomplished like this:
@new = sort {
my($aa, $bb);
$a =~ /=(\d+)/;
$aa = $1;
$b =~ /=(\d+)/;
$bb = $1;
$bb <=> $aa
} @old;
But that would be kinda silly. :)
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Thu, 29 Apr 1999 13:44:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: An explanation of sort
Message-Id: <MPG.11926491a1c45f0d98997a@nntp.hpl.hp.com>
In article <pudge-2904991603410001@192.168.0.77> on Thu, 29 Apr 1999
16:03:41 -0400, Chris Nandor <pudge@pobox.com> says...
> In article <3728b13a.163509750@news.infonent.com>, matt@matt.com wrote:
> # @new = sort { ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0] } @old;
...
> The same sort could have been accomplished like this:
>
> @new = sort {
> my($aa, $bb);
> $a =~ /=(\d+)/;
> $aa = $1;
> $b =~ /=(\d+)/;
> $bb = $1;
> $bb <=> $aa
> } @old;
>
> But that would be kinda silly. :)
This:
@new = sort {
my ($aa, $bb) = ($a =~ /=(\d+)/, $b =~ /=(\d+)/);
$bb <=> $aa
} @old;
wouldn't be as silly and seems considerably more perspicuous. Of
course, it's two lines, and I love one-liners and hate temporary
variables. So the 'slice the first element out a one-element list'
approach should be appealing to me. But somehow it isn't. Too cutesy
for my taste, and too confusing for some, such as the original poster.
In any case, as you well know, the whole thing is very silly for
significantly-sized data sets, because of the gross inefficiency of this
naive approach. Use the Schwartz, Luke!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 29 Apr 1999 16:05:13 -0400
From: Slav Inger <vinger@ford.com>
Subject: Calling functions iteratively
Message-Id: <3728BB79.D7981B63@ford.com>
Hello,
I have a special situation where I'm forced to call functions from
within an array that stores the function names and parameters, like
this:
@subs = ('test1("a")', 'test2("b")');
foreach(@subs) {
&$_; #call test1("a") and test2("b")
}
sub test1 {
...
}
sub test2 {
...
}
The above doesn't work (complains that &main::test1("a") is undefined),
and I didn't think it would work, but I'm wondering about the correct
way to do this. I looked in Advanced Perl book and man perlsub, but it
didn't mention anything resembling this.
Thanks in advance.
- Slav Inger.
- vinger@ford.com
--
Ford Motor Co., FSIC QPL
UNIX Server Group
Phone: 1-313-594-0216
E-mail: vinger@ford.com
------------------------------
Date: 29 Apr 1999 20:49:40 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Calling functions iteratively
Message-Id: <7gagl4$in5$4@fcnews.fc.hp.com>
Slav Inger (vinger@ford.com) wrote:
: Hello,
: I have a special situation where I'm forced to call functions from
: within an array that stores the function names and parameters, like
: this:
: @subs = ('test1("a")', 'test2("b")');
: foreach(@subs) {
: &$_; #call test1("a") and test2("b")
: }
: The above doesn't work (complains that &main::test1("a") is undefined),
: and I didn't think it would work, but I'm wondering about the correct
: way to do this. I looked in Advanced Perl book and man perlsub, but it
: didn't mention anything resembling this.
You could use Callback and/or Tk::Callback, or do what they do yourself:
@subs=([\&test1,"a"],[\&test2,"b"]);
foreach(@subs) {
$$_[0]->(@$_[1..$#$_]);
}
or you could just wrap up function calls and parameters into anonymous
subs (be sure to use "my" variables if you pass variables as
parameters, see perlfaq7 "What's a closure?")
@subs=(sub{test1("a")},sub{test2("b")});
foreach(@subs) {
&$_;
}
Andrew
------------------------------
Date: Thu, 29 Apr 1999 13:56:54 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: cgi-html generated in different frame
Message-Id: <I%1W2.30$GU3.2603@dfw-service1.ext.raytheon.com>
Eddy Viscous wrote in message <7ga4i4$kni@news-central.tiac.net>...
>Hello all,
>This may be an easy one...maybe not. I have a script that searches a
>database and returns results. I want these result to appear in a different
>frame than the one that the script's form is in. Can this be done? If so
>how.
>
Yes, this can be done, and it's pretty simple. But I think your question is
about HTML. Try posting this at comp.infosystems.www.authoring.html
------------------------------
Date: 29 Apr 1999 15:56:29 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Count Linenumber
Message-Id: <slrn7ihhre.bis.abigail@alexandra.delanet.com>
Philip Newton (Philip.Newton@datenrevision.de) wrote on MMLII September
MCMXCIII in <URL:news:37145D27.D500F660@datenrevision.de>:
@@
@@ Not as long as it's compatible with the way it's now described in
@@ perlrun. I was surprised it'd work, though; I assumed that the perlrun
@@ documentation is schematic and that you couldn't necessarily take
@@ advantage of the actual code there (e.g., inserting closing braces and
@@ thus putting the print() outside the while(<>) loop etc.)
I didn't know that either, until I read Chip's article in TPJ where
he mentions how things really work. After that, it was easy.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com/ The Largest Usenet Servers in the World!
---------== Over 72,000 Groups, Plus Dedicated Binaries Servers ==--------
------------------------------
Date: 29 Apr 1999 20:18:30 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Does "progress bar" exist in Tk?
Message-Id: <7gaeqm$in5$1@fcnews.fc.hp.com>
Patrick Renaud (patrick.renaud@transport.alstom.com) wrote:
: Hi all,
: In my Tk application, I want to display a progress bar during a dowload
: operation but I don't see such object in the Tk documentation.
: Is it an omission in the Tk docs ?
: If not, how can I display the progress time with a visual representation
: (not only with a percentage information) ?
: Thanks for your valuable help.
from:
http://www.perl.com/CPAN/modules/by-module/Tk/tk-modlist.html
aka:
http://mysite.directlink.net/gbarr/PerlTk/tk-modlist.html
I see the following:
ProgressBar Rdpo Status/progress bar ACH
ProgressMeter cdpo Simple thermometer-style widget w/callbacks BPOWERS
There's also a comp.lang.perl.tk newsgroup and a ptk mailing list at
majordomo@lists.stanford.edu which might be better places to find
things Tk-related.
Andrew
------------------------------
Date: Thu, 29 Apr 1999 15:39:30 -0400
From: Steve Crump <Steve.Crump@uc.edu>
Subject: Example Server Code
Message-Id: <3728B564.7EFD5DFE@uc.edu>
Can someone send me an example of a perl 5 script that uses the
IO:Socket
module to:
Wait for a network connection on a specified port.
Read a line of input from the port.
Print a line to the port.
Close the connection.
I have found some examples of servers written in perl 4 but
I would like to know how to do it with the IO:Socket modules.
Thanks for any help
Steve Crump
Steve.Crump@uc.edu
------------------------------
Date: Thu, 29 Apr 1999 20:04:48 GMT
From: arbiggs@my-dejanews.com
Subject: HELP! Atan2 conversion
Message-Id: <7gae0s$2qs$1@nnrp1.dejanews.com>
Hi!
I'm converting some code to PERL from another language which uses the atan
(arctangent) function. I cannot find an equivalent function in PERL, only
Atan2, which takes two arguments. The difference seems simple, atan takes a
ratio of two sides of a triangle and atan2 (apparently) takes the two sides
and does the ratio. However my attempts so far have failed miserably. Does
anyone know the equivalent PERL for the code below?>
RadDist = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
TIA!
arbiggs@hotmail.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 18:51:18 GMT
From: "news.boeing.com" <jim.ray@west.boeing.com>
Subject: IIS 3.0 and Perl configutation
Message-Id: <FAysCt.6Lz@news.boeing.com>
I had to re-install my IIS 3.0 and now my Perl scripts do not work. Does
someone know the configuration in IIS and the Registry?
Perl is in "E:\inetpub\wwwroot\perl\bin\"
I have made the Reg entry as ".pl"
and
REG_SZ E:\inetpub\wwwroot\perl\bin\perl.exe -wT "%s" "%s"
Thanks for the help.
Jim Ray
Delta Program NT Administrator
The Boeing Company
714-896-2038
jim.ray@west.boeing.com
------------------------------
Date: Thu, 29 Apr 1999 20:41:48 GMT
From: bayla@gatewayinternet.com
Subject: Re: Modfiying excel with Perl
Message-Id: <7gag6b$540$1@nnrp1.dejanews.com>
If you look at the perl online documentation for OLE objects, there is an
example that save and works. Here it is for all to copy.
use Win32::OLE;
# use existing instance if Excel is already running
eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')};
die "Excel not installed" if $@;
unless (defined $ex) {
$ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;})
or die "Oops, cannot start Excel";
}
# open an existing workbook
$book = $ex->Workbooks->Open( 'test.xls' );
# write to a particular cell
$sheet = $book->Worksheets(1);
$sheet->Cells(1,1)->{Value} = "foo";
# write a 2 rows by 3 columns range
$sheet->Range("A8:C9")->{Value} = [[ undef, 'Xyzzy', 'Plugh' ],
[ 42, 'Perl', 3.1415 ]];
# print "XyzzyPerl"
$array = $sheet->Range("A8:B9")->{Value};
print $array[0][1] . $array[1][1];
# save and exit
$book->Save;
undef $book;
undef $ex;
Somehow their code is different than yours and it saves with no problems!!
Try it!!
In article <371F1B52.B86B967A@at-lci.com>,
maas@ensae.fr wrote:
> Hello,
> I am trying to modify an excel workbook, I can retreive the data but I
> cannot modify...
> (in fact, I can, but as I do not know how to save the file, I cannot
> close it and therefore am stuck)
> NE idear??
> Here under are the lines...
>
> $application=Win32::OLE->new('Excel.Application') || warn "Impossible de
> créer un objet OLE";
>
> $workbook=$application->Workbooks->open("$fichier");
> $worksheet=$workbook->Worksheets(1);
> $worksheet->Range("A4")->{'Value'}=25;
> $total=$worksheet->Range("A4")->{'Value'};
> print "$_ => $total\n";
> $application->ActiveWorkbook->Save("$fichier") #this line wont
> work...
> $application->ActiveWorkbook->Close(0);
> DESTROY($application);
> }
> }
> $application->Quit();
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 29 Apr 1999 20:26:43 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Need an idea to do Perl-debugging in embedded Perl
Message-Id: <7gafa3$in5$2@fcnews.fc.hp.com>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: L. Kovacs <office@danubit.at> wrote:
: >
: >we want to write a Win application that uses embedded Perl to execute
: >generated Perl-code in a visual environment and we want to offer the
: >possibility to step through the Perl-code, set breakpoints, view and change
: >variables etc. We need a breakthrough idea how it can be done.
: Run perl with the -d switch, and use the perl debugger.
And control it all via emacs for your "windows" interface. It's a
breakthrough! ;)
Andrew
------------------------------
Date: 29 Apr 1999 20:24:34 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: Net::FTP question
Message-Id: <7gaf62$ns7$1@justus.ecc.lu>
In article <3728843E.E030F3CB@answerthink.com>,
Manuel Garber <mgarber@answerthink.com> writes:
> Does anybody knows how to use Net::FTP constructor to open a
> connection to nonstandard port.
>
> The documentation is cryptic for me.
>
> $ftp = Net::FTP->new("host", [OPTIONS]);
>
> where
> "OPTIONS are passed in a hash like fashion, using key and value pairs."
>
> options include "Port".
>
> But I cannot guess how to actually set the port I need.
Try:
my $ftp = Net::FTP->new($remoteHost,
(Timeout => 10, Debug => 1, Port => 2121)) ||
die "Failed to connect to $remoteHost. $!";
As you can see, the options *are* specified in a hash-like
fashion.
--
Stefaan
--
PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
Perfection is reached, not when there is no longer anything to add,
but when there is no longer anything to take away. -- Saint-Exupiry
------------------------------
Date: Thu, 29 Apr 1999 19:14:06 GMT
From: wax_man@my-dejanews.com
Subject: perl and Relational Databases
Message-Id: <7gab1p$vsa$1@nnrp1.dejanews.com>
Is there a way to use Perl to connect to a Relational Database? I am using
Informix RDMS and would like to use Perl/cgi to add data directly to a table.
I have found numerous articles on Database connectivity with Perl - but they
all reference flat file databases. Any hints / examples would be GREATLY
appreciated.
Thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 12:47:01 -0700
From: "Gala Grant" <gala@sonic.net>
Subject: Perl Conference
Message-Id: <7gacr4$8nc$1@ultra.sonic.net>
Does anyone know when registration for the Perl Conference in Monterey is
going to start? I contacted O'Reilly before and was told March. But I
still can't find any info about registering.
Gala Grant
------------------------------
Date: 29 Apr 1999 20:28:16 GMT
From: Hemant Shah <shah@xnet.com>
Subject: Problem with Date::Manip and Holidays...
Message-Id: <7gafd0$bm7$1@flood.xnet.com>
Folks,
I am using Date::Manip Version 5.33, and I am having truoble wiht
global config file. I have a global config file that lists all
holidays until 2010, it seems that Date:Manip ignores the year part of
the dates in the config file.
Here is the config file:
---------cut-------------cut-------------cut-------------cut----
# File: /usr/local/etc/perldates.dat
#
# History of changes:
# 20-Apr-1999 mep; initialized.
#
#
# This file is LIDP's config file for the perl Date::Manip routines.
# You may read about it using man Date::Manip on machines where
# the perl man pages are installed.
*Holiday
1/1/1999 = New Years Holiday
5/31/1999 = Memorial Day
7/5/1999 = Independence Day Holiday
8/13/1999 = Company Picnic
9/6/1999 = Labor Day
11/25/1999 = Thanksgiving Holiday
11/26/1999 = Thanksgiving Holiday
12/24/1999 = Christmas Holiday
12/27/1999 = Christmas Holiday
12/31/1999 = New Years Holiday
5/29/2000 = Memorial Day
7/4/2000 = Independence Day Holiday
9/4/2000 = Labor Day
11/23/2000 = Thanksgiving Holiday
11/24/2000 = Thanksgiving Holiday
12/25/2000 = Christmas Holiday
12/26/2000 = Christmas Holiday
1/1/2001 = New Years Holiday
5/28/2001 = Memorial Day
7/4/2001 = Independence Day Holiday
9/3/2001 = Labor Day
11/22/2001 = Thanksgiving Holiday
11/23/2001 = Thanksgiving Holiday
12/24/2001 = Christmas Holiday
12/25/2001 = Christmas Holiday
1/1/2002 = New Years Holiday
5/27/2002 = Memorial Day
7/4/2002 = Independence Day Holiday
9/2/2002 = Labor Day
11/28/2002 = Thanksgiving Holiday
11/29/2002 = Thanksgiving Holiday
12/24/2002 = Christmas Holiday
12/25/2002 = Christmas Holiday
1/1/2003 = New Years Holiday
5/26/2003 = Memorial Day
7/4/2003 = Independence Day Holiday
9/1/2003 = Labor Day
11/27/2003 = Thanksgiving Holiday
11/28/2003 = Thanksgiving Holiday
12/24/2003 = Christmas Holiday
12/25/2003 = Christmas Holiday
1/1/2004 = New Years Holiday
5/31/2004 = Memorial Day
7/5/2004 = Independence Day Holiday
9/6/2004 = Labor Day
11/25/2004 = Thanksgiving Holiday
11/26/2004 = Thanksgiving Holiday
12/24/2004 = Christmas Holiday
12/27/2004 = Christmas Holiday
12/31/2004 = New Years Holiday
5/30/2005 = Memorial Day
7/4/2005 = Independence Day Holiday
9/5/2005 = Labor Day
11/24/2005 = Thanksgiving Holiday
11/25/2005 = Thanksgiving Holiday
12/26/2005 = Christmas Holiday
12/27/2005 = Christmas Holiday
1/2/2006 = New Years Holiday
5/29/2006 = Memorial Day
7/4/2006 = Independence Day Holiday
9/4/2006 = Labor Day
11/23/2006 = Thanksgiving Holiday
11/24/2006 = Thanksgiving Holiday
12/25/2006 = Christmas Holiday
12/26/2006 = Christmas Holiday
1/1/2007 = New Years Holiday
5/28/2007 = Memorial Day
7/4/2007 = Independence Day Holiday
9/3/2007 = Labor Day
11/22/2007 = Thanksgiving Holiday
11/23/2007 = Thanksgiving Holiday
12/24/2007 = Christmas Holiday
12/25/2007 = Christmas Holiday
1/1/2008 = New Years Holiday
5/26/2008 = Memorial Day
7/4/2008 = Independence Day Holiday
9/1/2008 = Labor Day
11/27/2008 = Thanksgiving Holiday
11/28/2008 = Thanksgiving Holiday
12/24/2008 = Christmas Holiday
12/25/2008 = Christmas Holiday
1/1/2009 = New Years Holiday
5/25/2009 = Memorial Day
7/3/2009 = Independence Day Holiday
9/7/2009 = Labor Day
11/26/2009 = Thanksgiving Holiday
11/27/2009 = Thanksgiving Holiday
12/24/2009 = Christmas Holiday
12/25/2009 = Christmas Holiday
1/1/2010 = New Years Holiday
5/31/2010 = Memorial Day
7/5/2010 = Independence Day Holiday
9/6/2010 = Labor Day
11/25/2010 = Thanksgiving Holiday
11/26/2010 = Thanksgiving Holiday
12/24/2010 = Christmas Holiday
12/27/2010 = Christmas Holiday
---------cut-------------cut-------------cut-------------cut----
Here is the script:
---------cut-------------cut-------------cut-------------cut----
#!/usr/bin/perl -w
use Date::Manip;
$Date=&DateCalc("Sep 7, 1999", "- 3 business days");
print "$Date\n";
($Day, $MonthLiteral, $Year) = &UnixDate($Date, "%d", "%b", "%Y");
print "$Day, $MonthLiteral, $Year\n";
---------cut-------------cut-------------cut-------------cut----
Here is the output of the script:
1999082708:00:00
27, Aug, 1999
Mon Sep 6 1999 is labor day, so the correct answer should be Wed Sep 1,
1999. If I keep only 1999 entries in the file I get correct answer:
1999090108:00:00
01, Sep, 1999
For some of the holidays we could have used "1st Mon of Sep", etc. For
others we have to use fixed date based on company schedule, so we
decided to use fixed dates for all holidays.
Is this a bug in Date:Manip?
How can I fix the problem?
Thanx in advance.
--
Hemant Shah /-------------------\ ^~~~~^
E-mail: NoJunkMailshah@xnet.com |TECHNOLOGY | | |
|No place for wimps | o|-OO-|o
TO REPLY, REMOVE NoJunkMail | -Dilbert |--- | () |
FROM MY E-MAIL ADDRESS. \-------------------/ | |
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Thu, 29 Apr 1999 15:16:27 -0400
From: Adam Dittmer <x30407@wrek1.mar.lmco.com>
Subject: Re: problem
Message-Id: <3728B00B.CA8A3829@wrek1.mar.lmco.com>
What do you mean by SQL. the way i am doing it right now is the beset way i have come up
with if ypu have a better sugesstion let my know.
------------------------------
Date: 29 Apr 1999 19:39:23 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Searching a Text File by key
Message-Id: <7gachb$1bj2@mercury.adc.com>
In article <x7d80n8h54.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>
> RLS> With a name like Randal Schwartz, I'm guaranteed to not get it right.
>
>i would think you would have learned to spell your own name correctly by
>now.
>
><ducking the beer glass being thrown at me>
>
>and you told us the other night that the missing l was a typo by your
>mother!
>
>your spelling of schwartz is the most common variation i know. it is the
>dropped l that seems to most folks in trouble.
>
>and i can say these things since i have had my name mangled,
>mispronounced and besmirched in countless ways.
I have to chime in here. I've had my share of name-mangling. Very
few people get "Brand" right the first time. My favorite was what
Selective Service did with my name. I got letters from them until
well into college informing me that "Brano Hiltor" had not registered
for the draft.
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications
|_____| Richardson, Texas
------------------------------
Date: 29 Apr 1999 18:07:41 GMT
From: "Marko Lindner" <mali@hrz.tu-chemnitz.de>
Subject: Re: simple problem
Message-Id: <01be926b$2d95caa0$0b606d86@ml.csn.tu-chemnitz.de>
> before you get flamed to a crisp by others, i will gently
> ask you is this a perl question? you seem to be mixing
> several things here and you may be asking the wrong group.
Sorry. I wasn't aware I'm mixing several things here.
However - thanks for giving me the right answers.
If you ever have maths problems feel free to ask me.
This is my subject. And I will gently tell you if you're
doing something wrong which is maybe basic stuff for me
but obviously not for you.
Cheers,
Marko
------------------------------
Date: Thu, 29 Apr 1999 15:51:57 -0400
From: Kiran Lingutla <kiranl@us.ibm.com>
Subject: use of FindBin on OS2
Message-Id: <3728B85D.EB201E2F@us.ibm.com>
--------------E10AA7569BEF2C585CBA4160
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
hi,
I am trying to use FindBin through a test file to get the location of
my scripts on OS2 but I get an error from
readdir on line 136 in FindBin.pm which says that a directory or file
does not exist which does infact exist.
My test.pl is
#!/usr/bin/perl
use FindBin;
The same test.pl works for NT and UNIX platforms where the FindBin.pm
used is different I am using
perl, version 5.003_005 on OS2.
If anyone knows the solution for this, please let me know.
Thanks
--------------E10AA7569BEF2C585CBA4160
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
hi,
<BR> I am trying to use FindBin through a test file to get the location
of my scripts on OS2 but I get an error from
<BR>readdir on line 136 in FindBin.pm which says that a directory or file
does not exist which does infact exist.
<BR>
<BR>My test.pl is
<P><B>#!/usr/bin/perl</B>
<BR><B>use FindBin;</B><B></B>
<P>The same test.pl works for NT and UNIX platforms where the FindBin.pm
used is different I am using
<BR>perl, version 5.003_005 on OS2.
<BR> If anyone knows the solution for this, please let me know.
<BR>Thanks
<BR>
<BR> </HTML>
--------------E10AA7569BEF2C585CBA4160--
------------------------------
Date: Thu, 29 Apr 1999 20:08:18 GMT
From: daniel.mendyke@digital.com (Daniel)
Subject: Using a reference to an array
Message-Id: <7gadju$heh$1@nntpd.lkg.dec.com>
Given
my @xarray = qw( A B C D E );
my $xreference = \@xarray;
How can I find the size of the array referenced
by $xreference?
Using ' $#@$xreference ' causes the compiler
to grumble.
-Daniel
------------------------------
Date: 29 Apr 1999 20:25:38 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: Using a reference to an array
Message-Id: <slrn7ihg24.tti.billynospam@wing.mirror.bt.co.uk>
In article <7gadju$heh$1@nntpd.lkg.dec.com>, Daniel wrote:
>
>my @xarray = qw( A B C D E );
>my $xreference = \@xarray;
>
>How can I find the size of the array referenced
>by $xreference?
$size = @$xreference;
--
Graham
------------------------------
Date: 29 Apr 1999 14:30:58 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Using a reference to an array
Message-Id: <m3btg7b24d.fsf@moiraine.dimensional.com>
daniel.mendyke@digital.com (Daniel) writes:
> my @xarray = qw( A B C D E );
> my $xreference = \@xarray;
>
> How can I find the size of the array referenced
> by $xreference?
You were close.
$#$xreference
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Thu, 29 Apr 1999 20:48:16 GMT
From: daniel.mendyke@digital.com (Daniel)
Subject: Re: Using a reference to an array
Message-Id: <7gafut$nko$1@nntpd.lkg.dec.com>
>> How can I find the size of the array referenced
>> by $xreference?
>
>You were close.
>
>$#$xreference
(Now I feel stupid!)
Anyway, thank you for your timely answer.
-Daniel
------------------------------
Date: 29 Apr 1999 19:58:45 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Win95/98 file locking
Message-Id: <3728b9f5.0@news.new-era.net>
Collin Starkweather (collin.starkweather@colorado.edu) wrote:
> Testing seems to indicate that flock does not work in Win95/98. Is
> there a way to lock a file in Win95/98 that I am unaware of?
Not from Perl. The Win32 locking is done as part of the CreateFile
call, and you can't lock a file after it is opened. The
open/flock UNIX paradigm doesn't port.
Scott
------------------------------
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 5520
**************************************