[28156] in Perl-Users-Digest
Perl-Users Digest, Issue: 9520 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 25 03:06:00 2006
Date: Tue, 25 Jul 2006 00:05:09 -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 Tue, 25 Jul 2006 Volume: 10 Number: 9520
Today's topics:
Re: "bad interpreter" error <fishfry@your-mailbox.com>
Re: Capture a image on client machine pjsenthil@gmail.com
Find and convert to UC <chris-newman@bigpond.com>
Re: Find and convert to UC <jurgenex@hotmail.com>
Re: Find and convert to UC <jurgenex@hotmail.com>
Re: Find and convert to UC <chris-newman@bigpond.com>
Re: Find and convert to UC <jurgenex@hotmail.com>
Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER <apersaud@gmail.com>
Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER usenet@DavidFilmer.com
Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER <sisyphus1@nomail.afraid.org>
How to Put a file on server pjsenthil@gmail.com
Re: Idiot Q: How to find index number of HASH match? <franzl.wisseworst@mailinator.net>
new CPAN modules on Tue Jul 25 2006 (Randal Schwartz)
Pass hash to subroutine? <zhushenli@gmail.com>
Re: Pass hash to subroutine? <noreply@gunnar.cc>
Problems handling variable data <apersaud@gmail.com>
Re: Problems handling variable data <apersaud@gmail.com>
Re: Software Frameworks <fishfry@your-mailbox.com>
Re: Use MSXML in perl without registration <sisyphus1@nomail.afraid.org>
Re: Use MSXML in perl without registration <shah.vinay@gmail.com>
Re: Use MSXML in perl without registration <tuser3@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 24 Jul 2006 22:32:52 -0700
From: fishfry <fishfry@your-mailbox.com>
Subject: Re: "bad interpreter" error
Message-Id: <fishfry-584F08.22325224072006@comcast.dca.giganews.com>
In article <1153547561.459519.71200@h48g2000cwc.googlegroups.com>,
linziheng@gmail.com wrote:
> Hi all,
>
> I use vim to create a perl file, change its permission to executable,
> and then type "./myfile.pl" to run it, but i got the following error
>
> : bad interpreter: No such file or directoryl
>
> The first line of the file is pointing correctly to my perl. And when i
> run "perl myfile.pl", it runs happily.
That's a clue. Clearly your #! line isn't correct. FWIW if you happen to
have an invisibile DOS line terminator at the end of your #! it causes
an error like that. Could that be the problem?
------------------------------
Date: 24 Jul 2006 21:43:29 -0700
From: pjsenthil@gmail.com
Subject: Re: Capture a image on client machine
Message-Id: <1153802609.469520.319050@m79g2000cwm.googlegroups.com>
But i thought of doing it in client server architecture with making it
as installable application..that is in web...
Is it not possible....do it in javascript...
Regards
Senthilvelu.P.J
Matt Garrish wrote:
> pjsenthil@gmail.com wrote:
> > Mine is a Client -server Acrichitecture..The client will be viewing a
> > video..if interested he will capture a video frame. and he will store
> > on the server machine..and the corresponding path of the image will be
> > stored on the server and will be used for further editions...
> >
>
> >From a browser, you wouldn't be able to do it unless the person
> captures the image, saves it and then uploads it through a form.
>
> You could write a client-side application to do the work of capturing
> the image and posting it back to the server, but that would of course
> require the user to install your app. You could write such a beast in
> Perl and compile it to an executable, but how it would work (i.e.,
> capture the image) would would depend on what OS it's run on. And you'd
> likely find yourself limited to a simple screen capture of the users
> desktop (unless the video is running in full-screen mode, I suppose).
>
> Matt
------------------------------
Date: Tue, 25 Jul 2006 03:03:44 GMT
From: Chris Newman <chris-newman@bigpond.com>
Subject: Find and convert to UC
Message-Id: <0001HW.C0EBC58D00249B8CF0407500@news.bigpond.com>
I have 1500 records in a file.
I know how to read the file EOF etc
Here is a typical record
Barkell, William James ps Lone Pine Gardens, Reid
I want to convert the first occurrence of a mixed case word to all upper
case. Could someone oblige please. Have tried the substitution but it good
at finding the word but not at handling the replacement of individual letters
which I require
------------------------------
Date: Tue, 25 Jul 2006 03:10:12 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Find and convert to UC
Message-Id: <oYfxg.10462$2u4.5699@trnddc06>
Chris Newman wrote:
> I want to convert the first occurrence of a mixed case word to all
> upper case. Could someone oblige please. Have tried the substitution
> but it good at finding the word but not at handling the replacement
> of individual letters which I require
No replacement of individual letters necessary. See "perldoc -f upper".
Second major advantage: if handles _all_ characters correctly, even those
you do not know because they are not used in your country/language/culture.
jue
------------------------------
Date: Tue, 25 Jul 2006 04:01:55 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Find and convert to UC
Message-Id: <TIgxg.7944$yN3.214@trnddc04>
Jürgen Exner wrote:
> Chris Newman wrote:
>> I want to convert the first occurrence of a mixed case word to all
>> upper case. Could someone oblige please. Have tried the substitution
>> but it good at finding the word but not at handling the replacement
>> of individual letters which I require
>
> No replacement of individual letters necessary. See "perldoc -f
> upper". Second major advantage: if handles _all_ characters
Sorry, brain fart.
Make that "perdoc -f uc", of course.
jue
------------------------------
Date: Tue, 25 Jul 2006 05:02:10 GMT
From: Chris Newman <chris-newman@bigpond.com>
Subject: Re: Find and convert to UC
Message-Id: <0001HW.C0EBE14E002B1CD7F0407500@news.bigpond.com>
On Tue, 25 Jul 2006 14:01:55 +1000, Jürgen Exner wrote
(in article <TIgxg.7944$yN3.214@trnddc04>):
> Jürgen Exner wrote:
>> Chris Newman wrote:
>>> I want to convert the first occurrence of a mixed case word to all
>>> upper case. Could someone oblige please. Have tried the substitution
>>> but it good at finding the word but not at handling the replacement
>>> of individual letters which I require
>>
>> No replacement of individual letters necessary. See "perldoc -f
>> upper". Second major advantage: if handles _all_ characters
>
> Sorry, brain fart.
> Make that "perdoc -f uc", of course.
>
> jue
>
>
Thanks Jurgen, Must be lost in translation. Here is Australia i*brain fart *
is not complimentary :)
------------------------------
Date: Tue, 25 Jul 2006 05:23:34 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Find and convert to UC
Message-Id: <qVhxg.2986$K94.2227@trnddc01>
Chris Newman wrote:
> On Tue, 25 Jul 2006 14:01:55 +1000, Jürgen Exner wrote
>> Jürgen Exner wrote:
>>> No replacement of individual letters necessary. See "perldoc -f
>>> upper". Second major advantage: if handles _all_ characters
>>
>> Sorry, brain fart.
>> Make that "perdoc -f uc", of course.
>
> Thanks Jurgen, Must be lost in translation. Here is Australia
> i*brain fart * is not complimentary :)
It wasn't meant as a compliment. Let me spell it out completely:
"Sorry, I had a brain fart"
I hope you didn't read the abbreviated form as an offence that was targeted
at you.
jue
------------------------------
Date: 24 Jul 2006 20:14:18 -0700
From: "apersaud" <apersaud@gmail.com>
Subject: Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER
Message-Id: <1153797258.286948.90420@p79g2000cwp.googlegroups.com>
Install Math::BigInt::GMP and that should speed things up -- thats how
I fixed my slowness.
usenet@DavidFilmer.com wrote:
> Kindly consider the following script which I am having a problem with:
>
> #!/usr/bin/perl
> use strict; use warnings;
> use Net::SFTP;
>
> my %args = qw{ user myuserid password mypassword debug 1 };
> $args{'ssh_args'} = [protocol => 2];
>
> my $sftp = Net::SFTP->new('123.456.78.90', %args) or die $!;
>
> __END__
>
> The script works fine, but on one particular machine it takes about a
> minute to get the SFTP handle. The identical script runs instantly on
> another (inferior) machine.
>
> So, naturally, I would suspect a problem with that particular machine
> that would have nothing to do with my script (maybe a routing issue,
> etc), EXCEPT two things make me think the problem somehow involves the
> Net::SFTP module itself:
>
> 1. "sftp" from a shell (same parameters) connects instantly.
> 2. I can get a Net::SSH::Perl handle (same %args) instantly.
>
> With debug mode turned on, I observe that there are long pauses at
> three points. I've posted the debug output (with pauses indicated)
> below. I see no obvious reason for any performance problems (I'm
> running on a new and lightly loaded p520 (POWER5) AIX box). As I said,
> I can get a Net::SSH::Perl handle instantly (and Net::SFTP uses N:S:P).
>
> If anyone has any suggestions on what the problem might be with using
> Net::SFTP from this particular machine, please let me know. Here's my
> Net::SFTP debug output (with pauses indicated):
>
> server: Reading configuration data /myuserid/.ssh/config
> server: Reading configuration data /etc/ssh_config
> server: Connecting to server123.mycompany.com, port 22.
> server: Remote protocol ver 1.99, remote ver OpenSSH_3.6.1p2
> server: Net::SSH::Perl Version 1.29, protocol version 2.0.
> server: No compat match: OpenSSH_3.6.1p2.
> server: Connection established.
> server: Sent key-exchange init (KEXINIT), wait response.
> server: Algorithms, c->s: 3des-cbc hmac-sha1 none
> server: Algorithms, s->c: 3des-cbc hmac-sha1 none
>
> >>long pause........................................................
>
> server: Entering Diffie-Hellman Group 1 key exchange.
> server: Sent DH public key, waiting for reply.
> server: Received host key, type 'ssh-dss'.
> server: Host 'server123.mycompany.com' is known and matches host key
> server: Computing shared secret key.
>
> >>long pause........................................................
>
> server: Verifying server signature.
>
> >>long pause........................................................
>
> server: Waiting for NEWKEYS message.
> server: Enabling incoming encryption/MAC/compression.
> server: Send NEWKEYS, enable outgoing encryption/MAC/compression.
> server: Sending request for user-authentication service.
> server: Service accepted: ssh-userauth.
> server: Trying empty user-authentication request.
> server: Authentication methods that can continue:
> publickey,password,keyboard-interactive.
> server: Next method to try is publickey.
> server: Next method to try is password.
> server: Trying password authentication.
> server: Login completed, opening dummy shell channel.
> server: channel 0: new [client-session]
> server: Requesting channel_open for channel 0.
> server: channel 0: open confirm rwindow 0 rmax 32768
> Establishing SFTP connection with server server123.mycompany.com:
> channel 1: new [client-session]
> server: Requesting channel_open for channel 1.
> server: Sending subsystem: sftp
> server: Requesting service subsystem on channel 1.
> server: channel 1: open confirm rwindow 0 rmax 32768
> server: sftp: Sending SSH2_FXP_INIT
> server: sftp: Remote version: 3
> SFTP connected
>
> --
> David Filmer (http://DavidFilmer.com)
------------------------------
Date: 24 Jul 2006 20:40:16 -0700
From: usenet@DavidFilmer.com
Subject: Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER
Message-Id: <1153798816.581606.62920@h48g2000cwc.googlegroups.com>
apersaud wrote:
> Install Math::BigInt::GMP and that should speed things up -- thats how
> I fixed my slowness.
Thanks, apersaud. Another poster, Radek (rahed), kindly posed this
solution in a previous reply to this thread. And you are both correct
- installing the Math::BigInt::GMP module did solve the Net::SFTP
problems I was having.
I do wonder, though... this module is not mentioned in the Net::SSH or
Net::SFTP perldocs, and a -MCPAN install does not try to install it as
a prereq. Math::BigInt::GMP is nowhere near being a builtin module.
Absence of the module does not produce "use" or "require" errors or
warnings when using Net::SFTP. Dependency on this module is not
anything I would consider intuitive or easily discerned (and, oddly
enough, it's not REALLY a dependency, although the horrible performance
without the module would qualify it as 'dependent' AFAIAC).
So..... Why doesn't EVERYBODY have this problem with Net::SFTP?
Hmmmm.
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Tue, 25 Jul 2006 14:22:45 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Getting Net::SFTP handle takes FOR-FLIPPIN-EVER
Message-Id: <44c59d81$0$22385$afc38c87@news.optusnet.com.au>
<usenet@DavidFilmer.com> wrote in message
.
.
> Absence of the module does not produce "use" or "require" errors or
> warnings when using Net::SFTP.
Somewhere in the Net::SFTP source there is presumably something like:
use Math::BigInt lib => 'GMP';
That line of code ensures that, if Math::BigInt::GMP is installed, then the
(very fast) Math::BigInt::GMP module handles the computations. If, however,
Math::BigInt::GMP is not installed, then the (very slow) Math::BigInt module
handles the computations. (I have a vague notion that a message is written
to stderr if Math::BigInt::GMP is not found, telling you that the program is
reverting to pure perl routines - but I'm not entirely sure about that.)
That accounts for the difference in the performance that you got - pure perl
Math::BigInt versus the GMP C library.
Cheers,
Rob
------------------------------
Date: 24 Jul 2006 23:06:25 -0700
From: pjsenthil@gmail.com
Subject: How to Put a file on server
Message-Id: <1153807585.522156.112670@m73g2000cwd.googlegroups.com>
I have to put a file from a client machine to the Webserver..how can i
do in CGI -perl
Regards
Senthilvelu
------------------------------
Date: Tue, 25 Jul 2006 07:00:41 +0200
From: Franzl Wisseworst <franzl.wisseworst@mailinator.net>
Subject: Re: Idiot Q: How to find index number of HASH match?
Message-Id: <ea49da$a8$01$1@news.t-online.com>
Mumia W. wrote:
[..]
> The line I wrote above says "if $match_index is defined,
> return $match_index, otherwise return '404.html'". Now I want
> it to say, "if $match_index is not the empty string, return
> $match_index, otherwise return '404.html'".
>
> my $string = $match_index ne '' ? $match_index : '404.html';
Thanks for explaining and providing the above example.
> Look at "perldoc perlop" § _Conditional Operator_ if the "?
> ... : ..." syntax confuses you.
I'm reading the 32-page docs now, which should make me a bit wiser.
------------------------------
Date: Tue, 25 Jul 2006 04:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Jul 25 2006
Message-Id: <J2xzqA.q3A@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-MetaSyntactic-0.84
http://search.cpan.org/~book/Acme-MetaSyntactic-0.84/
Themed metasyntactic variables names
----
Acme-Phlegethoth-1.02
http://search.cpan.org/~rcaputo/Acme-Phlegethoth-1.02/
Improve your code's readability, if you're an Ancient One
----
App-Context-0.963
http://search.cpan.org/~spadkins/App-Context-0.963/
An application framework for web applications, command-line programs, server programs, and web services
----
App-Options-1.00
http://search.cpan.org/~spadkins/App-Options-1.00/
Combine command line options, environment vars, and option file values (for program configuration)
----
App-Repository-0.963
http://search.cpan.org/~spadkins/App-Repository-0.963/
Logical data access layer for the App::Context Framework, providing a uniform API to access data in databases, file systems, remote web sites, etc.
----
App-Widget-0.963
http://search.cpan.org/~spadkins/App-Widget-0.963/
Family of web user interface widgets for the App::Context Framework, enabling development of complex UI's in a CGI, mod_perl, or other web context
----
App-Widget-ChartDirector-0.60
http://search.cpan.org/~spadkins/App-Widget-ChartDirector-0.60/
Graphing widget which displays graphs and charts for web applications using the ChartDirector graphing library within the App-Context Framework
----
App-Widget-JSApp-0.60
http://search.cpan.org/~spadkins/App-Widget-JSApp-0.60/
Dynamic, client-side widgets for the App-Context Framework using the js-app Javascript distribution
----
Astro-satpass-0.009
http://search.cpan.org/~wyant/Astro-satpass-0.009/
----
BSD-Sysctl-0.01
http://search.cpan.org/~dland/BSD-Sysctl-0.01/
Fetch sysctl values from BSD-like systems
----
CPAN-1.87_54
http://search.cpan.org/~andk/CPAN-1.87_54/
query, download and build perl modules from CPAN sites
----
Catalyst-Model-DBI-SQL-Library-0.14
http://search.cpan.org/~alexp/Catalyst-Model-DBI-SQL-Library-0.14/
SQL::Library DBI Model Class
----
Catalyst-Plugin-C3-0.01000_06
http://search.cpan.org/~blblack/Catalyst-Plugin-C3-0.01000_06/
Catalyst Plugin to subvert NEXT to use Class::C3
----
Catalyst-Plugin-FormValidator-Simple-Auto-0.05
http://search.cpan.org/~typester/Catalyst-Plugin-FormValidator-Simple-Auto-0.05/
Smart validation with FormValidator::Simple
----
Catalyst-Plugin-FormValidator-Simple-Auto-0.06
http://search.cpan.org/~typester/Catalyst-Plugin-FormValidator-Simple-Auto-0.06/
Smart validation with FormValidator::Simple
----
DBD-File-0.35
http://search.cpan.org/~jzucker/DBD-File-0.35/
Base class for writing DBI drivers
----
Data-Bind-0.28
http://search.cpan.org/~clkao/Data-Bind-0.28/
Bind and alias variables
----
DateTime-0.32
http://search.cpan.org/~drolsky/DateTime-0.32/
A date and time object
----
DateTime-Format-Mail-0.30
http://search.cpan.org/~drolsky/DateTime-Format-Mail-0.30/
Convert between DateTime and RFC2822/822 formats
----
Devel-Required-0.07
http://search.cpan.org/~elizabeth/Devel-Required-0.07/
Automatic update of required modules documentation
----
Device-Gsm-1.43
http://search.cpan.org/~cosimo/Device-Gsm-1.43/
Perl extension to interface GSM phones / modems
----
Digest-SHA-5.42
http://search.cpan.org/~mshelor/Digest-SHA-5.42/
Perl extension for SHA-1/224/256/384/512
----
Digest-SHA-PurePerl-5.42
http://search.cpan.org/~mshelor/Digest-SHA-PurePerl-5.42/
Perl implementation of SHA-1/224/256/384/512
----
Email-Abstract-2.12
http://search.cpan.org/~rjbs/Email-Abstract-2.12/
unified interface to mail representations
----
Email-Abstract-2.13
http://search.cpan.org/~rjbs/Email-Abstract-2.13/
unified interface to mail representations
----
Email-Send-2.16
http://search.cpan.org/~rjbs/Email-Send-2.16/
Simply Sending Email
----
Email-Store-0.25
http://search.cpan.org/~rjbs/Email-Store-0.25/
Framework for database-backed email storage
----
File-StatCache-0.03
http://search.cpan.org/~pevans/File-StatCache-0.03/
a caching wrapper around the stat() function
----
GO-TermFinder-0.71
http://search.cpan.org/~sherlock/GO-TermFinder-0.71/
identify GO nodes that annotate a group of genes with a significant p-value
----
Geo-Coder-Yahoo-0.02
http://search.cpan.org/~abh/Geo-Coder-Yahoo-0.02/
Geocode addresses with the Yahoo! API
----
Geo-Postcodes-0.03
http://search.cpan.org/~arne/Geo-Postcodes-0.03/
Base class for the Geo::Postcodes::XX modules
----
Geo-Postcodes-DK-0.03
http://search.cpan.org/~arne/Geo-Postcodes-DK-0.03/
Danish postcodes with associated information
----
Geo-Postcodes-NO-0.03
http://search.cpan.org/~arne/Geo-Postcodes-NO-0.03/
Norwegian postcodes with associated information
----
Graph-Easy-0.45
http://search.cpan.org/~tels/Graph-Easy-0.45/
Render graphs as ASCII, HTML, SVG or via Graphviz
----
IO-Socket-SSL-0.994
http://search.cpan.org/~sullr/IO-Socket-SSL-0.994/
Nearly transparent SSL encapsulation for IO::Socket::INET.
----
IPC-System-Simple-0.02
http://search.cpan.org/~pjf/IPC-System-Simple-0.02/
Call system() commands with a minimum of fuss
----
IPC-System-Simple-0.03
http://search.cpan.org/~pjf/IPC-System-Simple-0.03/
Call system() commands with a minimum of fuss
----
Image-Compare-0.2
http://search.cpan.org/~avif/Image-Compare-0.2/
Compare two images in a variety of ways.
----
Image-ExifTool-6.29
http://search.cpan.org/~exiftool/Image-ExifTool-6.29/
Read and write meta information
----
MDV-Distribconf-2.02
http://search.cpan.org/~nanardon/MDV-Distribconf-2.02/
Read and write config of a Mandriva Linux distribution tree
----
Net-DNS-ToolKit-0.29
http://search.cpan.org/~miker/Net-DNS-ToolKit-0.29/
tools for working with DNS packets
----
Net-EPP-Client-0.06
http://search.cpan.org/~gbrown/Net-EPP-Client-0.06/
a client library for the TCP transport for EPP, the Extensible Provisioning Protocol
----
Net-EPP-Frame-0.06
http://search.cpan.org/~gbrown/Net-EPP-Frame-0.06/
An EPP XML frame system built on top of XML::LibXML.
----
POE-Component-IRC-4.97
http://search.cpan.org/~bingos/POE-Component-IRC-4.97/
a fully event-driven IRC client module.
----
Parse-Win32Registry-0.20
http://search.cpan.org/~jmacfarla/Parse-Win32Registry-0.20/
Parse Windows Registry Files
----
Plagger-0.7.4
http://search.cpan.org/~miyagawa/Plagger-0.7.4/
Pluggable RSS/Atom Aggregator
----
SQL-Translator-0.08_01
http://search.cpan.org/~jrobinson/SQL-Translator-0.08_01/
manipulate structured data definitions (SQL and more)
----
Test-Use-0.01
http://search.cpan.org/~ishigaki/Test-Use-0.01/
do use_ok() for all modules MANIFESTed
----
Test-Use-0.02
http://search.cpan.org/~ishigaki/Test-Use-0.02/
do use_ok() for all modules MANIFESTed
----
Time-Duration-1.04
http://search.cpan.org/~avif/Time-Duration-1.04/
rounded or exact English expression of durations
----
WWW-AltaRank-1.00
http://search.cpan.org/~kostya/WWW-AltaRank-1.00/
WebAlta Thematic Index of Citing (TIC) for page
----
Win32-Crypt-0.00_004
http://search.cpan.org/~esskar/Win32-Crypt-0.00_004/
----
XML-Amazon-0.01
http://search.cpan.org/~hedwig/XML-Amazon-0.01/
Perl extension for getting information from Amazon
----
XML-Amazon-0.02
http://search.cpan.org/~hedwig/XML-Amazon-0.02/
Perl extension for getting information from Amazon
----
XML-Atom-0.22
http://search.cpan.org/~miyagawa/XML-Atom-0.22/
Atom feed and API implementation
----
XML-XPathScript-1.44
http://search.cpan.org/~yanick/XML-XPathScript-1.44/
a Perl framework for XML stylesheets
----
mediawiki-graph-0.20
http://search.cpan.org/~tels/mediawiki-graph-0.20/
----
v6-alpha-0.011
http://search.cpan.org/~clkao/v6-alpha-0.011/
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: 24 Jul 2006 21:16:29 -0700
From: "Davy" <zhushenli@gmail.com>
Subject: Pass hash to subroutine?
Message-Id: <1153800989.202955.234960@b28g2000cwb.googlegroups.com>
Hi all,
How to pass hash to subroutine?
And my code list below(it seems the hash has not been passed to sub??):
Code:
#!/usr/local/bin/perl
%mc_mode_hash = ( "00" => "mc_mode_0",
"01" => "mc_mode_1",
"10" => "mc_mode_2");
my $my_cnt = 1;
$my_cnt = &init_cnt_ref(%mc_mode_hash);
print ("my_cnt is $my_cnt \n");
sub init_cnt_ref(\%)
{
#my (%hash0) = %{(shift)};
my %hash0 = %_ ;
my $cnt = 0;
foreach $mc_mode ( values(%hash0))
{
print "mc_mode is $mc_mode \n";
$cnt ++;
}
return $cnt;
}
Thanks!
Davy
------------------------------
Date: Tue, 25 Jul 2006 07:11:13 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Pass hash to subroutine?
Message-Id: <4ilnhgF4arbaU1@individual.net>
Davy wrote:
> How to pass hash to subroutine?
That's a FAQ.
perldoc -q how.+pass.+hash
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 24 Jul 2006 20:04:35 -0700
From: "apersaud" <apersaud@gmail.com>
Subject: Problems handling variable data
Message-Id: <1153796675.406954.204460@i3g2000cwc.googlegroups.com>
Ok, so I have a script that uses Net::SSH::Perl and Net::SFTP. However
if the filenames to be saved on the remote machine is read from a file
(not set internally in the perl code), it doesn't work.
Example:
use Net::SFTP;
my $sftp = Net::SFTP->new($host, %args);
$val = 'mymachine';
$val2 = `hostname`; #or read from a file on the system
chomp $val2;
$sftp->put('/root/'.$val.'.txt','/root/'.$val.'.txt') # works
$sftp->put('/root/'.$val2.'.txt','/root/'.$val2.'.txt') # FAILS
I get a Wide Character problem with HMAC_SHA1 and no files are copied
over. Anyone has any ideas?
------------------------------
Date: 24 Jul 2006 21:50:47 -0700
From: "apersaud" <apersaud@gmail.com>
Subject: Re: Problems handling variable data
Message-Id: <1153803047.721344.27960@m79g2000cwm.googlegroups.com>
I think its a UTF-8 issue... any suggestions?
apersaud wrote:
> Ok, so I have a script that uses Net::SSH::Perl and Net::SFTP. However
> if the filenames to be saved on the remote machine is read from a file
> (not set internally in the perl code), it doesn't work.
>
> Example:
>
> use Net::SFTP;
> my $sftp = Net::SFTP->new($host, %args);
>
> $val = 'mymachine';
> $val2 = `hostname`; #or read from a file on the system
> chomp $val2;
>
> $sftp->put('/root/'.$val.'.txt','/root/'.$val.'.txt') # works
>
> $sftp->put('/root/'.$val2.'.txt','/root/'.$val2.'.txt') # FAILS
>
> I get a Wide Character problem with HMAC_SHA1 and no files are copied
> over. Anyone has any ideas?
------------------------------
Date: Mon, 24 Jul 2006 22:30:58 -0700
From: fishfry <fishfry@your-mailbox.com>
Subject: Re: Software Frameworks
Message-Id: <fishfry-95BD62.22305824072006@comcast.dca.giganews.com>
In article <1153514713.761796.192030@m79g2000cwm.googlegroups.com>,
"skinman" <jmillion@integrity-apps.com> wrote:
> Folks,
>
> I've been writing some Web pages/apps using PERL, PHP4/5, and Java.
> I'm wondering about more template-based systems to keep from
> reinventing
> the wheel. I may just do a few of each style so the next person that
> follows me
> can pick what they like best? If it can be considered a pseudo
> framework, I
> like the PHP5 / PEAR stuff so far - HTML_QuickForm, DB, nice stuff.
> But the
> PERL Mason stuff is looking good too. The more strongly-typed Java
> framework
> things offer some cool out-of-the-box graphics ability (from something
> like SourceForge's EchoPoint) but getting Java Webapps up and running
> is a different animal than the
> PHP and PERL scripting. What have been your experiences with PERL
> Mason?
In my (somewhat limited) experience, the Mason module model doesn't
combined well with object orientation. When you come into a Mason module
your environment is full of global variables from prior modules. It
quickly becomes a mess.
(I'm sure the Mason pros will disagree ... I'm just saying what I've
seen from some passing involvement on a couple of projects).
I like Template Toolkit for separating data from presentation. For
modularity, I like plain old object design.
------------------------------
Date: Tue, 25 Jul 2006 11:02:28 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Use MSXML in perl without registration
Message-Id: <44c56e90$0$1210$afc38c87@news.optusnet.com.au>
"Vinay" <shah.vinay@gmail.com> wrote in message
news:1153782403.410656.21810@75g2000cwc.googlegroups.com...
> I would like to use MSXML4.0 in my perl script, but not have it
> register on my machine. The way to do that is explained for C++ at this
> link:
> http://www.perfectxml.com/articles/msxml/TipsAugust02.asp
> I am finding it difficult to port it over to perl. Anyone has any clue
> for the same? What steps do I need to take?
>
You could use Inline::CPP to run that code from perl .... but only if you
have a C++ compiler.
Otherwise you can use the Win32::API module.
With Win32::API, I envisage that there's no need to call LoadLibrary,
GetProcessAddress, and FreeLibrary. Instead you just access the functions
from the dll directly. (However, I'm not sure if that's correct - given that
you're dealing with COM objects.)
Cheers,
Rob
------------------------------
Date: 24 Jul 2006 20:29:47 -0700
From: "Vinay" <shah.vinay@gmail.com>
Subject: Re: Use MSXML in perl without registration
Message-Id: <1153798187.691092.148320@i42g2000cwa.googlegroups.com>
Thanks Rob.
I checked out Win32::API. It can be used. What I am not sure of is how
does a DLL being a COM object differ the way code is written.
I will look more into using that module, meanwhile if anyone has worked
on COM objects and win32::api can you share some code samples.
Vinay
Sisyphus wrote:
> "Vinay" <shah.vinay@gmail.com> wrote in message
> news:1153782403.410656.21810@75g2000cwc.googlegroups.com...
> > I would like to use MSXML4.0 in my perl script, but not have it
> > register on my machine. The way to do that is explained for C++ at this
> > link:
> > http://www.perfectxml.com/articles/msxml/TipsAugust02.asp
> > I am finding it difficult to port it over to perl. Anyone has any clue
> > for the same? What steps do I need to take?
> >
>
> You could use Inline::CPP to run that code from perl .... but only if you
> have a C++ compiler.
>
> Otherwise you can use the Win32::API module.
>
> With Win32::API, I envisage that there's no need to call LoadLibrary,
> GetProcessAddress, and FreeLibrary. Instead you just access the functions
> from the dll directly. (However, I'm not sure if that's correct - given that
> you're dealing with COM objects.)
>
> Cheers,
> Rob
------------------------------
Date: 24 Jul 2006 22:06:36 -0700
From: "tuser" <tuser3@gmail.com>
Subject: Re: Use MSXML in perl without registration
Message-Id: <1153803996.070061.91630@i3g2000cwc.googlegroups.com>
Vinay wrote:
> I would like to use MSXML4.0 in my perl script, but not have it
> register on my machine. The way to do that is explained for C++ at this
> link:
> http://www.perfectxml.com/articles/msxml/TipsAugust02.asp
> I am finding it difficult to port it over to perl. Anyone has any clue
> for the same? What steps do I need to take?
Have a look at the posting in comp.lang.perl.misc
"Windows ActiveState Perl: MSXML transformNodeToObject finally
succeeded"
Date: 17/02/2006 23:14
http://tinyurl.co.uk/5ljh
------------------------------
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 9520
***************************************