[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Oneliner problems?



At 23.23 -0500 1999.01.04, Ronald J. Kimball wrote:
>Larry F. Allen-Tonar wrote:
>>
>> David,
>>
>> Since I don't see the usual helpful replies, I'll chip in an answer:
>>
>> In the one-liner dialog window, try typing in:
>>
>>     perl -w -e 'print "It truly works.\\n";'
>> (             ^ There is an obnoxious complaint if this space is missing  .)
>>
>> The 'idea' of one-liners is to be able to type in the same
>>obnoxiously-quoted
>> and back-slash-doubled PERL one-line command needed for a UNIX shell
>> and have it executed similarly by MacPerl.
>>
>
>But in a Unix shell I would have typed:
>
>perl -w -e 'print "It truly works.\n";'
>
>without the extra backslash before the 'n'.  Why do you say that the
>backslashes need to be doubled??  If it's not a bug in MacPerl, it's at
>least rather counter-intuitive.  (The above line doesn't give any output at
>all when run from the OneLiner dialog.)

I don't know why exactly, but it has something to do with the fact that
this text is being interpolated multiple times.

You all might want to try adding this line to the file ":MacPerl
Scripts:One Liner/1":

  $line =~ s/\\/\\\\/g;

Add it right after $line is first assigned to.  This will double-backslash
all the backslashes for you.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch