Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Unusual coding arrangements in Perl

by Win (Novice)
on May 03, 2007 at 12:56 UTC ( [id://613372]=note: print w/replies, xml ) Need Help??


in reply to Re: Unusual coding arrangements in Perl
in thread Unusual coding arrangements in Perl

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Unusual coding arrangements in Perl
by philcrow (Priest) on May 03, 2007 at 13:02 UTC
    The DATA handle is special. It is opened for you on program start and is ready to read from the __DATA__ section at the bottom of the program:
    chomp ( my @some_data = <DATA> ); #... __DATA__ lines of data here
    This is sometimes a convenient way to separate code from conf or other data, while leaving them in the same file for easier installation.

    Phil

    The Gantry Web Framework Book is now available.
Re^3: Unusual coding arrangements in Perl
by pKai (Priest) on May 03, 2007 at 13:46 UTC
    Hm, the code line in the OP obviously was taken verbatim from a reply I gave to one of your previous questions.

    I deliberately crafted the code in that node after the the snippet you gave in that question, to give you a better resemblance what change I proposed to your code.
    I even let things in there not used in my code, like the variables $year and friends.

    But then, my code was a tested complete script, which you are able to save and execute as-is. So I thought it was clear, that some things have to be taken in its own context and can't be transplanted into another (your) script without adaption.

    It seems I failed miserably with this approach.

      But then, my code was a tested complete script, which you are able to save and execute as-is. So I thought it was clear, that some things have to be taken in its own context and can't be transplanted into another (your) script without adaption.

      Haha, you seem to have no clue about how Win is used to "work". You have a vast literature to study!

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Unusual coding arrangements in Perl
by GrandFather (Saint) on May 03, 2007 at 13:18 UTC

    Look for the "Special Literals" section in perldata for a description of __DATA__, __END__ and DATA.


    DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-19 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found