Re: [SLUG] simple perl script problem

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Mar 09 2005 - 16:31:46 EST


On Wed, 9 Mar 2005, aaron steimle wrote:

> Can anyone tell me why this code will NOT work? I have look every where
> and tried every combination of syntax I could find. This code is
> basically a copy of every example I can find. I know there are other
> ways to do this but I want to know why THIS isn't working.
>
>
>
> ==================================
>
> #!/usr/bin/perl
>
> opendir DIR, "/var/errors/";
>
> while ( $filename = readdir(DIR) )
> {
> @fileinfo=stat($filename);
> $sizestat = $fileinfo[7];
> print "$filename - $sizestat\n";
> }
> closedir DIR;

What error(s) do you get?

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
CAPRICORN:  The stars say you're an exciting and wonderful person...
but you know they're lying.  If I were you, I'd lock my doors and
windows and never never never never leave my house again.  -- Weird Al

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:25:51 EDT