suppose i have a file called as SENCONFIG. This file only contains the below global variables.
our $FLAG_IPV4 = "0";
our $FLAG_IPV6 = "1";
our $DEBUG = "0";
our @attack_client_info = ("15.1.1.11","root","root123","15.
+1.1.0/24","eth0","172.16.232.52");
Now i use the below script to open the file and read the following in a string.
open CONFIG, "SENCONFIG" or die "Configuration file missing ...\n";
my $config = join "", <CONFIG>;
eval $config or die "Failed to Evaluate SENCONFIG File...$@\n";
now when i use the print statement,it gives me the value of global varibale presen in the above file.
print $FLAG_IPV4; ### O/P is 0
Can anyone help me understanding how that values are coming from the file to above print statement................
Note: I am not using "use strict" option here because it gives complia
+tion error stating variable not defined.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.