[28758] in Perl-Users-Digest
Perl-Users Digest, Issue: 2 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 6 03:05:59 2007
Date: Sat, 6 Jan 2007 00:05:06 -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 Sat, 6 Jan 2007 Volume: 11 Number: 2
Today's topics:
cperl-indent-region: "No comment syntax is defined" (David Combs)
Re: Elegant equivalent to this regex? <tadmc@augustmail.com>
Re: is Perl used in the Java middle-tier <james.willmore@comcast.net>
Re: is Perl used in the Java middle-tier <uri@stemsystems.com>
Re: is Perl used in the Java middle-tier <davidl33@comcast.net>
join array elements into a string <perl.lover@nospam.com>
Re: join array elements into a string <purlgurl@purlgurl.net>
Re: join array elements into a string <someone@example.com>
Re: join array elements into a string <DJStunks@gmail.com>
Re: join array elements into a string <jurgenex@hotmail.com>
mod_perl-specific Compiler Options <sonet.all@msa.hinet.net>
Re: Net::SSH installation problems - how do I force loc <sisyphus1@nomail.afraid.org>
Re: Net::SSH installation problems - how do I force loc <stahl.karl@gmail.com>
new CPAN modules on Sat Jan 6 2007 (Randal Schwartz)
Re: OSCON 2006 - Perl programming vs. scripting <brian.d.foy@gmail.com>
Re: OSCON 2006 - Perl programming vs. scripting <john@castleamber.com>
Re: Problematic Perl code <emschwar@pobox.com>
Re: stalling server client program <DJStunks@gmail.com>
Re: Win32::OLE - saving content of just one worksheet i <john@castleamber.com>
Re: Win32::OLE - saving content of just one worksheet i <john@castleamber.com>
Re: Win32::OLE - saving content of just one worksheet i <woland99@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Jan 2007 21:58:29 -0500
From: dkcombs@panix.com (David Combs)
Subject: cperl-indent-region: "No comment syntax is defined"
Message-Id: <enn38l$7hg$1@panix2.panix.com>
It's been a while since I last did a "cperl-indent-region";
I just tried it today, and got the error:
"No comment syntax is defined"
(In *Messages*, it's shown as:
comment-normalize-vars: No comment syntax is defined
)
Version is 20.3.
Emacs-version is 21.3.2.
Any obvious suggestions?
Thanks!
David
------------------------------
Date: Fri, 5 Jan 2007 05:52:58 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Elegant equivalent to this regex?
Message-Id: <slrnepsf0q.rua.tadmc@tadmc30.august.net>
DJ Stunks <DJStunks@gmail.com> wrote:
> sherifffruitfly wrote:
>> If you don't wish to help me with my question, but prefer to answer
>> only your own instead, that's perfectly fine, of course.
>
> no need to get snotty.
Especially considering the continuing cost of giving in
to the snottiness urge.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 05 Jan 2007 21:24:49 -0500
From: James Willmore <james.willmore@comcast.net>
Subject: Re: is Perl used in the Java middle-tier
Message-Id: <pqqdnbZ4NM4dlQLYnZ2dnUVZ_qGjnZ2d@comcast.com>
andrew_nuss@yahoo.com wrote:
<snip>
> Therefore, I'm wondering if there are
> companies that are integrating Perl
> solutions into their enterprise java applications. Or do they just
> struggle with java.util.regex.
<snip>
I started out using Perl as my language of choice and switched to
Java about 2 years ago. Partly to obtain a programming position in
the company I work for and partly because Java is more accepted in
the field today (think Oracle applications).
Anyway ...
A more senior programmer in my department at work and I had a
discussion on the use of regular expressions in Java. He didn't
really see a need to use regular expressions in Java as it is used
in Perl. Why? Because there are other ways to parse Strings in
Java that have been included in the language since version 1.0. For
example, the String methods startsWith, endsWith, substring or the
StringTokenizer class.
However ...
Since this is a Perl newsgroup :-), this question may be better
asked in a Java newsgroup.
OTOH ...
I think, after using Java for a while now, that there can be over
use of regular expressions in any language that supports them. For
example, in Perl, there are other ways to parse data (ex. split,
pack, unpack, substr, etc). Yet, I see scripts that will use a
regex versus a function to split up a line. Of course, since Perl
doesn't have a "startsWith" method, you're stuck using a regex to
find something at the start of a line or scalar value.
In the end, if you see you're using a lot of regular expressions to
accomplish a task in any language, get someone else to look over
your code ... someone who is unfamiliar with regular expressions (or
hates using them). You'll find that there's a happy medium between
the regular expressions being used and alternative approaches to the
problem(s) at hand.
HTH
------------------------------
Date: Fri, 05 Jan 2007 21:47:55 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: is Perl used in the Java middle-tier
Message-Id: <x7hcv4c1lw.fsf@mail.sysarch.com>
>>>>> "JW" == James Willmore <james.willmore@comcast.net> writes:
JW> I think, after using Java for a while now, that there can be over use
JW> of regular expressions in any language that supports them. For
JW> example, in Perl, there are other ways to parse data (ex. split, pack,
JW> unpack, substr, etc). Yet, I see scripts that will use a regex versus
JW> a function to split up a line. Of course, since Perl doesn't have a
JW> "startsWith" method, you're stuck using a regex to find something at
JW> the start of a line or scalar value.
you are not using perl if you only use regexes to do string
stuff. startswith can be done like this:
substr( $string, 0, length $begin ) eq $begin ;
but why would you if
$string =~ /^$begin/ ;
does the job?
the issue with java vs perl is more than regexes, it is the verbosity of
java to get anything done. i don't want to type all those extra methods
and lines and whatnot to get the job done. and i do fine in the work
environment with just perl. you just need to not work for stupid large
corps that have no clue. and there are plenty of large shops that do
perl. check out jobs.perl.org for many perl jobs from all over the world
and in all sorts of companies.
JW> In the end, if you see you're using a lot of regular expressions to
JW> accomplish a task in any language, get someone else to look over your
JW> code ... someone who is unfamiliar with regular expressions (or hates
JW> using them). You'll find that there's a happy medium between the
JW> regular expressions being used and alternative approaches to the
JW> problem(s) at hand.
not likely unless they are using regexes for absolutely everything.
and btw, split IS a regex function in perl. so using split on a line is
still using a regex.
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, 05 Jan 2007 22:40:52 -0500
From: David Lee Lambert <davidl33@comcast.net>
Subject: Re: is Perl used in the Java middle-tier
Message-Id: <1168054844.5225.38.camel@localhost.localdomain>
On Fri, 2007-01-05 at 17:22 +0100, Joachim Pense wrote:
> Am 5 Jan 2007 06:49:02 -0800 schrieb andrew_nuss@yahoo.com:
> > [...] that
> > java.util.regex is missing code assertions and overall can't solve the
> > complexity of matching, transformation
> > problems that Perl can solve. Therefore, I'm wondering if there are
> > companies that are integrating Perl
> > solutions into their enterprise java applications. Or do they just
> > struggle with java.util.regex.
> Use C#. Then you have regexes with Perl's complexity (of course
> without Perl's elegance, but you're used to that being a Java
> programmer).
Speaking of that, I recently wrote J# code to expose the .NET regex
engine as java.util.regex-compatible classes:
http://www.lmert.com/bb/modcp.php?mode=split&t=613
On a more serious note, I doubt anyone "struggles" with
java.util.regex; the missing features are so obscure that they can
easily be worked around in code. However, it's really easy to spawn a
perl interpreter in Java; something like
Process p = System.getRuntime().exec("perl", new String[] { "-e",
"exit((" + perlquote(arg) +
")=~/really(wierd)pattern/ ? 0 : 1 ) " });
p.waitFor();
boolean matches = (p.exitValue()==0);
where perlquote() quotes its argument appropriately.
------------------------------
Date: Fri, 5 Jan 2007 23:14:16 -0500
From: "Perl Lover" <perl.lover@nospam.com>
Subject: join array elements into a string
Message-Id: <459f2218$0$97260$892e7fe2@authen.yellow.readfreenews.net>
I want to join elements of an array into a string.
I can use join function, but the problem is that
one or more elements of the array can contain
undef values.
join function spews out error when one of the
array elements is undef.
Is there a better way.
Basically the array elements are data from a RDBMS table
coming via fetchow_array call of DBI. fetrow_array returns
undef for those columns which have null values from the RDBMS.
I am comparing two arrays to determine whether they are same or different.
Speed is utmost importance as the volumne of data
is very large.
thanks.
------------------------------
Date: Fri, 05 Jan 2007 20:37:00 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: join array elements into a string
Message-Id: <459F276C.80405@purlgurl.net>
Perl Lover wrote:
(snipped)
> I am comparing two arrays to determine whether they are same or different.
Other words, are two arrays equal? You have not stated "similar" nor "alike"
rather "same or different."
if ("@Array1" eq "@Array2")
{ print "Match"; }
else
{ print "No Match"; }
Purl Gurl
------------------------------
Date: Sat, 06 Jan 2007 05:07:30 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: join array elements into a string
Message-Id: <m8Gnh.126170$hn.117262@edtnps82>
Perl Lover wrote:
> I want to join elements of an array into a string.
> I can use join function, but the problem is that
> one or more elements of the array can contain
> undef values.
> join function spews out error when one of the
> array elements is undef.
Do you mean like this:
$ perl -le'
use warnings;
use strict;
my @array = ( "one", "two", undef, "four", undef, "six" );
my $string = join "", @array;
print $string;
'
Use of uninitialized value in join or string at -e line 5.
Use of uninitialized value in join or string at -e line 5.
onetwofoursix
> Is there a better way.
$ perl -le'
use warnings;
use strict;
my @array = ( "one", "two", undef, "four", undef, "six" );
my $string = join "", grep defined, @array;
print $string;
'
onetwofoursix
John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
------------------------------
Date: 5 Jan 2007 21:16:40 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: join array elements into a string
Message-Id: <1168060600.304237.292220@11g2000cwr.googlegroups.com>
Perl Lover wrote:
> I am comparing two arrays to determine whether they are same or different.
perldoc -q equal
-jp
------------------------------
Date: Sat, 06 Jan 2007 05:19:46 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: join array elements into a string
Message-Id: <SjGnh.80$V91.39@trndny05>
Perl Lover wrote:
> I want to join elements of an array into a string.
> I can use join function, but the problem is that
> one or more elements of the array can contain
> undef values.
> join function spews out error when one of the
> array elements is undef.
Why don't you simple grep() the defined() values?
> Is there a better way.
Don't know if better, but as an alternative you could simple stringify the
array:
$foo = "@array";
> Basically the array elements are data from a RDBMS table
> coming via fetchow_array call of DBI. fetrow_array returns
> undef for those columns which have null values from the RDBMS.
>
> I am comparing two arrays to determine whether they are same or
> different. Speed is utmost importance as the volumne of data
> is very large.
You are aware that concatenating all array elements and then comparing for
equality will result in false positives, are you?
Example:
['x', 'yz'] and ['xy', 'z'] are certainly different, while 'xyz' and
'xyz' are the same.
jue
------------------------------
Date: Sat, 6 Jan 2007 15:55:29 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: mod_perl-specific Compiler Options
Message-Id: <ennkm1$c0f$1@netnews.hinet.net>
What situation we need to modify the mod_perl's IO buffer size?
http://perl.apache.org/docs/2.0/user/install/install.html#_DMP_IOBUFSIZE
mod_perl-specific Compiler Options
Change the default mod_perl's 8K IO buffer size, e.g. to 16K:
MP_CCOPTS=-DMP_IOBUFSIZE=16384
------------------------------
Date: Sat, 6 Jan 2007 14:53:44 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Net::SSH installation problems - how do I force local path?
Message-Id: <459f1ea0$0$16555$afc38c87@news.optusnet.com.au>
"Ishmael" <stahl.karl@gmail.com> wrote in message
.
.
>
> As I read it, the compiler is looking for GMP.so in the Perl
> installation directory, but that's not where it is - it's in my local
> directory. How can I force the compiler to look in the right place?
> Thanks a million for your help.
>
See Sherm Pendley's post in the thread "Math::GMP make test fails" (posted
yesterday).
Cheers,
Rob
------------------------------
Date: 5 Jan 2007 21:22:54 -0800
From: "Ishmael" <stahl.karl@gmail.com>
Subject: Re: Net::SSH installation problems - how do I force local path?
Message-Id: <1168060974.069734.44580@s80g2000cwa.googlegroups.com>
Sisyphus wrote:
> "Ishmael" <stahl.karl@gmail.com> wrote in message
> .
> .
> >
> > As I read it, the compiler is looking for GMP.so in the Perl
> > installation directory, but that's not where it is - it's in my local
> > directory. How can I force the compiler to look in the right place?
> > Thanks a million for your help.
> >
>
> See Sherm Pendley's post in the thread "Math::GMP make test fails" (posted
> yesterday).
>
> Cheers,
> Rob
Well, actually this is the same person that posted the previous thread.
Sherm's reply was very helpful, but I'm afraid it doesn't apply in
this case. His reply is where I got the idea of putting a 'LIBS =>
...' line in my Makefile.PL. Alas, it doesn't do the trick this time
around. Somehow, 'make test' is bypassing my explicit path definition.
Any ideas?
------------------------------
Date: Sat, 6 Jan 2007 05:42:11 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Jan 6 2007
Message-Id: <JBFMIB.12MG@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Apache2-Pod-0.24
http://search.cpan.org/~kypreos/Apache2-Pod-0.24/
base class for converting Pod files to prettier forms
----
Audio-FLAC-Header-1.7
http://search.cpan.org/~daniel/Audio-FLAC-Header-1.7/
interface to FLAC header metadata.
----
Audio-Musepack-0.5
http://search.cpan.org/~daniel/Audio-Musepack-0.5/
An object-oriented interface to Musepack file information and APE tag fields, implemented entirely in Perl.
----
Audio-Musepack-0.6
http://search.cpan.org/~daniel/Audio-Musepack-0.6/
An object-oriented interface to Musepack file information and APE tag fields, implemented entirely in Perl.
----
Audio-WMA-1.1
http://search.cpan.org/~daniel/Audio-WMA-1.1/
Perl extension for reading WMA/ASF Metadata
----
Authen-Krb5-Admin-0.09
http://search.cpan.org/~korty/Authen-Krb5-Admin-0.09/
Perl extension for MIT Kerberos 5 admin interface
----
Bio-DOOP-DOOP-0.06
http://search.cpan.org/~tibi/Bio-DOOP-DOOP-0.06/
DOOP API main module
----
Bio-DasLite-1.39
http://search.cpan.org/~rpettett/Bio-DasLite-1.39/
Perl extension for the DAS (HTTP+XML) Protocol (http://biodas.org/)
----
Convert-Cisco-0.01
http://search.cpan.org/~marko/Convert-Cisco-0.01/
Module for converting Cisco billing records
----
Convert-Cisco-0.02
http://search.cpan.org/~marko/Convert-Cisco-0.02/
Module for converting Cisco billing records
----
Coro-3.3
http://search.cpan.org/~mlehmann/Coro-3.3/
coroutine process abstraction
----
Crypt-Cracklib-1.1
http://search.cpan.org/~daniel/Crypt-Cracklib-1.1/
Perl interface to Alec Muffett's Cracklib.
----
Crypt-OpenSSL-PKCS12-0.3
http://search.cpan.org/~daniel/Crypt-OpenSSL-PKCS12-0.3/
Perl extension to OpenSSL's PKCS12 API.
----
Data-SExpression-0.32
http://search.cpan.org/~nelhage/Data-SExpression-0.32/
Parse Lisp S-Expressions into perl data structures.
----
Devel-Symdump-2.07
http://search.cpan.org/~andk/Devel-Symdump-2.07/
dump symbol names or the symbol table
----
GPS-PRN-0.04
http://search.cpan.org/~mrdvt/GPS-PRN-0.04/
Package for PRN - Object ID conversions.
----
GPS-SpaceTrack-0.04
http://search.cpan.org/~mrdvt/GPS-SpaceTrack-0.04/
Package for calculating the position of GPS satellites
----
Graph-Easy-0.51
http://search.cpan.org/~tels/Graph-Easy-0.51/
Render graphs as ASCII, HTML, SVG or via Graphviz
----
HTML-TreeBuilder-XPath-0.07
http://search.cpan.org/~mirod/HTML-TreeBuilder-XPath-0.07/
add XPath support to HTML::TreeBuilder
----
IO-AIO-2.31
http://search.cpan.org/~mlehmann/IO-AIO-2.31/
Asynchronous Input/Output
----
Lemonldap-NG-Handler-0.73
http://search.cpan.org/~guimard/Lemonldap-NG-Handler-0.73/
The Apache module part of Lemonldap::NG Web-SSO system.
----
Lemonldap-NG-Manager-0.3
http://search.cpan.org/~guimard/Lemonldap-NG-Manager-0.3/
Perl extension for managing Lemonldap::NG Web-SSO system.
----
Lingua-DE-TypoGenerator-0.2
http://search.cpan.org/~mwitte/Lingua-DE-TypoGenerator-0.2/
German Typo Generator
----
Locale-Object-0.75
http://search.cpan.org/~hex/Locale-Object-0.75/
An object-oriented representation of locale information.
----
Math-Random-AcceptReject-0.02
http://search.cpan.org/~smueller/Math-Random-AcceptReject-0.02/
Acceptance-Rejection PDF transformations
----
PadWalker-1.4
http://search.cpan.org/~robin/PadWalker-1.4/
play with other peoples' lexical variables
----
PadWalker-1.5
http://search.cpan.org/~robin/PadWalker-1.5/
play with other peoples' lexical variables
----
Statistics-Test-Sequence-0.01
http://search.cpan.org/~smueller/Statistics-Test-Sequence-0.01/
Sequence correlation test for random numbers
----
WebService-Audioscrobbler-0.05
http://search.cpan.org/~nilsonsfj/WebService-Audioscrobbler-0.05/
An object-oriented interface to the Audioscrobbler WebService API
----
XML-Twig-3.28
http://search.cpan.org/~mirod/XML-Twig-3.28/
A perl module for processing huge XML documents in tree mode.
----
XML-XPathEngine-0.06
http://search.cpan.org/~mirod/XML-XPathEngine-0.06/
a re-usable XPath engine for DOM-like trees
----
XML-XPathEngine-0.07
http://search.cpan.org/~mirod/XML-XPathEngine-0.07/
a re-usable XPath engine for DOM-like trees
----
dotReader-v0.0.9
http://search.cpan.org/~ewilhelm/dotReader-v0.0.9/
----
onto-perl-0.24
http://search.cpan.org/~easr/onto-perl-0.24/
----
subs-parallel-0.08
http://search.cpan.org/~nilsonsfj/subs-parallel-0.08/
enables subroutines to seamlessly run in parallel
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 05 Jan 2007 20:03:45 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: OSCON 2006 - Perl programming vs. scripting
Message-Id: <050120072003456196%brian.d.foy@gmail.com>
In article <1167947369.713078.197100@q40g2000cwq.googlegroups.com>,
<usenet@DavidFilmer.com> wrote:
> A well-known Perl guru (I think it might have been Peter Scott) did a
> brief presentation encouraging folks to describe of Perl as a
> programming language rather than a scripting language. He used a whole
> slew of examples to show why (closures, methods, etc).
Andy Lester has been talking about that lately, and that's where I
heard it. I went through my latest book and changed almost every
"script" to "program" :)
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: 6 Jan 2007 04:35:21 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: OSCON 2006 - Perl programming vs. scripting
Message-Id: <Xns98AFE5C95E129castleamber@130.133.1.4>
brian d foy <brian.d.foy@gmail.com> wrote:
> In article <1167947369.713078.197100@q40g2000cwq.googlegroups.com>,
> <usenet@DavidFilmer.com> wrote:
>
>
>> A well-known Perl guru (I think it might have been Peter Scott) did a
>> brief presentation encouraging folks to describe of Perl as a
>> programming language rather than a scripting language. He used a whole
>> slew of examples to show why (closures, methods, etc).
>
> Andy Lester has been talking about that lately, and that's where I
> heard it. I went through my latest book and changed almost every
> "script" to "program" :)
Yup, I try to use more and more program on my website instead of script as
well. I advertise myself as a Perl programmer, not Perl scripter (which
sounds more to me like I work for the movies industry anyway).
BTW, what kind of book. And if you need a reviewer... :-p
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 05 Jan 2007 11:48:28 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Problematic Perl code
Message-Id: <87k601gvib.fsf@aragorn.emschwar>
Joe Smith <joe@inwap.com> writes:
> Eric Schwartz wrote:
> > It's not considered polite in this newsgroup to ask people to read
> > documentation for you if you can read it yourself.
>
> You've completely missed the point of what PerlNovice was asking.
> Reading the documentation on get() is not the answer in this case.
How's that? For whatever reason (your explanation is most probable,
and I'm kicking myself for not thinking of it), he wanted to copy a
file from a remote server to the local machine and rename it at the
same time. That's what Net::FTP::get() is for. I notice your reply
to him uses exactly the feature of that method I suggested the OP use,
so why, pray tell, was it not relevant?
-=Eric
------------------------------
Date: 5 Jan 2007 20:18:49 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: stalling server client program
Message-Id: <1168057129.405447.83630@q40g2000cwq.googlegroups.com>
deadpickle wrote:
> This program is designed to transfer a file to a client. When i go to
> run the program It sends the file once then sits there. The file that
> is sent is not closed and there fore conatins no data. I'm not sure
> what the problem is.
> <snip>
There are dozens of modules out there to accomplish what you're trying
to do - there's no need to get your hands dirty and introduce errors
like the one you are struggling with.
How about an IO::All solution?
client:
#!/usr/bin/perl
# client
use strict;
use warnings;
use IO::All;
my $ip = 'localhost';
my $port = 12345;
my $file = shift;
die "Supply file to be transmitted on command line\n"
if not defined $file;
my $socket = io( "$ip:$port" );
$socket->print($_) for io->file( $file )->getlines;
__END__
server:
#!/usr/bin/perl
# server
use strict;
use warnings;
use IO::All;
my $port = 12345;
my $listener = io( ":$port" )->accept;
print while $_ = $listener->getline;
__END__
HTH,
-jp
------------------------------
Date: 6 Jan 2007 04:37:31 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Win32::OLE - saving content of just one worksheet in Excel
Message-Id: <Xns98AFE62713615castleamber@130.133.1.4>
"Woland99" <woland99@gmail.com> wrote:
> Thanks for corrections, Brian.
>
> but the key part:
>
> $sheet->Select;
> $wbook->{ActiveSheet}->SaveAs({ FileName => $fullname_output_file,
> FileFormat => xlCurrentPlatformText } )
>
> does not work - I keep getting same error
> $! contains string "No such file or directory".
>
> $fullname_output_file:
> C:/edata/UserData/backup/features/sdata/scripts/test.txt
Thanks for not top posting.
You might want to s{/}{\\} $fullname_output_file
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 6 Jan 2007 04:38:02 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Win32::OLE - saving content of just one worksheet in Excel
Message-Id: <Xns98AFE63D4263Bcastleamber@130.133.1.4>
John Bokma <john@castleamber.com> wrote:
> You might want to s{/}{\\} $fullname_output_file
^ g
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 5 Jan 2007 22:34:56 -0800
From: "Woland99" <woland99@gmail.com>
Subject: Re: Win32::OLE - saving content of just one worksheet in Excel
Message-Id: <1168065296.867406.249660@s80g2000cwa.googlegroups.com>
$fullname_output_file =~ s{/}{\\}g;
That was my suspicion too but it does not work.
As amatter of fact Win32::OLE is not picky (in my opinion)
about forward/backard slash thing. When it works it even works
with file name that uses mix case of slashes.
The error message did not change:
No such file or directory
John Bokma wrote:
> John Bokma <john@castleamber.com> wrote:
>
> > You might want to s{/}{\\} $fullname_output_file
>
> ^ g
>
> --
> John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
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 V11 Issue 2
************************************