Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

What does WOOF mean in Perl?

by coffee eq blood (Initiate)
on May 15, 2006 at 12:17 UTC ( [id://549455]=perlquestion: print w/replies, xml ) Need Help??

coffee eq blood has asked for the wisdom of the Perl Monks concerning the following question:

I am a new PERL programming being offered the wonderful opportunity to maintain somebody else's Creative Rendention At PERL.

What is WOOF? Specific code:

print <<WOOF_EOF
content-type: text/html

Thanks!

Update: I have been educated greatly today! Thank you monks!

2006-05-15 Retitled by g0n, as per Monastery guidelines
Original title: 'WOOF'

Edit: g0n - restored original content & marked replacement text 'update'

Replies are listed 'Best First'.
Re: What does WOOF mean in Perl?
by derby (Abbot) on May 15, 2006 at 12:33 UTC

    WOOF is nothing .. WOOF_END is a here-doc tag. The actual words can be anything but how it's (or isn't) quoted affects variable interpolation of the here-doc.

    -derby

    update: I see merlyn has the obligatory column about here-docs

      WOOF is nothing

      Well, WOOF is the sound a dog makes--at least, American cartoon dogs.

      Here's a more specific link to the documentation.

        Ha! That's funny. I wonder if the original author or an early maintainer was commenting on the use of heredocs for CGI output!

        -derby
Re: What does WOOF mean in Perl?
by gellyfish (Monsignor) on May 15, 2006 at 12:34 UTC

    You've been looking at my old code haven't you.

    The

    <<SOMETHING; some text SOMETHING
    construct is called a "here document" and Perl borrows it from the Unix shell. Essentially it is a mechanism to create a multiline quoted string. The token to the right of the '<<' is simply a delimiter and will be mirrored by the same token on a line on it's own after the quoted section. The actual token used has no significance whatsoever and can be any valid perl identifier although the convention is to use upper case in order to make it stand out in the source code.

    If there are a number of "here documents" in a piece of program code then the developer might get "creative" in order to come up with unique tokens (although this isn't actually necessary it makes it clearer in most code,) thus you can end up with some strange ones like you have seen.

    /J\

Re: What does WOOF mean in Perl?
by Fletch (Bishop) on May 15, 2006 at 12:55 UTC

    It's bad form to clobber the contents of your question. If you want to add a note to the end that's fine, but since you've removed your original question people coming along afterwards (today, a week from now, months down the road) will not be able to get anything from this thread (unless one of the maintainers resurrects the text, which will probably happen as soon as one sees what's happened; still, don't do it to begin with).

Re: What does WOOF mean in Perl?
by marto (Cardinal) on May 15, 2006 at 12:59 UTC
Re: WOOF
by blazar (Canon) on May 15, 2006 at 13:04 UTC

    <context>
    The OP first asked a question, then he changed the whole text of his post to "I have been educated greatly today! Thank you monks!"
    <context>

    Don't edit your posts like that!

    This will make the following responses quite senseless! Add an "update" marker instead. Or <strike> tags if you want to "delete" something.

    Re your usage of "PERL"... I had just terminated writing this

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://549455]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-07-18 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.