in reply to Re^2: converting JSON to CSV
in thread converting JSON to CSV
Just TIMTOWTDI...
AnomalousMonk already mentioned the issue with local. Localizing is pointless when it happens at top level - in the same way as my variables are global variables if declared at top level in a program that consists in just 1 file without imports.
So, local needs a place. A bare block is convenient:
my $text; # but see above ;-) { local( $/, *FH ) ; open( FH, '<', 'aws.json' ); $text = <FH>; } # $/ restored to default here # FH is an empty typeglob in the symbol table
See also my/local, space/time (was: Re: The difference between my and local)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: converting JSON to CSV
by haukex (Archbishop) on Apr 08, 2017 at 09:14 UTC |