Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

But that improvement doesn't go far enough. The "," and "#" warnings make me think it would be better to allow escaping inside qw. For example

my @tokens= qw( $ \# ; \, if else else\ if ); # '$' '#' ';' ',' 'if' 'else' 'else if'

The warning should be changed to:

Unescaped ',', '#', or '\' in qw ...

The trick is what level of deference to provide for backward compatibility of unlikely constructs. Silently changing the interpretation of qw( / - \ | ) would be bad. So I'd make qw( \ ) warn for a while before supporting escaped whitespace characters. I don't expect to find \# nor \, inside qw in existing code but maybe qw( \\ ) is slightly more common? That'd be the tough one to deal with.

Maybe just add qqw() that supports escaping? I'd like to be able to even use \n, \t, and \x3e type constructs in qw() on rare occasions.

I guess the current "fix" for the warnings is either no warnings 'qw'; or qw( . ? ! ), ',', qw( ; : ). I dislike the former as it can't distinguish the comma I meant to escape from the comma I slipped in by accident. So I tend to quickly end up replacing qw with quoted strings.

Actually, I'd like qqw to ignore /\s#(\s[^\n]*)?\n/ as my desire to add comments is a common reason I end up replacing qw with quoted strings.

- tye        


In reply to Re^5: Password Generation and Module Multiplication (qw warnings) by tye
in thread Password Generation and Module Multiplication by Orsmo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (9)
As of 2024-03-28 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found