[30704] in Perl-Users-Digest
Perl-Users Digest, Issue: 1949 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 29 06:09:41 2008
Date: Wed, 29 Oct 2008 03:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 29 Oct 2008 Volume: 11 Number: 1949
Today's topics:
Re: Connect to MS SQL 2005 server from UNIX <slick.users@gmail.com>
Re: Connect to MS SQL 2005 server from UNIX <glex_no-spam@qwest-spam-no.invalid>
Re: Connect to MS SQL 2005 server from UNIX <slick.users@gmail.com>
Re: Connect to MS SQL 2005 server from UNIX <natxete@asenjo.nl.invalid>
Re: How to overwrite or mock -e for testing? helmut.wollmersdorfer.ext@siemens.com
if (/^$date\s+(.+)/) <xiaoxia2005a@yahoo.com>
Re: if (/^$date\s+(.+)/) <tim@burlyhost.com>
Re: implementing getopts when called by functions <glennj@ncf.ca>
Re: implementing getopts when called by functions <jurgenex@hotmail.com>
Re: implementing getopts when called by functions <smallpond@juno.com>
new CPAN modules on Wed Oct 29 2008 (Randal Schwartz)
Perl - Gnuplot Program Oct. 29, 2008 <edgrsprj@ix.netcom.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Oct 2008 10:35:17 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <e26c299d-60d4-4f0e-ab0e-a46d2109f5aa@v22g2000pro.googlegroups.com>
>
> Can you connect to the port on that server from your machine?
>
> telnet your.server.name 1433
>
I cannot by telnet.
> Does the database allow connections from your machine for that username
> and password?
I can log-in with provided user&password from Win32:ODBC or Microsoft
SQL management from Windows side.
------------------------------
Date: Tue, 28 Oct 2008 12:53:43 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <490751a8$0$33219$815e3792@news.qwest.net>
Slickuser wrote:
>> Can you connect to the port on that server from your machine?
>>
>> telnet your.server.name 1433
>>
> I cannot by telnet.
Just to be clear. You don't get a connection using telnet? e.g.
you don't see..
Trying some.ip.ad.dress...
Connected to some.machine.name
Escape character is '^]'.
You can't actually do anything via telnet, however it should
connect to the port. If it doesn't then "there's your problem
right there", or at least one of the problems. Contact
your Network/Firewall folks.
>
>> Does the database allow connections from your machine for that username
>> and password?
>
> I can log-in with provided user&password from Win32:ODBC or Microsoft
> SQL management from Windows side.
But, you're using a different machine running some flavor of Unix,
right? There are many reasons why connecting from another
machine/OS/IP wouldn't be allowed, none having to do with Perl.
------------------------------
Date: Tue, 28 Oct 2008 13:35:28 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <840f4c8c-cf37-463a-8145-1591b2a5bdd9@b31g2000prb.googlegroups.com>
On Oct 28, 10:53=A0am, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> Slickuser wrote:
> >> Can you connect to the port on that server from your machine?
>
> >> telnet your.server.name 1433
>
> > I cannot by telnet.
>
> Just to be clear. You don't get a connection using telnet? e.g.
> you don't see..
>
> Trying some.ip.ad.dress...
> Connected to some.machine.name
> Escape character is '^]'.
>
> You can't actually do anything via telnet, however it should
> connect to the port. =A0If it doesn't then "there's your problem
> right there", or at least one of the problems. Contact
> your Network/Firewall folks.
>
>
>
If I do > telnet server 1433
I have my command prompt windows title to be: "Telnet server" and the
cursor is blinking.
> >> Does the database allow connections from your machine for that usernam=
e
> >> and password?
>
> > I can log-in with provided user&password from Win32:ODBC or Microsoft
> > SQL management from Windows side.
>
> But, you're using a different machine running some flavor of Unix,
> right? There are many reasons why connecting from another
> machine/OS/IP wouldn't be allowed, none having to do with Perl.
But this user/password has nothing to do Unix.
If I can connect from Windows using perl Win32 ODBC, C#.net SQL
command, and SQL Management (same user/password from SQL Database).
Then I should be able to connect through Unix with the same user/
password.
I still don't know why though.
------------------------------
Date: 28 Oct 2008 21:21:51 GMT
From: Natxo Asenjo <natxete@asenjo.nl.invalid>
Subject: Re: Connect to MS SQL 2005 server from UNIX
Message-Id: <4907826f$0$184$e4fe514c@news.xs4all.nl>
On 2008-10-28, Slickuser <slick.users@gmail.com> wrote:
> If I do > telnet server 1433
> I have my command prompt windows title to be: "Telnet server" and the
> cursor is blinking.
ok, if it doesn't time out, that is fine.
What you need is to configure a odbc driver in your unix server. Try this:
http://www.easysoft.com/developer/languages/perl/sql_server_unix_tutorial.html
(link is one line, sorry)
> If I can connect from Windows using perl Win32 ODBC, C#.net SQL
> command, and SQL Management (same user/password from SQL Database).
> Then I should be able to connect through Unix with the same user/
> password.
>
> I still don't know why though.
because odbc is not properly configured at your end. It works, honest.
--
Groeten,
J.I.Asenjo
------------------------------
Date: Tue, 28 Oct 2008 09:14:38 -0700 (PDT)
From: helmut.wollmersdorfer.ext@siemens.com
Subject: Re: How to overwrite or mock -e for testing?
Message-Id: <197e2ad1-960b-4f9f-ba25-8c07a584f964@b31g2000prf.googlegroups.com>
On 27 Okt., 20:53, "John W. Krahn" <some...@example.com> wrote:
> Why are you using -e? =A0
It is not my code. I only want to test the module without change of
the source.
My question is how to mock or overwrite '-e', or more general '-X', or
overwrite the function behind the operator '-e'.
Helmut Wollmersdorfer
------------------------------
Date: Tue, 28 Oct 2008 20:17:09 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: if (/^$date\s+(.+)/)
Message-Id: <d6a110e2-cbf5-4909-ab05-1b90fcd084ee@k13g2000hse.googlegroups.com>
{
printf "%2d. ", $count;
print "$1\n";
}
what would be true for /^$date\s+(.+)/? \s+ matches one or more white
spaces, and (.+) matches the rest?
------------------------------
Date: Tue, 28 Oct 2008 22:58:41 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: if (/^$date\s+(.+)/)
Message-Id: <AYSNk.5565$yx1.3632@newsfe14.iad>
April wrote:
>
> {
> printf "%2d. ", $count;
> print "$1\n";
> }
^^^^^^^^^^
Is the above supposed to relate to your question?
> what would be true for /^$date\s+(.+)/? \s+ matches one or more white
> spaces, and (.+) matches the rest?
.+ matches anything (one or more characters) after the start of the line
^ and whatever $date is, one or more white spaces and then captures
whatever follows it. You might want to be more specific if you want to
match up to the end of the line $ or include new lines, or only match
up to a certain length or character, etc. So, yes and no, depending.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
------------------------------
Date: 28 Oct 2008 14:31:58 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: implementing getopts when called by functions
Message-Id: <slrngge8iv.bt6.glennj@smeagol.ncf.ca>
At 2008-10-28 04:55AM, "Ironhide" wrote:
> Hi,
>
> Is it possible to do this in perl?
> If yes, please let me know how.
>
> sub A {
>
> IOWorkload -v .. -a ..
>
> }
>
> sub IOWorkload {
> ..
> ..
> }
Adapting a good example from the Perl Cookbook:
sub A {
IOWorkload( -v => 'v_value', -a => 'a_value' );
}
sub IOWorkload {
my %args = (
-a => 'default_a',
-v => 'default_v',
@_
);
# ...
}
--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
------------------------------
Date: Tue, 28 Oct 2008 07:54:24 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: implementing getopts when called by functions
Message-Id: <7l9eg4llthi8ppcunql7kvibt1jbh9osrb@4ax.com>
Ironhide <gourabbaksi@gmail.com> wrote:
>Is it possible to do this in perl?
>If yes, please let me know how.
>
>sub A {
Yes.
>IOWorkload -v .. -a ..
No. The range operator is a binary operator, i.e. there is a missing
value at the end of that line.
Also, using two range operators like that most likely won't produce the
results you may be expecting because one of the lists will be converted
to a scalar as argument for the second range op.
>}
>
>sub IOWorkload {
No. IOWorkload must be declared before being used if you want to omit
the paranthesis in the call.
jue
------------------------------
Date: Tue, 28 Oct 2008 11:23:19 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: implementing getopts when called by functions
Message-Id: <66ce1b85-8b02-4b73-a480-f5a6a901f29d@i20g2000prf.googlegroups.com>
On Oct 28, 4:55 am, Ironhide <gourabba...@gmail.com> wrote:
> Hi,
>
> Is it possible to do this in perl?
> If yes, please let me know how.
>
> sub A {
>
> IOWorkload -v .. -a ..
>
> }
>
> sub IOWorkload {
> ..
> ..
>
> }
>
> _G
You could try something like:
use Getopt::Tiny;
sub IOWorkload($) {
$_ = shift;
my @ARGS = split;
------------------------------
Date: Wed, 29 Oct 2008 04:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Oct 29 2008
Message-Id: <K9HH2M.pGn@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.
Acme-PlayCode-0.07
http://search.cpan.org/~fayland/Acme-PlayCode-0.07/
Play code to win
----
Acme-PlayCode-0.08
http://search.cpan.org/~fayland/Acme-PlayCode-0.08/
Play code to win
----
Acme-PlayCode-0.09
http://search.cpan.org/~fayland/Acme-PlayCode-0.09/
Play code to win
----
Amazon-SQS-Simple-0.10
http://search.cpan.org/~swhitaker/Amazon-SQS-Simple-0.10/
OO API for accessing the Amazon Simple Queue Service
----
Amazon-SQS-Simple-1.00
http://search.cpan.org/~swhitaker/Amazon-SQS-Simple-1.00/
OO API for accessing the Amazon Simple Queue Service
----
App-Rad-0.5
http://search.cpan.org/~garu/App-Rad-0.5/
Rapid (and easy!) creation of command line applications
----
App-ZofCMS-Plugin-AutoIMGSize-0.0101
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-AutoIMGSize-0.0101/
automatically get image sizes and generate appropriate <img> tags
----
Catalyst-Plugin-ConfigComponents-0.1.45
http://search.cpan.org/~pjfl/Catalyst-Plugin-ConfigComponents-0.1.45/
Creates components from config entries
----
Distribution-Cooker-0.11
http://search.cpan.org/~bdfoy/Distribution-Cooker-0.11/
This is the description
----
Games-Risk-2.1.1
http://search.cpan.org/~jquelin/Games-Risk-2.1.1/
classical 'risk' board game
----
Geo-Demo-Zipskinny-0.01
http://search.cpan.org/~allenday/Geo-Demo-Zipskinny-0.01/
Census 2000 geographic and demographic data by ZIP code, courtesy of ZIPskinny.com
----
Gtk2-PathButtonBar-0.0.0
http://search.cpan.org/~vvelox/Gtk2-PathButtonBar-0.0.0/
Creates a bar for path manipulation.
----
IO-Lambda-0.33
http://search.cpan.org/~karasik/IO-Lambda-0.33/
non-blocking I/O in lambda style
----
Lingua-JA-TFIDF-0.00001
http://search.cpan.org/~miki/Lingua-JA-TFIDF-0.00001/
TFIDF Calculator based on MeCab.
----
Lingua-JA-TFIDF-0.00002
http://search.cpan.org/~miki/Lingua-JA-TFIDF-0.00002/
TF/IDF calculator based on MeCab.
----
Locale-Country-Multilingual-0.07
http://search.cpan.org/~graf/Locale-Country-Multilingual-0.07/
ISO codes for country identification with multi-language (ISO 3166)
----
Locale-Maketext-Lexicon-0.72
http://search.cpan.org/~drtech/Locale-Maketext-Lexicon-0.72/
Use other catalog formats in Maketext
----
Locale-Maketext-Lexicon-0.73
http://search.cpan.org/~drtech/Locale-Maketext-Lexicon-0.73/
Use other catalog formats in Maketext
----
Locale-Maketext-Lexicon-DBI-0.1.0
http://search.cpan.org/~mdietrich/Locale-Maketext-Lexicon-DBI-0.1.0/
Database based lexicon fetcher/parser
----
Log-Handler-0.48
http://search.cpan.org/~bloonix/Log-Handler-0.48/
Log messages to several outputs.
----
Metadata-DB-1.15
http://search.cpan.org/~leocharre/Metadata-DB-1.15/
----
Method-Signatures-20081028
http://search.cpan.org/~mschwern/Method-Signatures-20081028/
method declarations with signatures and no source filter
----
Module-Extract-Use-0.11
http://search.cpan.org/~bdfoy/Module-Extract-Use-0.11/
Pull out the modules a module uses
----
Module-ScanDeps-0.87
http://search.cpan.org/~smueller/Module-ScanDeps-0.87/
Recursively scan Perl code for dependencies
----
Module-Starter-1.50
http://search.cpan.org/~petdance/Module-Starter-1.50/
a simple starter kit for any module
----
MooseX-Meta-Attribute-Index-0.04
http://search.cpan.org/~ctbrown/MooseX-Meta-Attribute-Index-0.04/
Provides index meta attribute trait
----
MooseX-Meta-Attribute-Lvalue-0.03
http://search.cpan.org/~ctbrown/MooseX-Meta-Attribute-Lvalue-0.03/
Immplements lvalue accessors via meta-attribute trait
----
MooseX-Types-Structured-0.02
http://search.cpan.org/~jjnapiork/MooseX-Types-Structured-0.02/
Structured Type Constraints for Moose
----
Mouse-0.10
http://search.cpan.org/~sartak/Mouse-0.10/
Moose minus the antlers
----
Net-Amazon-HadoopEC2-S3fs-0.02
http://search.cpan.org/~danjou/Net-Amazon-HadoopEC2-S3fs-0.02/
Perl interface to hadoop s3fs
----
Net-BitTorrent-0.027_006
http://search.cpan.org/~sanko/Net-BitTorrent-0.027_006/
BitTorrent peer-to-peer protocol class
----
Net-IMAP-Simple-Plus-1.17005
http://search.cpan.org/~jettero/Net-IMAP-Simple-Plus-1.17005/
NIS 1.71 plus a couple patches
----
Net-SFTP-Foreign-1.45_02
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.45_02/
SSH File Transfer Protocol client
----
Net-SFTP-Foreign-1.45_03
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.45_03/
SSH File Transfer Protocol client
----
Path-Dispatcher-0.03
http://search.cpan.org/~sartak/Path-Dispatcher-0.03/
flexible dispatch
----
Path-Dispatcher-0.04
http://search.cpan.org/~sartak/Path-Dispatcher-0.04/
flexible dispatch
----
Sledge-HTTPSession-0.01
http://search.cpan.org/~tokuhirom/Sledge-HTTPSession-0.01/
HTTP::Session to Sledge bindings
----
Sledge-HTTPSession-0.01_02
http://search.cpan.org/~tokuhirom/Sledge-HTTPSession-0.01_02/
HTTP::Session to Sledge bindings
----
Text-Tmpl-0.33
http://search.cpan.org/~dlowe/Text-Tmpl-0.33/
Templating system perl library
----
Tk-TextHighlight-1.0.5
http://search.cpan.org/~turnerjw/Tk-TextHighlight-1.0.5/
a TextUndo widget with syntax highlighting capabilities.
----
WWW-Contact-0.13
http://search.cpan.org/~sachinjsk/WWW-Contact-0.13/
Get contacts/addressbook from Web
----
WWW-Contact-0.14
http://search.cpan.org/~sachinjsk/WWW-Contact-0.14/
Get contacts/addressbook from Web
----
YUM-RepoQuery-0.1.1
http://search.cpan.org/~rsrchboy/YUM-RepoQuery-0.1.1/
Query a YUM repository for package information
----
file-tabulardata-0.04
http://search.cpan.org/~xerxes/file-tabulardata-0.04/
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 29 Oct 2008 04:49:56 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Perl - Gnuplot Program Oct. 29, 2008
Message-Id: <FfCdnTBie5N3rJXUnZ2dnUVZ_tCdnZ2d@earthlink.com>
PERL - GNUPLOT PROGRAM
An earthquake forecasting and triggering research computer program under
development for quite a few years is now up and running. And people are
testing it before it is released for general use. The basic program was
written using the Perl language. It sends information to Gnuplot for
graphics support.
This present Newsgroup posting asks a few questions regarding Perl and
Gnuplot resources and makes a few comments about using the combination of
Perl and Gnuplot.
Some of the types of data this earthquake program generates can be seen on
the following Web page.
http://www.freewebz.com/eq-forecasting/Data.html
Detailed discussions regarding what the program does and how it works can be
found in the following bulletin board postings. People need to be
registered with the board owner in order to post notes there.
http://www.earthwaves.org/wwwboard/messages/74419.html
GNUPLOT RESOURCES
The earthquake program uses the world map supplied with the Gnuplot
download.
Are other Gnuplot compatible files available like that map?
Those of us doing the work are particularly interested in maps of things
such as earthquake fault zones and city locations.
Is there some type of program that can import a drawing such as a GIF file
and reproduce its major structures in a Gnuplot compatible file?
Gnuplot drawings are easy to create. And we will do that if necessary. But
if files like that are already available then that would save some time.
Something I suggested in the past is that commands be built into Gnuplot
that enable it to import a picture file such as a GIF file and use it as the
computer screen background instead of just having solid color backgrounds.
PERL - GNUPLOT OBSERVATIONS
It took a very long time, but last August I was finally able to determine
how to create .exe programs from the original Perl .pl programs. It is quite
easy to do once the necessary modules are merged with Perl and the proper
file creation command is used. But learning how to do that for a person who
is not a Perl expert can be difficult.
This new earthquake program could conceivably spark some international
interest in creating those .exe programs. And if that does happen then it
might be worthwhile to create a single package that can be downloaded with
the original Perl software that would make installing those modules an
automatic process. To create .exe versions of the earthquake program with
all of the needed math capabilities etc. I had to add perhaps a dozen
different modules to Perl.
It also took a very long time to learn how to send commands from Perl to
Gnuplot using a "pipe." But, the effort was definitely worthwhile. My Perl
programs have always been fairly robust. They keep running even when they
encounter problems such as with sharing files with other programs. However,
with the original interactive Perl - Gnuplot link I developed, Gnuplot would
crash on regular basis. The Perl - Gnuplot pipe changes everything.
Gnuplot now keeps running almost no matter what happens. It never seems to
crash regardless of how fast Perl sends it commands.
There was one problem with the pipe. And I had to develop a way around it.
On my newer Windows Vista computer the Perl - Gnuplot pipe starts and runs
fine every time. But on an older and slower Windows XP computer, the first
time during a session when Perl was instructed to initiate the pipe, Gnuplot
took too long to load. Perl kept running. But one of the programs
generated an error message saying that Gnuplot was not ready. And some
manual steps had to be taken to get it running again.
There might be a way within Windows to deal with timing problems like that.
But the procedure that I developed is to have Perl start a simple Gnuplot
program running using the "system" command the first time Gnuplot loads.
After a few seconds the Gnuplot software is in the computer memory and the
program exits. Perl then creates the Gnuplot pipe. With that procedure
Gnuplot loads and runs every time without a problem.
DEVELOPMENT WEB SITE
A number of these programs are now actually running. And as soon as those
of us doing the work find a suitable Web site we plan to start storing them
there as freeware programs along with their source codes. Professional and
amateur researchers around the world will then be able to both download them
and develop their own versions of the programs plus new Gnuplot map files
etc.
The SourceForge site is available. But this is intended to be a somewhat
interactive effort for researchers around the world. And from what I have
seen by looking at the SourceForge site it does not appear to be designed
for that.
------------------------------
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 1949
***************************************