in reply to my $scope as the default for variables
in thread Please help me print this hash.
You guys are great. I appreciate all of the information. Everything below is probably useless information to you.
In all my newbieness I am parsing through a text file that contains ${perlVariable}s with an eval like this:
foreach my $markdown_filename(@sources) { my $text = ''; open(SOURCE, "<$markdown_filename"); while(<SOURCE>) { $text .= eval('"' . $_ . '"'); } close(SOURCE); print $text; }
I could incorporate the markdown into the perl script but then I wouldn't have the awesome ability to preview the formatting by drafting the markdown with DownMarker (https://bitbucket.org/wcoenen/downmarker).
The funny thing is that I was doing this to quiet down the warnings from the eval until I declared everything with my:
use warnings; no warnings 'once';
I also ended up declaring the variables with my ($var1, $var2, $etc ); and then defining them below so that I could list them in alphabetical order at the top and in execution order when I define them. I have found that I can use the output from warnings/strict to tell me which variables I need to add to my alphabetical list of initializations.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: my $scope as the default for variables
by tobyink (Canon) on Jun 19, 2012 at 09:26 UTC | |
|
Re^2: my $scope as the default for variables
by Corion (Patriarch) on Jun 19, 2012 at 09:18 UTC | |
|
Re^2: my $scope as the default for variables
by Anonymous Monk on Jun 19, 2012 at 09:47 UTC | |
|
Re^2: my $scope as the default for variables
by Je55eah (Novice) on Jun 19, 2012 at 09:39 UTC |