develooper Front page | perl.perl6.language | Postings from April 2005

-X's auto-(un)quoting?

Thread Next
Michele Dondi
April 21, 2005 01:18
-X's auto-(un)quoting?
Message ID:
Are the -X functions still going to be there? I definitely hope so! 
However, to come to the actual question, it has happened to me to have to 
do, in perl5 that is:

perl -lne 's/^"//;s/"$//;print if -e'

or (less often)

perl -lne '$o=$_;s/^"//;s/"$//;print $o if -e'

Ok: no much harm done (to my fingertips). But then, talking about 
huffmanization, could a standard adverb be provided for -X's to the effect 
of specifying that the passed filename is quoted, say in double (or if 
sensible in single) quotes: for I find that to be a common filelist 
"format". Ideally, what I'd like to do is

perl -lne 'print if -e :q'

Mary had a little lamb;/Its fleece was green as limes.
And every even number greater than two/Is the sum of two primes.
- Robert Israel in sci.math, "Re: all math problems reduce to linguistics"

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About