Hi,
I also see the details related to shell / cmd quoting, but I would also try to 
go deeper to understand what is internally happening.
Is shell running perl , preparing the argument and so needing to follow its way 
to set arguments? The argument to -e is somehow special because of spaces? 
About Ubuntu I got the same result. 
-- 

Fabio D'Alfonso
'Enabling Business Through IT'
cell. +39.348.059.40.22 *
web: http://www.fabiodalfonso.com
email: [email protected]
twitter: http://www.twitter.com/fabio_dalfonso
linkedin: http://it.linkedin.com/in/fabiodalfonso
fax: +39.06.874.599.581
BlackBerry® Wireless Enabled Address.


* Hidden numbers are automatically rejected by the phone

-----Original Message-----
From: David Mertens <[email protected]>
Date: Mon, 18 Jun 2012 16:11:51 
To: <[email protected]>
Cc: [email protected]<[email protected]>
Subject: Re: [Perldl] Fwd: B:Deparse " or ' ?

Fabio -

What I meant is that it looks like you have command-line quoting issues,
not Perl parsing issues. The easiest way to check this is to create a
script, thereby avoiding the command-line quoting. Then, move material out
of the script and onto the command-line. For me, I used this:

__test__
$w = $x || $y or $z;
__END__

Then at the command line:

> perl -MO=Deparse test.pl
$z unless $w = $x || $y;
test.pl syntax OK

OK, so it looks like there is no syntax error. Let's try the whole thing on
the command line:
> perl -MO=Deparse -e'$w = $x || $y or $z'
$z unless $w = $x || $y;
-e syntax OK

So far so good. And double-quotes?
> perl -MO=Deparse -e"$w = $x || $y or $z"
syntax error at -e line 1, near "="
-e had compilation errors.

Hmm. Looks like Ubuntu doesn't properly handle the double quoting. That's
pretty strange. Let's try and see what Ubuntu sends to perl by wrapping
everything in Perly quotes:
> perl -MO=Deparse -e"print q{$w = $x || $y or $z}"
print ' =  ||  or ';
-e syntax OK

So in Ubuntu (10.10 here), THE SHELL interpolates dollar-sign tokens in
double-quoted strings, but not single-quote strings. Huh. Who knew?

Hope that helps!

David

On Mon, Jun 18, 2012 at 3:07 PM, Fabio D'Alfonso <
[email protected]> wrote:

>  Hi,
> I was wondering if you were asking about putting the Deparse in a use
> directive.
>
> In that case the syntax is quite different, and if that was the question I
> will make some extensive work on Deparse tomorrow and so I would be able to
> go back and forth.
>
>
>  Fabio D'Alfonso
> 'Enabling Business Through IT'
> cell.  +39.348.059.40.22 ***
> web: www.fabiodalfonso.com
> email: [email protected]
> linkedin: 
> www.linkedin.com/in/fabiodalfonso<http://it.linkedin.com/in/fabiodalfonso>
> twitter: 
> www.twitter.com/#!/fabio_dalfonso<http://www.twitter.com/#%21/fabio_dalfonso>
>
> fax: +39.06.874.599.581
> BlackBerry® Wireless Enabled Address.
>  ** Hidden  numbers are automatically rejected by the phone*
>  On 6/18/2012 8:01 PM, David Mertens wrote:
>
> Almost certainly this is due to quoting mechanisms on the command line. I
> have not had trouble with pipes, so I'm not quite sure what's going on
> here, but I have had trouble with exclamation points. What happens if you
> put the code in a file and execute that file?
>
> David
>
> On Mon, Jun 18, 2012 at 12:48 PM, Fabio D'Alfonso <
> [email protected]> wrote:
>
>> Sorry:
>> The " is on ActiveState 5.14.2 while as written before the ' is on Ubuntu
>> 11.04.
>>
>>
>> Fabio D'Alfonso
>> 'Enabling Business Through IT'
>> cell.  +39.348.059.40.22 ***
>> web: www.fabiodalfonso.com <http://www.fabiodalfonso.com/>
>> email: [email protected]
>> <mailto:[email protected]>linkedin:
>> www.linkedin.com/in/fabiodalfonso <
>> http://it.linkedin.com/in/fabiodalfonso>
>> twitter: 
>> www.twitter.com/#!/fabio_dalfonso<http://www.twitter.com/#%21/fabio_dalfonso><
>> http://www.twitter.com/#%21/fabio_dalfonso>
>>
>> fax: +39.06.874.599.581
>> BlackBerry® Wireless Enabled Address.
>>
>>
>>         ** Hidden  numbers are automatically rejected by the phone*
>>
>>
>>
>>   -------- Original Message --------
>> Subject:        B::Parse " or ' ?
>> Date:   Mon, 18 Jun 2012 19:47:10 +0200
>> From:   Fabio D'Alfonso <[email protected]>
>> Reply-To:       [email protected]
>> Organization:   Fabio D'Alfonso
>> To:     [email protected] <[email protected]>
>>
>>
>>
>> Hi,
>> always because there are expert porters, for
>>
>>  perl -MO=Deparse -e '$w = $x || $y or $z'
>>
>> I get " Can't find string terminator "'" anywhere before EOF at -e line 1
>> "
>>
>> While I get it working with ".
>>  perl -MO=Deparse -e "$w = $x || $y or $z"
>>
>> On Ubuntu 11.04 I get it working with ' as in documentation.
>>
>> Is this known?
>>
>> Thanks
>>
>>
>> --
>>
>> Fabio D'Alfonso
>> 'Enabling Business Through IT'
>> cell.  +39.348.059.40.22 ***
>> web: www.fabiodalfonso.com <http://www.fabiodalfonso.com/>
>> email: [email protected]
>> <mailto:[email protected]>linkedin:
>> www.linkedin.com/in/fabiodalfonso <
>> http://it.linkedin.com/in/fabiodalfonso>
>> twitter: 
>> www.twitter.com/#!/fabio_dalfonso<http://www.twitter.com/#%21/fabio_dalfonso>
>> <http://www.twitter.com/#%21/fabio_dalfonso>
>>
>> fax: +39.06.874.599.581
>> BlackBerry® Wireless Enabled Address.
>>
>>
>>         ** Hidden  numbers are automatically rejected by the phone*
>>
>>
>>
>>
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>
>
> --
>  "Debugging is twice as hard as writing the code in the first place.
>   Therefore, if you write the code as cleverly as possible, you are,
>   by definition, not smart enough to debug it." -- Brian Kernighan
>
>
>
>


-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to