SPUG: RE: Simple program - gone wrong

Sweethomes sweetsue at sweethomes.com
Mon Jul 8 11:58:16 CDT 2002


Not sure if this went through - resending:

  Scratching my head over this one.  All I want is to read the upper
directory, list out the files names and then print the results with
numbering to a file.  Here is what I have:

    #!/usr/bin/perl
    open(RDIR,"./admin/data/rdir.txt");
    opendir(DIR, "../");
    @files = readdir(DIR);
    for($num = 0; $num <= 100; $num += 1)
    foreach $name (@files) {
    if(-d $name){}elsif($name eq "." || $name eq ".."){}else{
    print(RDIR, "$num | $name\n");}}
    close(RDIR);
    close(DIR);
    exit;

    I've got the worst headcold in my personal history and I'm thinking that
my brain just is not functioning.  If anyone can clear this up for me, I'd
appreciate it!
    Happy 4th of July to all!

    www.web-dev-design.com
    ------------------------------------
    Susanne Bullo, Developer     Web Dev Design
    16646 SE 10th Street                Bellevue, WA 98008
    Telephone: 425.562.6040         Facsimile: 425.671.0571
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/spug-list/attachments/20020708/fd67fda4/attachment.htm


More information about the spug-list mailing list