[29619] in Perl-Users-Digest
Perl-Users Digest, Issue: 863 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 19 03:09:43 2007
Date: Wed, 19 Sep 2007 00:09:06 -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, 19 Sep 2007 Volume: 11 Number: 863
Today's topics:
Re: $string =~ /$pattern/i <tadmc@seesig.invalid>
Re: Challenge: CPU-optimized byte-wise or-equals (for a <bik.mido@tiscalinet.it>
Re: Challenge: CPU-optimized byte-wise or-equals (for a <wahab@chemie.uni-halle.de>
Re: Latest spamware here!!!!! <phaywood@alphalink.com.au.NO.SPAM>
Re: looking at parsing procedures <zaxfuuq@invalid.net>
new CPAN modules on Wed Sep 19 2007 (Randal Schwartz)
Perl bot needed the_bot_shopper@yahoo.com
Re: Perl bot needed <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Send Carriage return <njc@cookie.uucp>
turn off special characters in a string wong_powah@yahoo.ca
Re: turn off special characters in a string davidfilmer@gmail.com
Re: turn off special characters in a string <tadmc@seesig.invalid>
Re: turn off special characters in a string <wahab@chemie.uni-halle.de>
Windows: Mapi wrapper to redirect email to a script? jk314@gmx.at
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Sep 2007 21:05:43 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: $string =~ /$pattern/i
Message-Id: <slrnff10vn.g8.tadmc@tadmc30.sbcglobal.net>
Petr Vileta <stoupa@practisoft.cz> wrote:
> Tad McClellan wrote:
>> Petr Vileta <stoupa@practisoft.cz> wrote:
>>> print quotemeta('This is a string');
>>>> This\ is\ a\ string
>>>
>>> By me the space (0x20h) is not need to escape.
>>
>>
>> Errr, then don't call quotemeta on it!
>
> This was be an example. In real script I mean something like
> my $variable = myfunction(quotemeta($ARGV[0]));
>
> where myfunction() need to get escaped string as parameter but escaped space
> is nonsese.
> Now I realise it as
> my $arg = quotemeta($ARGV[0]);
> $arg =~ s/\\\x20/ /g;
> my $variable = myfunction($arg);
>
> Know you better way?
Sure. The first sentence of its documentation says:
Returns the value of EXPR with all non-"word" characters backslashed.
If you want all non-"word" characters except space backslashed,
then write a s/// that does that instead:
$arg =~ s/([^\w ])/\\$1/g;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 19 Sep 2007 00:26:43 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <10k0f3lbn1lvo1pfn5hb042rv1jnjutj8q@4ax.com>
On Tue, 18 Sep 2007 23:11:59 +0200, Mirco Wahab
<wahab@chemie.uni-halle.de> wrote:
>OK, I figured out this part too, so (FWIW) I'll
>post it. How's that appliable to the PerlMonks
>contest? I don't really know (maybe somebody has a hint).
If you don't mind (see the discussion at another part of this thread)
I can report your solution there. Even though the "contest" is now
closed, it would be good (IMHO) for completeness. Or else you can do
so yourself, even as an anonymous poster if you like.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Tue, 18 Sep 2007 23:11:59 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <fcpev0$o55$1@nserver.hrz.tu-freiberg.de>
Mirco Wahab wrote:
> ... but will eventually produce the gcc/as/unix variant.
OK, I figured out this part too, so (FWIW) I'll
post it. How's that appliable to the PerlMonks
contest? I don't really know (maybe somebody has a hint).
[start here]
...
use Inline C => qq{
// ==> inline
void by_asm(SV* no_zeros, SV* has_zeros)
{
STRLEN srclen, dstlen;
char *src = SvPV(SvRV(no_zeros), srclen);
char *dst = SvPV(SvRV(has_zeros), dstlen);
if( srclen < dstlen ) croak("block length mismatch!");
#ifdef _MSC_VER
_asm mov edi, dst
_asm mov esi, src
_asm mov ecx, dstlen
_asm xor eax, eax
_asm cld
start:
_asm repne scasb
_asm jne done
_asm mov edx, dstlen
_asm sub edx, ecx
_asm mov ah, byte ptr [-1+esi+edx]
_asm mov byte ptr [-1+edi], ah
_asm jmp start
done: ;
#else
__asm__ __volatile__(
"xorl %%eax, %%eax \\n\\t"
"cld \\n\\t"
"start: \\n\\t"
"repne \\n\\t"
"scasb \\n\\t"
"jne done \\n\\t"
"movl %[l], %%edx \\n\\t"
"subl %%ecx, %%edx \\n\\t"
"movb -1(%%esi,%%edx), %%ah \\n\\t"
"movb %%ah, -1(%%edi) \\n\\t"
"jmp start \\n\\t"
"done: \\n\\t"
: /* no output reg */
: "S"(src),"D"(dst),"c"(dstlen),[l]"m"(dstlen)
);
#endif
}
// <== inline
};
my $s_no_zeros = 'abcdefghijklmnopqrstuvwxyz';
my $s_has_zeros = 'abcdefghijklmnopqrstuvwxyz';
substr($s_has_zeros, 5, 1) = "\x0";
substr($s_has_zeros, -1, 1) = "\x0";
by_asm(\$s_no_zeros, \$s_has_zeros);
print "$s_no_zeros\n$s_has_zeros\n";
[end here]
Regards
M.
------------------------------
Date: Tue, 18 Sep 2007 20:14:49 +1000
From: Peter 'Shaggy' Haywood <phaywood@alphalink.com.au.NO.SPAM>
Subject: Re: Latest spamware here!!!!!
Message-Id: <q1l4s4-4di.ln1@dead.foo>
Groovy hepcat DA Morgan was jivin' in comp.lang.c on Sun, 16 Sep 2007
5:59 am. It's a cool scene! Dig it.
> freespamwareweb666@gmail.com wrote:
>> http://xxxxxxxxxxxxx.xxxxxxxx.xxx/
>
> Thank you you pathetic spammer. I don't know what we would do if
> it weren't for self-serving spammers.
You dope! You just reposted the spammer's URL and annoyed the other
participants of not one but four newsgroups. I couldn't even see the
original spam. I had it killfiled. Your post defeated the purpose.
Please, do *not* followup to spam or trolls. Just quietly file an
abuse report. And if you absolutely *must* quote any of the original
post, delete or mung the spam URL so as not to help the blithering
moron who posted it in the first place.
--
Dig the sig!
----------- Peter 'Shaggy' Haywood ------------
Ain't I'm a dawg!!
------------------------------
Date: Tue, 18 Sep 2007 23:25:01 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: looking at parsing procedures
Message-Id: <O4-dncwwILFfL23bnZ2dnUVZ_rSinZ2d@comcast.com>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:v96ve3190qo083jkl2trbp4v9q3ob6kh5s@4ax.com...
> On Mon, 17 Sep 2007 23:02:34 -0700, "Wade Ward" <zaxfuuq@invalid.net>
> wrote:
>
>>I've got backlash syndrom. After looking at linux and windows for twenty
>
> Please try to quote properly. It's getting increasingly difficult to
> reply to your posts. I had written:
>
> : >How do I test the subject line to see whether 'Solaris' occurs?
> :
> : /Solaris/
>
> Then you go on:
>
>>years my chance of getting one or the other is fifty fifty, when the
>>difference matters.
>>
>
>
> I just meant that if $str is your string then to test whether it
> contains "Solaris" you can do
>
> if ($str =~ /Solaris/) { ... }
>
> If the string is in $_ you can just do
>
> if (/Solaris/) { ... }
>
> Or else you can use the specialized index() function about which you
> can read in
>
> perldoc -f index
>
> But *IIRC* the regex engine optimizes the above match to index()
> anyway.
>
>>So one indicates a string literal by bracketing with backslash?
>
> Huh?!? No, one specifies a literal string with the q() and qq()
> operators, commonly disguised as '' and "" respectively. Instead you
> can use the m() match operator to check for a pattern which needs not
> be a literal string, but if it is (i.e. it contains no metacharachters
> having a special meaning in regexen) then it is treated as a pattern
> as well. If you use forward slashes as delimiters, then you can omit
> the "m".
>
> At this point I strongly recommend you to carefully read the "Quote
> and Quote-like Operators" section in
>
> perldoc perlop
>
>
I'll take a look tomorrow. I can't wait to get a printer. I'm gonna spend
a hundred bucks on the best perl reference. Ques que say?
--
Wade Ward
wade@zaxfuuq.net
"I ain't got time to bleed."
------------------------------
Date: Wed, 19 Sep 2007 04:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Sep 19 2007
Message-Id: <JoLMEH.CDG@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-Siteswap-0.02
http://search.cpan.org/~lukec/Acme-Siteswap-0.02/
Provide information about Juggling Siteswap patterns
----
Acme-Siteswap-0.03
http://search.cpan.org/~lukec/Acme-Siteswap-0.03/
Provide information about Juggling Siteswap patterns
----
Algorithm-Dependency-Objects-0.03
http://search.cpan.org/~nuffin/Algorithm-Dependency-Objects-0.03/
An implementation of an Object Dependency Algorithm
----
Angerwhale-0.06
http://search.cpan.org/~jrockway/Angerwhale-0.06/
filesystem-based blog with integrated cryptography
----
Atompub-0.1.5
http://search.cpan.org/~takeru/Atompub-0.1.5/
Atom Publishing Protocol implementation
----
CGI-Auth-Auto-1.17
http://search.cpan.org/~leocharre/CGI-Auth-Auto-1.17/
Automatic authentication maintenance and persistence for cgi scrips.
----
CGI-Multiscript-0.74
http://search.cpan.org/~morgothii/CGI-Multiscript-0.74/
Perl extension for Multiscript programming
----
Catalyst-Controller-Atompub-0.1.4
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.1.4/
A Catalyst controller for the Atom Publishing Protocol
----
Catalyst-Plugin-Apoptosis-0.00002
http://search.cpan.org/~dmaki/Catalyst-Plugin-Apoptosis-0.00002/
Stop Execution Of A Catalyst App
----
Catalyst-Plugin-ConfigLoader-Remote-0.01
http://search.cpan.org/~jshirley/Catalyst-Plugin-ConfigLoader-Remote-0.01/
Load (remote) URIs into config
----
Color-Library-0.011
http://search.cpan.org/~rkrimen/Color-Library-0.011/
An easy-to-use and comprehensive named-color library
----
Config-PackageGlobal-OO-0.02
http://search.cpan.org/~nuffin/Config-PackageGlobal-OO-0.02/
A generic configuration object for modules with package global configuration
----
Data-Validate-Japanese-0.01001
http://search.cpan.org/~dmaki/Data-Validate-Japanese-0.01001/
Validate Japanese Input
----
Devel-PerlySense-0.01_21
http://search.cpan.org/~johanl/Devel-PerlySense-0.01_21/
IntelliSense for Perl
----
Email-Send-2.190
http://search.cpan.org/~rjbs/Email-Send-2.190/
Simply Sending Email
----
Email-Send-IO-2.200
http://search.cpan.org/~rjbs/Email-Send-IO-2.200/
Send messages using IO operations
----
Filter-CBC-0.10
http://search.cpan.org/~beatnik/Filter-CBC-0.10/
Source filter for Cipher Block Chaining
----
FormValidator-Simple-Plugin-Math-0.01
http://search.cpan.org/~hedwig/FormValidator-Simple-Plugin-Math-0.01/
----
GRID-Machine-0.080
http://search.cpan.org/~casiano/GRID-Machine-0.080/
Remote Procedure Calls over a SSH link
----
HTML-FromANSI-2.00
http://search.cpan.org/~nuffin/HTML-FromANSI-2.00/
Mark up ANSI sequences as HTML
----
LEOCHARRE-CLI-1.09
http://search.cpan.org/~leocharre/LEOCHARRE-CLI-1.09/
useful subs for coding cli scripts
----
Math-Expression-Evaluator-0.0.3
http://search.cpan.org/~moritz/Math-Expression-Evaluator-0.0.3/
parses and evaluates mathematic expressions
----
Module-Build-PM_Filter-0.9.2
http://search.cpan.org/~vmoral/Module-Build-PM_Filter-0.9.2/
Add a PM_Filter feature to Module::Build
----
Module-Build-PM_Filter-1.0.0
http://search.cpan.org/~vmoral/Module-Build-PM_Filter-1.0.0/
Add a PM_Filter feature to Module::Build
----
MojoMojo-0.999004
http://search.cpan.org/~mramberg/MojoMojo-0.999004/
A Catalyst & DBIx::Class powered Wiki.
----
MojoMojo-0.999005
http://search.cpan.org/~mramberg/MojoMojo-0.999005/
A Catalyst & DBIx::Class powered Wiki.
----
MooseX-Workers-0.01
http://search.cpan.org/~perigrin/MooseX-Workers-0.01/
Provides a simple sub-process management for asynchronous tasks.
----
Net-SIP-0.35
http://search.cpan.org/~sullr/Net-SIP-0.35/
Framework SIP (Voice Over IP, RFC3261)
----
Net-sFlow-0.07
http://search.cpan.org/~elisa/Net-sFlow-0.07/
decode sFlow datagrams
----
NetSNMP-ASN-5.0401
http://search.cpan.org/~hardaker/NetSNMP-ASN-5.0401/
Perl extension for SNMP ASN.1 types
----
NetSNMP-OID-5.0401
http://search.cpan.org/~hardaker/NetSNMP-OID-5.0401/
Perl extension for manipulating OIDs
----
NetSNMP-TrapReceiver-5.0401
http://search.cpan.org/~hardaker/NetSNMP-TrapReceiver-5.0401/
Embedded perl trap handling for Net-SNMP's snmptrapd
----
NetSNMP-agent-5.0401
http://search.cpan.org/~hardaker/NetSNMP-agent-5.0401/
Perl extension for the net-snmp agent.
----
NetSNMP-default_store-5.0401
http://search.cpan.org/~hardaker/NetSNMP-default_store-5.0401/
Perl extension for Net-SNMP generic storage of global data
----
Puppet-VcsTools-File-1.004
http://search.cpan.org/~ddumont/Puppet-VcsTools-File-1.004/
Tk GUI for VCS file management
----
SNMP-5.0401
http://search.cpan.org/~hardaker/SNMP-5.0401/
The Perl5 'SNMP' Extension Module for the Net-SNMP SNMP package.
----
Slay-Makefile-0.07
http://search.cpan.org/~nodine/Slay-Makefile-0.07/
Wrapper to Slay::Maker that reads the rules from a file
----
Slay-Makefile-0.08
http://search.cpan.org/~nodine/Slay-Makefile-0.08/
Wrapper to Slay::Maker that reads the rules from a file
----
Template-Declare-Anon-0.02
http://search.cpan.org/~nuffin/Template-Declare-Anon-0.02/
Anonymous Template::Declare templates
----
Term-VT102-Boundless-0.02
http://search.cpan.org/~nuffin/Term-VT102-Boundless-0.02/
A Term::VT102 that grows automatically to accomodate whatever you print to it.
----
WWW-ConfixxBackup-0.07
http://search.cpan.org/~reneeb/WWW-ConfixxBackup-0.07/
Create Backups with Confixx and download them via FTP
----
WWW-Mechanize-1.31_01
http://search.cpan.org/~petdance/WWW-Mechanize-1.31_01/
Handy web browsing in a Perl object
----
WWW-Mechanize-Pluggable-1.03
http://search.cpan.org/~mcmahon/WWW-Mechanize-Pluggable-1.03/
custmomizable via plugins
----
WWW-Mechanize-Plugin-Cache-0.05
http://search.cpan.org/~mcmahon/WWW-Mechanize-Plugin-Cache-0.05/
Automatic request caching for WWW::Mechanize::Pluggable
----
WWW-Myspace-0.71
http://search.cpan.org/~grantg/WWW-Myspace-0.71/
Access MySpace.com profile information from Perl
----
WWW-Myspace-Data-0.15
http://search.cpan.org/~oalders/WWW-Myspace-Data-0.15/
WWW::Myspace database interaction
----
WWW-Myspace-FriendAdder-0.14
http://search.cpan.org/~oalders/WWW-Myspace-FriendAdder-0.14/
Interactively add friends to your Myspace account
----
WWW-Scraper-ISBN-AmazonDE_Driver-0.02
http://search.cpan.org/~reneeb/WWW-Scraper-ISBN-AmazonDE_Driver-0.02/
Search driver for the (DE) Amazon online catalog.
----
Win32-Process-Info-1.010
http://search.cpan.org/~wyant/Win32-Process-Info-1.010/
Provide process information for Windows 32 systems.
----
XML-Atom-Service-0.15.3
http://search.cpan.org/~takeru/XML-Atom-Service-0.15.3/
Atom Service Document object
----
XML-Atom-Service-0.15.4
http://search.cpan.org/~takeru/XML-Atom-Service-0.15.4/
Atom Service Document object
----
XML-SAX-Expat-Incremental-0.05
http://search.cpan.org/~nuffin/XML-SAX-Expat-Incremental-0.05/
XML::SAX::Expat subclass for non-blocking (incremental) parsing, with XML::Parser::ExpatNB.
----
libmodule-build-pm-filter-perl_0.9.2
http://search.cpan.org/~vmoral/libmodule-build-pm-filter-perl_0.9.2/
----
parrot-0.4.16
http://search.cpan.org/~particle/parrot-0.4.16/
----
threads-1.67
http://search.cpan.org/~jdhedden/threads-1.67/
Perl interpreter-based threads
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: Tue, 18 Sep 2007 13:22:32 -0700
From: the_bot_shopper@yahoo.com
Subject: Perl bot needed
Message-Id: <1190146952.422530.107690@n39g2000hsh.googlegroups.com>
Unusual application. Email me for details if you are an expert
botbuilder.
Thanks
------------------------------
Date: Tue, 18 Sep 2007 13:53:08 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Perl bot needed
Message-Id: <leq5s4xj26.ln2@goaway.wombat.san-francisco.ca.us>
On 2007-09-18, the_bot_shopper@yahoo.com <the_bot_shopper@yahoo.com> wrote:
> Unusual application. Email me for details if you are an expert
> botbuilder.
I nominate this post for worst clpmisc post this year. It's awful on so
many levels:
--job posting in a non-jobs group
--no example code, specification, or example data
--writing a bot?!?
--''unusual application''?!??!?
--requests responses via email
If the OP is still reading this newsgroup, I suggest you address the
above issues before you post again.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: Tue, 18 Sep 2007 18:05:56 -0500
From: Neil Cherry <njc@cookie.uucp>
Subject: Re: Send Carriage return
Message-Id: <slrnff0mek.dlv.njc@cookie.uucp>
On Mon, 17 Sep 2007 02:01:26 -0000, 280SEL wrote:
> Hello:
>
> I hope that someone can set me on the right track with this:
>
> I am trying to establish a Heartbeat with a remote machine using Perl.
> I am sending a string like so:
>
> print $socket "$output";
>
> In order to keep the line open, the remote machine wants a carriage
> return at the end (HEX 0D).
>
> I have tried the perl \n, I have tried all kinds of ways , including:
>
> $output=$string.hex'0D';
> print $socket "$output";
>
> This, of course, translates the hex carriage return into Decimal 13
> and sends that number which doesn't help.
>
> Does anybody know how to do this?
>
> Any help would be greatly appreciated!
>
To send a 0x0D try using \r
Also it is common for network communications to use \r\n as the line
ending. You may not need it but it's a thought.
--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
Author of: Linux Smart Homes For Dummies
------------------------------
Date: Tue, 18 Sep 2007 14:22:46 -0700
From: wong_powah@yahoo.ca
Subject: turn off special characters in a string
Message-Id: <1190150566.038724.36690@d55g2000hsg.googlegroups.com>
My string has special characters '@' and '$'.
How to escape them (turn them off)?
e.g.
$newpw is entered as "1q@W3e$R";
chop($newpw = <STDIN>);
system("changepw -newpw \"$newpw\" -oldpw \"$oldpw\" \n\");
$newpw becomes "1q@W3e" (the "$R" is chopped).
------------------------------
Date: Tue, 18 Sep 2007 22:01:27 -0000
From: davidfilmer@gmail.com
Subject: Re: turn off special characters in a string
Message-Id: <1190152887.889728.212120@v23g2000prn.googlegroups.com>
On Sep 18, 2:22 pm, wong_po...@yahoo.ca wrote:
> My string has special characters '@' and '$'.
> How to escape them (turn them off)?
> e.g.
> $newpw is entered as "1q@W3e$R";
>
> chop($newpw = <STDIN>);
> system("changepw -newpw \"$newpw\" -oldpw \"$oldpw\" \n\");
>
> $newpw becomes "1q@W3e" (the "$R" is chopped).
perldoc -f quotemeta
FWIW, You probably want to use backticks instead of system(), and you
should check your return code.
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Tue, 18 Sep 2007 21:11:24 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: turn off special characters in a string
Message-Id: <slrnff11ac.g8.tadmc@tadmc30.sbcglobal.net>
wong_powah@yahoo.ca <wong_powah@yahoo.ca> wrote:
> chop($newpw = <STDIN>);
You should use chomp() to remove newlines nowadays.
Using chop() to remove newlines was how it was done 10 years ago.
Where are you learning your Perl from?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 19 Sep 2007 08:39:41 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: turn off special characters in a string
Message-Id: <fcqg7d$11e2$1@nserver.hrz.tu-freiberg.de>
wong_powah@yahoo.ca wrote:
> My string has special characters '@' and '$'.
> How to escape them (turn them off)?
> $newpw is entered as "1q@W3e$R";
> chop($newpw = <STDIN>);
> system("changepw -newpw \"$newpw\" -oldpw \"$oldpw\" \n\");
> $newpw becomes "1q@W3e" (the "$R" is chopped).
This would normally not happen. I don't know
what you did else, but maybe your "quoting interpolation"
will happen only in your "test example", see:
...
my $command = 'echo'; # change this to 'changepw'
my $oldpw = '1q@W3e$Q' . "\n"; # this is how input would come from
my $newpw = '1q@W3e$R' . "\n"; # outside (note the '' quote chars!)
chomp $oldpw; # don't use chop(), always use chomp()
chomp $newpw; # if possible (as Tad already said)
# use the qq{ .. } operator to evade quote masking errors
system qq{ $command -newpw "$newpw" -oldpw "$oldpw" };
...
If your program is larger, put a
use strict;
use warnings;
...
on top of it and Perl will tell you where
unwanted interpolation might happen.
Regards
M.
------------------------------
Date: Tue, 18 Sep 2007 14:59:25 -0700
From: jk314@gmx.at
Subject: Windows: Mapi wrapper to redirect email to a script?
Message-Id: <1190152765.221332.270600@y42g2000hsy.googlegroups.com>
Hi.
I have a scanner with a scanning software that has a "scan to email"
button, that opens a mapi email client (e.g. outlook express) and
attaches the scanned file.
What I would like instead is a "scan to script" button (after the
scan, a (perl/bash/python...) script X is run with
the name of the scanned file as parameter).
So I thought I could "program" my own MAPI mail client in perl (as
outlook express substitute) that does
nothing but runs program X. However, the whole mapi business seems a
bit tiresome.
So my question: does there already exist a nice mapi "wrapper", that
can be registered as mapi
email client in windows XP (so that I can later select it as email
client in the scan software) and that does basically nothing (in my
case, just decode the attachment information and then run an external
program X with the
attachement file name as parameter)?
I could imagine that such a wrapper is quite complicated if it has to
comply with all possible mapi scenarios, but I would be quite happy
with a mapi wrapper that just works in the scenario mentiones, it can
just produce error codes in all other cases (e.g. if another program
requests the address book or whatever else mapi was made for).
Thanks,
Jakob
------------------------------
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 863
**************************************