Skip Menu |

This queue is for tickets about the CSS-Simple CPAN distribution.

Report information
The Basics
Id: 100608
Status: resolved
Priority: 0/
Queue: CSS-Simple

People
Owner: Nobody in particular
Requestors: MANWAR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3211
Fixed in: (no value)



Subject: method read_file() not closing file handle
Hi Kevin, I found the method read_file() not closing the file handler after slurping the contents of CSS file. open FILE, "<", $$params{filename} or croak $!; my $css = do { local( $/ ) ; <FILE> } ; should actually be: open FILE, "<", $$params{filename} or croak $!; my $css = do { local( $/ ) ; <FILE> } ; close FILE; Best Regards, Mohammad S Anwar
Hi Mohammad, Good catch. I tend to be lazy about file handles, but this is definitely the correct thing to do. I just added your fix and pushed a new version, you should see it in 72 hours on CPAN. thanks, Kevin On Sat Nov 29 09:51:04 2014, MANWAR wrote: Show quoted text
> Hi Kevin, > > I found the method read_file() not closing the file handler after > slurping the contents of CSS file. > > open FILE, "<", $$params{filename} or croak $!; > my $css = do { local( $/ ) ; <FILE> } ; > > should actually be: > > open FILE, "<", $$params{filename} or croak $!; > my $css = do { local( $/ ) ; <FILE> } ; > close FILE; > > Best Regards, > Mohammad S Anwar