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

Re^3: getting more from __DATA__

by hsmyers (Canon)
on Mar 28, 2005 at 16:42 UTC ( #442853=note: print w/replies, xml ) Need Help??


in reply to Re^2: getting more from __DATA__
in thread getting more from __DATA__

No, I was just thinking of something along the lines of a 'if first character of the line is semi-colon, then ignore' style of comment. Easy to parse and allows bread crumbs in the forest...

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Replies are listed 'Best First'.
Re^4: getting more from __DATA__
by Ctrl-z (Friar) on Mar 28, 2005 at 17:11 UTC

    What if "if first character of the line is semi-colon, then ignore" is a valid syntax in the embedded text?

    Thats what I meant by being tricky - any special syntax you create on top, could interfere with whats embedded inside. Then you need an escape mechanism...which is a drag to implement for both author and user :-).

    Commenting would be useful, but I cant really think of another way to avoid that catch 22?




    time was, I could move my arms like a bird and...
      I understand your dilemma. The trade off between the value of comments versus folks who have semi-colons in column one has to be considered. How about a comment character selection as part of the interface? I.e. default it to semi-colon or percent sign in first column ( or even anywhere ) and allow the user to specify.

      --hsm

      "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

        I was reticent about adding another parameter to the 'use' statement, but I think you are right.

        Ive added support for arbitrary callbacks and stripping some common comment syntax. Check out the updated POD and source for the skinny.

        Thanks for the input

        edit: flash of inspiration last night, now an arbitrary number of callbacks is supported with some predefined comment strippers.




        time was, I could move my arms like a bird and...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2020-07-06 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?