[comp.lang.perl] q//

jv@mh.nl (Johan Vromans) (09/11/90)

From the manual (pl28):

 "The q operator is a generalized single quote, and the qq operator a
 "generalized double quote.
 "Any non-alphanumeric delimiter can be used in place of /, including
 "newline.

Of course this is extreme, but ... ascii NUL?

(^@ is a real NUL):

   $a = q^@foo^@;

=> EOF in string at t.pl line 1.

   eval("$a = q\0foo\0"); print "$@";

=> EOF in string at (eval) line 1.

--
	Johan
-- 
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
------------------------ "Arms are made for hugging" -------------------------

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (09/12/90)

In article <1990Sep11.153135.26548@squirrel.mh.nl> Johan Vromans <jv@mh.nl> writes:
: From the manual (pl28):
: 
:  "The q operator is a generalized single quote, and the qq operator a
:  "generalized double quote.
:  "Any non-alphanumeric delimiter can be used in place of /, including
:  "newline.
: 
: Of course this is extreme, but ... ascii NUL?
: 
: (^@ is a real NUL):
: 
:    $a = q^@foo^@;
: 
: => EOF in string at t.pl line 1.
: 
:    eval("$a = q\0foo\0"); print "$@";
: 
: => EOF in string at (eval) line 1.

Fixed.  By the way, that last one is still a syntax error unless you
say "\$a...".

Larry