[26768] in Perl-Users-Digest
Perl-Users Digest, Issue: 8838 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 7 14:05:26 2006
Date: Sat, 7 Jan 2006 11:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 7 Jan 2006 Volume: 10 Number: 8838
Today's topics:
Re: FAQ 6.5 How do I substitute case insensitively on t <brian.d.foy@gmail.com>
Re: FAQ 6.5 How do I substitute case insensitively on t <flavell@ph.gla.ac.uk>
Re: globbing files with spaces in the path <usenet739_yahoo_com_au>
Re: globbing files with spaces in the path <news@lawshouse.org>
Re: How to get image size in these conditions ? <.@.>
Re: revised comp.lang.perl.misc charter <matthew.garrish@sympatico.ca>
Re: system calls (mv + grep) within Perl script <tassilo.von.parseval@rwth-aachen.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 07 Jan 2006 09:37:51 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.5 How do I substitute case insensitively on the LHS while preserving case on the RHS?
Message-Id: <070120060937510660%brian.d.foy@gmail.com>
In article <Xns974356229C46Debohlmanomsdevcom@130.133.1.4>, Eric
Bohlman <ebohlman@omsdev.com> wrote:
> PerlFAQ Server <comdog@pair.com> wrote in
> news:dplip6$gvr$1@reader2.panix.com:
>
> > 6.5: How do I substitute case insensitively on the LHS while
> > preserving case on the RHS?
> > Here's a lovely Perlish solution by Larry Rosler. It exploits
> > properties of bitwise xor on ASCII strings.
> Given that Perl now supports Unicode, do we really still want to be
> offering something that works only for ASCII as the first option?
No, we don't want to give examples only for ASCII. Anyone have a
better example I can put in there?
------------------------------
Date: Sat, 7 Jan 2006 15:11:17 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: FAQ 6.5 How do I substitute case insensitively on the LHS while preserving case on the RHS?
Message-Id: <Pine.LNX.4.62.0601071459230.5696@ppepc70.ph.gla.ac.uk>
On Sat, 7 Jan 2006, brian d foy wrote:
> > Given that Perl now supports Unicode, do we really still want to be
> > offering something that works only for ASCII as the first option?
>
> No, we don't want to give examples only for ASCII. Anyone have a
> better example I can put in there?
I'm sorry to have to say that I think that opens a large can of worms.
There's a whole Unicode technical report on Unicode regular
expressions, which includes consideration of case sensitivity:
http://www.unicode.org/reports/tr18/
See specifically
http://www.unicode.org/reports/tr18/#Default_Loose_Matches
For example, the upper-case version of the German sharp-s character
"ß" is two characters, "SS".
If case-folding is *really* required to work for Unicode, then I think
the only viable answer is to tell them to use the implemented Unicode
features, and refer to perldoc perlunicode etc. to understand what
they are - which will of course seem inefficient compared to
ASCII-based bit-spinning, but c'est la vie.
If they can define their problem more restrictively, then it's
possible that a bit-spinning approach could still be viable. But it
wouldn't be Unicode.
Best I can tell, anyway.
------------------------------
Date: Sat, 7 Jan 2006 23:58:22 +1100
From: "Scott Bass" <usenet739_yahoo_com_au>
Subject: Re: globbing files with spaces in the path
Message-Id: <43bfbaf2$0$15758$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
"Henry Law" <news@lawshouse.org> wrote in message
news:1136628950.2168.0@doris.uk.clara.net...
> Scott Bass wrote:
>
>> Lastly, I want to configure this script as a custom action in Windows
>> Explorer (say I call it "Batch Submit"), such that RMB --> "Batch Submit"
>
> I'm looking forward to someone showing me what I missed (well, sort of ..)
> but my experience of these context menu actions is that you have to code
> them as perlSCRIPT, which is different from Perl. For example @ARGV
> doesn't work - it's empty as I remember - and you have to code
>
>> my $args = $WScript->Arguments;
>
> ... and then process $args->Arguments as an array. I couldn't find a way
> of running Perl debug on these perlscripts either; had to code dozens of
> $WScript->Echo("Such-and-such is happening") lines and dismiss dozens of
> message boxes.
>
> It's been a while since I tangled with it.
>
> --
>
> Henry Law <>< Manchester, England
Hi Henry,
I created this script as a POC (using pl2bat; Windows Explorer does not
accept a .pl file as a valid action):
@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!perl
# set pragmas
use strict;
use warnings;
# include desired modules
use Getopt::Long;
use File::Basename;
use File::Glob ':glob';
# glob files specified on the command line
my @files;
while (@ARGV) {
push @files, bsd_glob(shift @ARGV);
}
# process each file
my ($dirname, $basename);
while (@files) {
$_ = shift @files;
$basename = basename($_);
$dirname = dirname($_);
chdir($dirname);
open(FH,$basename);
while(<FH>) {
print;
}
close(FH);
}
__END__
:endofperl
pause;
In Windows Explorer, for the file type in question, I created this new
action:
"C:\Documents and Settings\Scott Bass\My Documents\My Perl
Scripts\test8.bat" "%1"
When I RMB on the file in question and select this action, the contents of
the file are printed to the cmd window. So I would think this would work
fine with my final application.
This under Windows XP.
Regards,
Scott
------------------------------
Date: Sat, 07 Jan 2006 13:39:22 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: globbing files with spaces in the path
Message-Id: <1136641162.3619.0@dyke.uk.clara.net>
Scott Bass wrote:
> "Henry Law" <news@lawshouse.org> wrote in message
>>I'm looking forward to someone showing me what I missed (well, sort of ..)
>>but my experience of these context menu actions is that you have to code
>>them as perlSCRIPT, which is different from Perl. For example @ARGV
>>doesn't work - it's empty as I remember - and you have to code
> I created this script as a POC (using pl2bat; Windows Explorer does not
> accept a .pl file as a valid action):
>
> @rem = '--*-Perl-*--
> @echo off
> if "%OS%" == "Windows_NT" goto WinNT
> perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
> goto endofperl
> :WinNT
> perl -x -S %0 %*
> if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
> if %errorlevel% == 9009 echo You do not have Perl in your PATH.
> if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
> goto endofperl
> @rem ';
> #!perl
>
> # set pragmas
... etc for the rest of the Perl program
Isn't it wonderful how newsgroups work. I joined in here to try to help
you out, and end up learning from you something I had overlooked -
pl2bat and this "perl -x" stuff. Thanks! Now I can go re-write my
perlscript thing in a much more elegant manner.
--
Henry Law <>< Manchester, England
------------------------------
Date: Sat, 7 Jan 2006 14:00:59 +0100
From: BlinKol <.@.>
Subject: Re: How to get image size in these conditions ?
Message-Id: <MPG.1e29d9f33ffe7dd6989732@news.tiscali.fr>
In article <060120061016381235%jgibson@mail.arc.nasa.gov>,
jgibson@mail.arc.nasa.gov says...
> See the instructions given by 'perldoc -q "own module"'.
>
OK, thanks a lot
------------------------------
Date: Sat, 7 Jan 2006 11:28:02 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: revised comp.lang.perl.misc charter
Message-Id: <m_Rvf.42122$X25.1204504@news20.bellglobal.com>
#randsent<moderator@comp.lang.perl.misc> wrote in message
news:0f7503c7.8ef66ec6@comp.lang.perl.misc...
> You won't weigh me stoping near your proud tower.
Wow, we got a moderator and a charter all in one email! I guess this person
doesn't understand that social engineering has to be believable in order to
work...
Matt
------------------------------
Date: Sat, 7 Jan 2006 12:18:49 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: system calls (mv + grep) within Perl script
Message-Id: <429mcrF1fo6eoU1@news.dfncis.de>
Also sprach Tad McClellan:
> William <wh2leung@student.cs.uwaterloo.ca> wrote:
>
>
>> Subject: system calls (mv + grep) within Perl script
>
>
> There is no "mv" anywhere in your article.
>
> It there had been, then I would have pointed you to:
>
> perldoc rename
>
> but you didn't, so I won't.
And if you had had the intention to point him to rename(), you would
have written
perldoc -f rename
instead, right? ;-)
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
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 8838
***************************************