[23986] in Perl-Users-Digest
Perl-Users Digest, Issue: 6187 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 27 00:05:42 2004
Date: Thu, 26 Feb 2004 21:05:05 -0800 (PST)
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, 26 Feb 2004 Volume: 10 Number: 6187
Today's topics:
Double Jump Box Redirection (Kenton)
Re: Double Jump Box Redirection <nospam@bigpond.com>
Re: Double Jump Box Redirection <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Double Jump Box Redirection <mgjv@tradingpost.com.au>
Federal Reserve COF files <opus100@yahoo.com>
Re: How to send cookie and redirect in a cgi script? <flavell@ph.gla.ac.uk>
Re: How to send cookie and redirect in a cgi script? <noreply@gunnar.cc>
matching multiple lines as one record (Stephen Moon)
Re: matching multiple lines as one record (Walter Roberson)
Re: matching multiple lines as one record <tadmc@augustmail.com>
Re: Module Install on XP Question <matthew.garrish@sympatico.ca>
Re: Module Install on XP Question <1usa@llenroc.ude>
Re: OOP (Malcolm Dew-Jones)
Re: perldb history dump? <invalid-email@rochester.rr.com>
Re: return multiple arrays from functions thumb_42@yahoo.com
Re: return multiple arrays from functions <uri@stemsystems.com>
Re: secure internet Perl programming for banking (at)FinancialDataCorp.com (Bob Mariotti)
Re: Uploading PDF <dwall@fastmail.fm>
Re: Uploading PDF <1usa@llenroc.ude>
Using glob() in a PAR executable (WAS: Replacing a text (J. Romano)
Win32::OLE - how to effectively create large spreadshee (Tom Niesytto)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Feb 2004 18:23:34 -0800
From: kenton_mcleod@hotmail.com (Kenton)
Subject: Double Jump Box Redirection
Message-Id: <f18c773b.0402261823.5008e693@posting.google.com>
Hi
Been pulling my hair out for hours on this one and I was wondering if
anyone could help.
I would like two drop down lists for navigation.
One to select state and one to select product.
So that selecting option 1, option 1 gives you
http://www.example.com/state_1/product1.htm
I started using javascript but in my travels have been scared off it.
So that leave me with pearl.
Given I have a form (remnants of my JS) with 2 drop down lists similar
to below can pearl cope with the redirect or do I need something
different?
<form name="RegionProduct" method="get" action="">
<select name="region" size="1" >
<option selected value="">Select your region</option>
<option value="state_1/">state 1</option>
<option value="state_2/">state 2</option>
</select>
<select name="service" size="1" >
<option selected value="index.htm">Select service</option>
<option value="widgets.htm">Widgets</option>
<option value="wodgets.htm">Wodgets</option>
</select>
<input name="button" type="button" onClick="????????????????"
Any help would be greatly appreciated
Kenton
------------------------------
Date: Fri, 27 Feb 2004 12:49:50 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Double Jump Box Redirection
Message-Id: <7001478.6UEGvaAsKi@GMT-hosting-and-pickle-farming>
Kenton wrote:
> Hi
>
> Been pulling my hair out for hours on this one and I was wondering if
> anyone could help.
>
> So that leave me with pearl.
>
>
> Any help would be greatly appreciated
> Kenton
This is HTML coding, not "pearl". Try a html group.
gtoomey
------------------------------
Date: Thu, 26 Feb 2004 19:55:09 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Double Jump Box Redirection
Message-Id: <t2fm1c.l0q.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-02-27, Kenton <kenton_mcleod@hotmail.com> wrote:
> I would like two drop down lists for navigation.
> One to select state and one to select product.
> So that selecting option 1, option 1 gives you
> http://www.example.com/state_1/product1.htm
>
> I started using javascript but in my travels have been scared off it.
>
> So that leave me with pearl.
Perhaps you should post in a pearl newsgroup. If you have any
actual Perl code, you can post it here.
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAPr+bhVcNCxZ5ID8RAgGzAJ9zqZ6ocgiiql9Eul5bdaAFDI7DxACeICu8
VPsCoz3/dQTm4w6nALwKaY4=
=UuB6
-----END PGP SIGNATURE-----
------------------------------
Date: 27 Feb 2004 04:23:01 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Double Jump Box Redirection
Message-Id: <slrnc3thh3.8k7.mgjv@verbruggen.comdyn.com.au>
On 26 Feb 2004 18:23:34 -0800,
Kenton <kenton_mcleod@hotmail.com> wrote:
> Hi
>
> Been pulling my hair out for hours on this one and I was wondering if
> anyone could help.
http://www.wigs.com/
> I would like two drop down lists for navigation.
> One to select state and one to select product.
> So that selecting option 1, option 1 gives you
> http://www.example.com/state_1/product1.htm
Perl has no drop down lists. Are you talking about HTML?
> I started using javascript but in my travels have been scared off it.
JavaScript is most often used together with HTML, so I suspect that
you are.
> So that leave me with pearl.
This newsgroup is called comp.lang.perl.misc. I find it interesting
that you succeeded in posting to this group without realising that the
language does not have an 'a' in its name.
Besides that, in web-related programming JavaScript and Perl are
generally used for two very different things. JavaScript is most
commonly used for client-side scripting, and Perl for server-side
programming.
I'd say, from the utterly vague description that you give, that
JavaScript would probably be what you want.
One of the groups in the comp.infosystems.www.* hierarchy can probably
help you further.
Martien
--
|
Martien Verbruggen | Never hire a poor lawyer. Never buy from a
Trading Post Australia | rich salesperson.
|
------------------------------
Date: Fri, 27 Feb 2004 00:32:15 GMT
From: "Ken" <opus100@yahoo.com>
Subject: Federal Reserve COF files
Message-Id: <jew%b.12734$921.5619@nwrddc02.gnilink.net>
Has anyone written or seen a perl script that works with the Federal
Reserve's Common Output Format files?
The COF files are files that contain images, normally of checks.
I am looking for, will probably have to write, a perl script to extract the
index database and image files from COFs.
I am hoping to be able and reuse something if it exists, or at least get
some pointers.
Thanks in advance and great news group!
Ken
reply to group or ktodd@gte.net
Document on COF v1.3 http://www.picturel.com/cof/cof13.pdf
------------------------------
Date: Thu, 26 Feb 2004 15:36:01 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: How to send cookie and redirect in a cgi script?
Message-Id: <Pine.LNX.4.53.0402261526330.20124@ppepc56.ph.gla.ac.uk>
On Thu, 26 Feb 2004, Gunnar Hjalmarsson wrote:
> CGI.pm's header() function returns a trailing blank line, which you
> don't want in this case.
That's sort-of correct, but it's the wrong emphasis IMHO.
Refer to http://stein.cshl.org/WWW/software/CGI/#header
and scroll down to its the second sub-section
"Creating the Header for a Redirection Request"
The redirect() method is for use INSTEAD of the header() method
when a redirection is desired. Quote:
| All other parameters recognized by the header() method are also
| valid in redirect.
> Try replacing
>
> print $query->header(-cookie=>$cookie);
>
> with
>
> print "Set-Cookie: $cookie\n";
Well, you can _try_ it, and if you do it right, it should produce the
desired result. But if you're going to get a cat for pest control,
why continue to catch the mice for yourself?
Use redirect() instead of header(), and include the cookie request
amongst the paramters of the redirect() call.
------------------------------
Date: Fri, 27 Feb 2004 05:05:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to send cookie and redirect in a cgi script?
Message-Id: <c1mfuc$1k224o$1@ID-184292.news.uni-berlin.de>
Alan J. Flavell wrote:
> On Thu, 26 Feb 2004, Gunnar Hjalmarsson wrote:
>> CGI.pm's header() function returns a trailing blank line, which
>> you don't want in this case.
>
> That's sort-of correct, but it's the wrong emphasis IMHO.
>
> Refer to http://stein.cshl.org/WWW/software/CGI/#header and scroll
> down to its the second sub-section "Creating the Header for a
> Redirection Request"
<snip>
> Use redirect() instead of header(), and include the cookie request
> amongst the paramters of the redirect() call.
Thanks for pointing it out, Alan. That solution is apparently more
along the intentions of the author of CGI.pm than mine.
IMNSHO, this is yet another example of CGI.pm unnecessarily
abstracting trivial things, and it's remarkable, to say the least,
that you're not able to figure it out by help of the 3,400+ lines POD.
Other things than my solution can be said to have the "wrong
emphasis". ;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 26 Feb 2004 17:51:05 -0800
From: vibfft@yahoo.com (Stephen Moon)
Subject: matching multiple lines as one record
Message-Id: <9feadd98.0402261751.2b924db9@posting.google.com>
I have a file containing the following data. How would you use
regular expression to match the record from the header before the next
header.
G11: AD113167 #beginnning of header
Freq Mag
----------------------------------
0.00000 0.0002430974787725
0.01987 0.0002434897808872
...
G22: AD113168 #start of next header
Freq Mag
----------------------------------
0.09934 0.0000005524295687
0.11921 0.0000005192898866
0.13908 0.0000003088175192
...
G33: AD113169
...
$header =~ s/\A(.*?: \w+\s*)//
$record =~ s/\s*(.*?)\s+(\S+)/$1,$2/
I used the above for the header and the data.
It seems like '.' doesn't match new lines and '^' and '$' only works
for
a string.
Thanks in advance.
-Steve
------------------------------
Date: 27 Feb 2004 02:23:11 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: matching multiple lines as one record
Message-Id: <c1m9mf$k6p$1@canopus.cc.umanitoba.ca>
In article <9feadd98.0402261751.2b924db9@posting.google.com>,
Stephen Moon <vibfft@yahoo.com> wrote:
:I have a file containing the following data. How would you use
:regular expression to match the record from the header before the next
:header.
Please see the 's' and 'm' modifiers of the 's' operator.
--
Feep if you love VT-52's.
------------------------------
Date: Thu, 26 Feb 2004 22:48:28 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: matching multiple lines as one record
Message-Id: <slrnc3tj0s.1up.tadmc@magna.augustmail.com>
Stephen Moon <vibfft@yahoo.com> wrote:
> It seems like '.' doesn't match new lines
What's with the "seems like"?
That is what the docs say that dot means.
They also say how to make dot match newlines...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 26 Feb 2004 20:12:35 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Module Install on XP Question
Message-Id: <3Qw%b.9711$ee3.469174@news20.bellglobal.com>
"gibbering poster" <noone@nowhere.com> wrote in message
news:7Iv%b.17580$XH.8311@newssvr29.news.prodigy.com...
>
> "A. Sinan Unur" <1usa@llenroc.ude> wrote in message
> news:Xns949BA8EC538E5asu1cornelledu@132.236.56.8...
> > dummymb@hotmail.com (Page) wrote in
> > news:6742094.0402261330.278c97ef@posting.google.com:
> >
> > > I've been trying to learn Perl and have ActiveState Perl installed
> on
> > > my WinXP machine along with Apache 2.0. All seems to work pretty
> > > well. I need to install some perl modules. I downloaded the
> required
> > > files (according to CPAN), but I'm not sure I understand the install
> > > instructions. Do I just copy the .pm file into my C:\Perl\Lib
> > > directory and voila! it all works? Or is there more to it than
> that.
> > > I see a lot of stuff about using "Makefile".
> >
> > Use ppm:
> >
> > Start -> Run -> ppm (Press enter)
> >
>
> I've found that the modules available in PPM are few and far between...
> Only about 1 in 10 CPAN module's I've needed have been available in .ppd
> format...
>
> IMO, the ONLY way to use perl on XP is to install cygwin, build it
> yourself, and use gcc to compile them. Anything else is going to be an
> excercise in frustration.
>
The only problem I've personally run into is with the Crypt modules, but I
remember reading once that that was only because AS doesn't have a license
to distribute cryptographic software. Have you tried including other ppm
respoitories? I always add the following ones whenever I install Perl on a
Windows box:
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
http://www.roth.net/perl/packages/
http://jenda.krynicky.cz/perl
Also, have you tried downloading the zip files from ActiveState and
installing them locally?
http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Zips
Matt
------------------------------
Date: 27 Feb 2004 01:30:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Module Install on XP Question
Message-Id: <Xns949BD0B0FB55Casu1cornelledu@132.236.56.8>
"gibbering poster" <noone@nowhere.com> wrote in news:7Iv%b.17580$XH.8311
@newssvr29.news.prodigy.com:
>
> "A. Sinan Unur" <1usa@llenroc.ude> wrote in message
> news:Xns949BA8EC538E5asu1cornelledu@132.236.56.8...
>> dummymb@hotmail.com (Page) wrote in
>> news:6742094.0402261330.278c97ef@posting.google.com:
>>
>> > I've been trying to learn Perl and have ActiveState Perl installed
>> > on my WinXP machine along with Apache 2.0. All seems to work pretty
>> > well. I need to install some perl modules.
...
>> Use ppm:
>>
>> Start -> Run -> ppm (Press enter)
>>
>
> I've found that the modules available in PPM are few and far between...
> Only about 1 in 10 CPAN module's I've needed have been available in
> .ppd format...
It might have been that I have only needed the modules they had, but I
haven't had any problems with it.
And, if the module you are looking for is a pure Perl module, it is
pretty easy to get it installed using Makefile.PL (you'll need to get
nmake).
> IMO, the ONLY way to use perl on XP is to install cygwin, build it
> yourself, and use gcc to compile them. Anything else is going to be
> an excercise in frustration.
I do have cygwin installed but I have been using ActiveState Perl for a
long time and have not been that frustrated. Just my 2 cents.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: 26 Feb 2004 18:07:58 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: OOP
Message-Id: <403ea67e@news.victoria.tc.ca>
Ben Morrow (usenet@morrow.me.uk) wrote:
: "Suresh Govindachar" <sgovindachar@yahoo.com> wrote:
: > (For a simple comparison of an OO hello world in
: > cpp and in perl: http://www.sonic.net/~suresh/thinking_oo )
: ^^^
: ITYM C++. AFAIK cpp (the C preprocessor) doesn't support objects.
you were probably thinking of .cpp , which is a common extension for c++
source code, at least on some systems.
--
Web Work Wanted, Perl Projects Programmed, Database Development Done.
I'm looking for telecommute projects. (Paying that is, various
arrangements possible.)
------------------------------
Date: Fri, 27 Feb 2004 04:26:08 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: perldb history dump?
Message-Id: <403EC634.4080604@rochester.rr.com>
bill wrote:
> I use perldb with Readline enabled. Is there any straightforward
> way to dump the available command history from a perldb session?
...
> bill
You might check out the "H" debugger command.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Fri, 27 Feb 2004 04:16:23 GMT
From: thumb_42@yahoo.com
Subject: Re: return multiple arrays from functions
Message-Id: <rwz%b.132004$uV3.649915@attbi_s51>
gnari <gnari@simnet.is> wrote:
> the &func() form is usually a sign of a programmer that has not
> read the docs.
I generally happen to *like* &func() in part because it's what I've always
used. (The other reason is that it makes it a little more obvious that I'm
calling a subroutine and not a method or perl builtin)
Jamie
------------------------------
Date: Fri, 27 Feb 2004 04:20:10 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: return multiple arrays from functions
Message-Id: <x7k729p30l.fsf@mail.sysarch.com>
>>>>> "t4" == thumb 42 <thumb_42@yahoo.com> writes:
t4> I generally happen to *like* &func() in part because it's what
t4> I've always used. (The other reason is that it makes it a little
t4> more obvious that I'm calling a subroutine and not a method or
t4> perl builtin)
and it makes your code look like a perl4 kiddie coder wrote it. just
because you are used to it doesn't defend your use of it. and how can it
be confused with a method? there is NO object nor -> there. and
confusing it with a perl function is rare since you should KNOW most of
the perl function names and not use a sub name that would be confused
with them.
any more weak defenses?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 27 Feb 2004 02:42:46 GMT
From: R.Mariotti(at)FinancialDataCorp.com (Bob Mariotti)
Subject: Re: secure internet Perl programming for banking
Message-Id: <403eacf3.137948246@news.cshore.com>
On Tue, 24 Feb 2004 21:11:14 -0500, L D Jones <734562323@yahoo.de>
wrote:
>J Krugman wrote:
>>
>> In <403bb254@news.victoria.tc.ca> yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) writes:
>>
>> >kj (nomail.nospam@nopain.nopain.com) wrote:
>>
>> >: I'm looking for a book on secure internet programming for
>> >: banking/financial applications, preferably for Perl programmers.
>> >: Supposedly there's a lot of stuff on this for Java, but I'd prefer
>> >: to avoid Java if possible (nothing against Java; I'm just far more
>> >: comfortable and proficient with Perl).
>>
>> >: Is there a Perl mailing list devoted to secure Internet programming?
>>
>> >No idea about a mailing list, but perl can use various SSL modules, and
>> >that allows perl to directly communicate over a secure channel (if the
>> >terminology is wrong then sorry).
>>
>> This is not my area of expertise, but I can tell you that there's
>> a *lot* more to banking programming security than communicating
>> over SSL.
>>
>> I don't know of anyone doing this kind of work in Perl. I'm not
>> sure exactly why Perl would be unsuitable, but AFAIK it's just not
>> used in this domain (internet programming for banking).
>>
>> Does anyone know why?
>
>The conservative nature of banks makes them less likely to accept a
>solution not based on software from a large vendor.
Speaking as one who has devoted most of my 25 year career designing,
developing, deploying and supporting full financial solutions for
financial institutions, I've been moving steadily into the open
solution for the past 14 years. I use a lot of perl as our home
banking and internet lending suites are completely written in perl and
more and more of the supporting modules are being written in perl. In
fact, I just completed a facility to obtain credit reports from one of
the major bureaus via a perl program over ssl web access (with NO user
involvement). Works great and works FAST! And another that
automatically access index rates from the Federal Reserve site for use
in Adjustable Rate Mortages... completely written in perl.
However, as good as this is, the Feds are seeming intentionally trying
to BREAK both the small vendors (read: < 100 staff) and especially
solutions written with GPL governed languages. They actually seem to
favor (actually recommend) M$ solutions to my clients just coming
short of insisting that they move away from any vendor using GNU
products.
So much for the American way!
Any banks/credit unions want to purchase a COMPLETE banking suite
relatively cheap???
------------------------------
Date: Fri, 27 Feb 2004 00:24:33 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Uploading PDF
Message-Id: <Xns949BC5735DDCFdkwwashere@216.168.3.30>
csdude@hotmail.com (Mike) wrote:
> I'm writing a program that will let the user upload PDF files to the
> server. I've done this with images before, and I figure that they're
> both binary so I should be able to use the same script. But before I
> do, I'm curious if I'm going to come across any problems with it.
>
> $file = upload('file');
Are you not using strictures? You might regret that when your programs
start getting larger and more complex.
use strict;
will make you declare your variables and will also disable certain other
unsafe practices. 'use warnings;' is also highly recommended. Think of
them as safety equipment to catch mistakes. (they catch a lot of mine)
> open INFILE, ">$base/$file";
You should always, yes *always*, check the return value from open():
open INFILE, ">$base/$file" or die "Cannot open $base/$file: $!";
(Hi Tad :-)
> binmode (INFILE);
> while ($bytes = read($file,$data,16384)) {
> $length_info += $bytes;
> print INFILE $data;
> }
> close INFILE;
>
> Should this work with any PDF file? I tested it with one file that I
> had, but I'm not sure how PDFs actually work.
How PDF files work doesn't have anything to do with it. It's just binary
data that you're saving to a file.
Except for the $length_info line, the code looks as if it came almost
verbatim from the CGI.pm docs. Unless Lincoln Stein has really screwed
up I would expect it to work flawlessly (unless you have an error
somewhere else).
--
David Wall
------------------------------
Date: 27 Feb 2004 01:41:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Uploading PDF
Message-Id: <Xns949BD292493B0asu1cornelledu@132.236.56.8>
"David K. Wall" <dwall@fastmail.fm> wrote in
news:Xns949BC5735DDCFdkwwashere@216.168.3.30:
> csdude@hotmail.com (Mike) wrote:
>> open INFILE, ">$base/$file";
>
> You should always, yes *always*, check the return value from open():
>
> open INFILE, ">$base/$file" or die "Cannot open $base/$file: $!";
>
While we are at it, why not use lexical file handles and the 3-argument
form of open:
use File::Spec;
open my $infile, '>', File::Spec->catfile($base, $file)
or die 'Cannot open ', File::Spec->catfile($base, $file), ": $!";
I typed the code above right into the newsreader so watch out for typos.
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: 26 Feb 2004 17:27:46 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: Using glob() in a PAR executable (WAS: Replacing a text in multiple files with regular expressions)
Message-Id: <b893f5d4.0402261727.702f4870@posting.google.com>
"David K. Wall" <dwall@fastmail.fm> wrote in message news:<Xns949585388D283dkwwashere@216.168.3.30>...
>
> Good thing the OP is using winXP and not win98.
>
> A friend of mine recently wanted a copy of a little utility program I had
> written. He didn't have Perl (and didn't want or need it), so I packaged
> the program with PAR under winXP and sent him the executable. When he ran
> the exe on his win98 system, all he got from glob() was "Bad command or
> filename", so I had to rewrite that portion of the program to use readdir()
> and 'next unless ...'.
>
> Maybe if I'd had a win98 system with which to create the exe it might have
> worked?
Dear David,
Actually, it wouldn't have made a difference which Win OS you
created it on; if the system the executable runs on doesn't have
ActiveState Perl, the glob() function probably won't work. Here's
why:
When a glob() function is encountered in a Perl script, ActiveState
Perl will run the "perlglob.exe" executable using the backtick
operator. The perlglob.exe program is usually installed in the
Perl\bin directory, so if ActiveState ActivePerl was never installed,
chances are that the perlglob.exe executable doesn't exist, causing
the backtick operator (and, later, the glob() function) to fail (which
is why you got the error: "Bad command or file name"). It will run
perfectly on the machine that created the PAR executable (because
perlglob.exe exists there), misleading people to believe that their
PAR executable only works on their operating systems.
We actually encountered this problem just a few days ago, and the
way that we got around this problem was to add the line:
use File::Glob ':glob';
and change all "glob" calls to "bsd_glob". After that, globbing
worked perfectly.
I suppose another simple solution would be to just copy the
perlglob.exe executable into a directory included in the $PATH of your
friend's computer.
So be careful when you run Perl code that uses the backtick
operator; if the executable (that you're running inside backticks)
doesn't exist on the machine that you run the script on, the script
certainly won't function correctly.
Hope this helps,
Jean-Luc Romano
------------------------------
Date: 26 Feb 2004 20:24:56 -0800
From: woland99@yahoo.com (Tom Niesytto)
Subject: Win32::OLE - how to effectively create large spreadsheet?
Message-Id: <694461f6.0402262024.6a72d5bf@posting.google.com>
Howdy - I am using Win32::OLE to create a spreasheet from data.
Spreadsheet is fairly big (2000 rows x 30 columns) and cells contain
embedded newlines (if itwas not for that I would simbly import tab
delimited file).
To write to Excel spreadsheet I do sth like:
-----------------------------------------
sub write_array_as_excel_file
{
my $output_file = shift;
my $array_ref = shift; #reference to array of references to arrays
eval{$excel = Win32::OLE->GetActiveObject('Excel.Application')};
die "Excel not installed" if $@;
unless (defined $excel) {
$excel = Win32::OLE->new('Excel.Application', 'Quit')
or die "Oops, cannot start Excel";
}
#to avoid excessive dialogs when saving in non-Excel format
$excel->{DisplayAlerts} = 0;
# get a new workbook
my $wbook = $excel->Workbooks->Add
|| print STDERR "didnt add new workbook: $!\n";
# write to a particular cell
my $wsheet = $wbook->Worksheets(1);
my $ref;
my $cell_value;
my $row_num = 0;
my $col_num = 0;
foreach $ref (@{$array_ref}) {
$row_num++;
$col_num = 0;
foreach $cell_value (@{$ref}){
$col_num++;
$wsheet->Cells($row_num,$col_num)->{Value} = "$cell_value";
}
}
$wbook->SaveAs($fullname_output_file);
undef $wbook;
}
-----------------------------
Problem is - it is slow.
Takes about 20 mins to write out the output.
What am I doing wrong here?
Thanks for any pointers,
JT
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 6187
***************************************