Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Legacy code question

by thanos1983 (Parson)
on May 13, 2019 at 14:36 UTC ( #1233703=note: print w/replies, xml ) Need Help??


in reply to Legacy code question

Hello Zenzizenzizenzic,

Just to add something minor here that maybe it will help you to understand a bit more EOF. The actual string EOF it is an indication string that helps you to understand that is the end of your file.

You can define anything as a name e.g. (example of code taken from fellow Monk code haukex):

#!/usr/bin/perl use strict; use warnings; use Data::Dump; my @sqltt = <<THANOS; Hello, World! THANOS dd @sqltt; __END__ $ perl test.pl "Hello,\nWorld!\n"

Hope this minor part helps you understand more about EOF. In generally I prefer reading files line by line, but this is me.

BR / Thanos

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: Legacy code question
by AnomalousMonk (Bishop) on May 13, 2019 at 20:41 UTC
    The actual string EOF it is an indication string that helps you to understand that is the end of your file. ... I prefer reading files line by line ... [emphasis added]

    I think it's important to point out that the EOF identifier as used in the OPed code example has nothing to do with the end-of-file condition or reading an entire file into an array. Rather, it is an arbritrary identifier defined to mark the end of a here document. (I think you understand this perfectly well since you use the THANOS identifier in exactly this way in the code example you give, but I want to clarify this point for any novice monk who might happen upon this thread. :)


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2020-05-28 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (165 votes). Check out past polls.

    Notices?