Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Convert ISO 9660 filesystem image to ASCII text

by InfiniteSilence (Curate)
on May 10, 2013 at 18:11 UTC ( [id://1033004]=note: print w/replies, xml ) Need Help??


in reply to Convert ISO 9660 filesystem image to ASCII text

On Perlmonks you need to close your open code tags or else your post's formatting will be nigh unreadable. Also, your code doesn't make much sense:

#my $path = '/opt/finance/File1'; + my $path = q|/tmp/File1|; my $PMN = 'KKDDI'; my $MON = 'DDIID'; my $YEAR ='2013'; my $MON='JAN'; my $DATE='12'; my $CSV = $path . '.csv'; open CSV, ">$CSV" || die "Cannot open the file $CSV $! \n"; print CSV "\"ABCDE501,\"\"$PMN\"\",$MON/01/$YEAR,$MON/$DATE/$YEAR,$MON +/$DATE/$Y\ EAR\"\n"; # Data hash contains values that has to be printed. + foreach my $key (keys %DataHash) { print CSV $DataHash{$key}; } close(CSV);

Here you are writing the header to the CSV in a specific order but you are iterating willy-nilly over a hash which is not guaranteed to produce results in that same order.

perl -e 'my %hash = (q|first|=>1,q|third|=>3,q|second|=>2); print key +s %hash;' firstsecondthird

Celebrate Intellectual Diversity

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found