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 (Archbishop) 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:  <%-{-{-{-<