Formats: Escaping Characters 
Author Message
 Formats: Escaping Characters

Say I have a format like this:

format FOO =

  $name

which would print like:

|  samuel  |
|  thomas  |

etc...

and I want to expand the format to include things like:

|biggername|

When I try this:


perl is, understandably, confused and doesn't print the right-most "|"
cince it takes it as part of the format.  I tried escaping the right
"|" liek this: "\|" but it just printed "\|" :-/

Anyone know how to do this?

-John



Sun, 20 Apr 1997 05:30:25 GMT  
 Formats: Escaping Characters

:When I try this:
:
:format FOO =

:
:perl is, understandably, confused and doesn't print the right-most "|"
:cince it takes it as part of the format.  I tried escaping the right
:"|" liek this: "\|" but it just printed "\|" :-/
:
:Anyone know how to do this?

From the perlform man page:

       To get a real at or caret into the field, do this:

           format Ident =


           .

Just change that to "|" and be happy.

--tom
--

"All things are possible, but not all expedient."  (in life, UNIX, and perl) -me



Sun, 20 Apr 1997 07:29:05 GMT  
 Formats: Escaping Characters

:            format Ident =


:            .

<smacks forehead>

..sorry 'bout that...I wasn't thinking...:)

Thanks a bunch! :)

-John



Sun, 20 Apr 1997 09:24:58 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CGI hangs due to dodgy escape character

2. problems with the \n escape character

3. Escaping cursor characters

4. Variables and escaped characters in RegExp

5. how do I retranslate escaped characters

6. regex to escape special characters

7. Striping VT100 escape characters from a file

8. Why do escape characters show when printing?

9. Which characters need escaping list?

10. Automatically escape characters?

11. How to convert literal escape to ascii character?

12. backtick operator and escape characters...

 

 
Powered by phpBB® Forum Software