LOL++ (Re: OT: It's arrived!)

Matt Lawrence matt.lawrence at virgin.net
Fri Nov 9 12:20:00 GMT 2007


Aaron Crane wrote:
> Jonathan Stowe writes:
>   
>> Yes but anyone who has tried running perl one-liners more than once
>> will have been annoyed by this and would have switched off shell
>> history expansion, like, you know, years ago.
>>     
>
> I don't find that.  Using shell double-quotes for Perl one-liners is
> painful, because $ is meaningful inside shell double-quotes.  That's
> easily solved by using shell single-quotes -- but history expansion
> doesn't apply in shell single-quotes, so the two don't conflict.
>
>   
I habitually use single quotes for one-liners, so I always get caught
out if I have the misfortune to be using Windows' excuse for a shell, in
which the only quote character is "

> perl -le 'print "Hello World"'
Can't find string terminator "'" anywhere before EOF at -e line 1.

Quite annoying, but at least you don't have to worry about variable
expansion most of the time as it's impossible (AFAIK) to escape it in
any way.


Matt



More information about the london.pm mailing list