Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Plaintext underlining tool

by chanio (Priest)
on Jan 28, 2006 at 23:32 UTC ( #526229=note: print w/ replies, xml ) Need Help??


in reply to Plaintext underlining tool

Nice!

I did this example that I call 'the Pine Tree' pattern...

cat <<'EOF'| perl pul.pl '/*\*' > Kernel-disk plus a disk containing the initial ramdisk, which will b +e > prompted for at boottime. > > If you wish to remaster the CD, please don't forget to specify > -no-emul-boot -boot-load-size 4 -boot-info-table \ > -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat > as option to mkisofs. Otherwise your CD won't be bootable. > EOF Kernel-disk plus a disk containing the initial ramdisk, which will be /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/ prompted for at boottime. /*\*/*\*/*\*/*\*/*\*/*\*/ If you wish to remaster the CD, please don't forget to specify /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/* -no-emul-boot -boot-load-size 4 -boot-info-table \ /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/* -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\ as option to mkisofs. Otherwise your CD won't be bootable. /*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*\*/*
I still can't understand the use of having different names for the same script. Where are you keeping the default patterns?


Comment on Re: Plaintext underlining tool
Download Code
Re^2: Plaintext underlining tool
by martin (Pilgrim) on Jan 29, 2006 at 07:46 UTC
    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).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://526229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-12-27 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls