I am relatively new to perl and while running a perl script I got the following error message and I was hoping that someone might be able to help me to understand what the message is and what I might do to correct it. The message is:

Cant close file GLOB(0x18d8ec): No space left on device at PSA_Solaris +_Combined_Script.pl line 98.

The PSA_Solaris_Combined_Script.pl code is as follows:

#!/usr/bin/perl use strict; use warnings; ###################################################################### +## # # PSA_Solaris_Combined_Script.pl # # Combined Script to Produce Measured/Attributed Report for a # Requested Month (Solaris servers) # # Execution requires 3 arguments # 1) Directory where PSA Monthly Accounting files reside # 2) File Specification string # 3) Date Required - in "mm/yyyy" format # 4) Date Wanted in Output File Names mmmyy format where mmm is 3 o +r 4 letter # # Example: # On xsd00z02 #perl PSA_Solaris_Combined_Script.pl /shared/imd/acct "xsd*.*" "07/200 +7" "Jul07" # ###################################################################### +## ###################################################################### +## # # Originally readdpsa.pl # readdpsa.pl - perl script to read a directory and multiple monthly # PSA Accounting Reports # ###################################################################### +## ## system("rm PSASolaris1.tab"); my $directory = $ARGV[0]; my $filespec = $ARGV[1]; my $datewant = $ARGV[2]; my $datefile = $ARGV[3]; my $SORTFILES; my $index; my $offset; my $count; ## my %usage; my $files = 0; my @SORTFILES; opendir DIR, $directory or die "can't open $directory: $!\n"; my @FILES = glob("$directory/$filespec"); @SORTFILES=sort(@FILES); $count = @SORTFILES; ########################################################## # # Read All Files In Directory to Find Those That Match Date # ########################################################### foreach $SORTFILES (@SORTFILES) { my $date; my $server; my @data; open (my $fh,'<',$SORTFILES) or die "Cant open file $SORTFILES: $!"; open (my $SORT,">>","PSASolaris1.tab") or die "Can't open sort output +file: $!"; while (my $line = <$fh>) { chomp($line); next if ($line =~ /^$/ ); # skip if line begins with spaces last if ($line =~ /TOTAL COMMAND SUMMARY/); if (($line =~ /MONTHLY USAGE FOR/) and ($. < 4)) { $offset = index($line,"MONTHLY USAGE FOR"); $date = substr($line,$offset+18,7); $server = substr($line,$offset+30,8); last if ($date ne $datewant); } last if ($date ne $datewant); next unless $line =~ /^\d/; # $line begins with a digit push @data, $line; my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map [ $_, (split)[1] ], @data; # Sort by Login print $SORT "$server\t$date\t$_\n" for @sorted; } ## END of while loop continue { $files++ if eof; } close $fh or die "Cant close file $SORTFILES: $!"; close $SORT or die "Cant close file $SORT: $!"; } ## END of foreach loop closedir DIR;

In reply to Error Message in Closing File by country1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.