Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
chanio asked:
I still can't understand the use of having different names for the same script. Where are you keeping the default patterns?

The default patterns are hard coded into the script, namely:

  • -----
  • =====
  • ~~~~~
  • ^^^^^
The idea of scripts or binaries using the name they are called by as a parameter is not altogether uncommon in a Unix-like environment, a prominent example being your login shell that knows it is a login shell rather than an ordinary subshell from the fact that what appears to be its name starts with a dash.

In such an environment the Perl function exec lets you choose the name argument (which will end up as $0 in the called program) independently of the program's actual filename (using the indirect object syntax).

The easiest way to take advantage of a $0-aware script from the command line, however, is to make it accessible via appropriate different filenames. Just link (or copy) your pul.pl file to aul.pl and see what happens if you call that (N.B. without a pattern argument).


In reply to Re^2: Plaintext underlining tool by martin
in thread Plaintext underlining tool by martin

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 avoiding work at the Monastery: (6)
As of 2024-04-24 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found