in reply to Re: Opening Unknown Filenames
in thread Opening Unknown Filenames

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Re: Re: Opening Unknown Filenames
by antirice (Priest) on Jul 05, 2003 at 10:06 UTC

    If he didn't post something to that effect then I would have done it myself. It's not that this problem is below us, it's that it is a very simple problem to solve. Another thing is that your code was thrown together without any test runs. How do I know?

    Global symbol "@file" requires explicit package name at prob58.pl line + 6. Global symbol "%file" requires explicit package name at prob58.pl line + 7. syntax error at prob58.pl line 7, near "$file {" Global symbol "$file" requires explicit package name at prob58.pl line + 8. Global symbol "@account" requires explicit package name at prob58.pl l +ine 9. Global symbol "%account" requires explicit package name at prob58.pl l +ine 11. syntax error at prob58.pl line 11, near "$account {" Global symbol "$fullname" requires explicit package name at prob58.pl +line 12. Global symbol "$username" requires explicit package name at prob58.pl +line 12. Global symbol "$mothers" requires explicit package name at prob58.pl l +ine 12. Global symbol "$email" requires explicit package name at prob58.pl lin +e 12. Global symbol "$referral" requires explicit package name at prob58.pl +line 12. Global symbol "$ip" requires explicit package name at prob58.pl line 1 +2. Global symbol "$account" requires explicit package name at prob58.pl l +ine 12. Global symbol "$fullname" requires explicit package name at prob58.pl +line 14. Global symbol "$username" requires explicit package name at prob58.pl +line 14. Global symbol "$mothers" requires explicit package name at prob58.pl l +ine 14. Global symbol "$email" requires explicit package name at prob58.pl lin +e 14. Global symbol "$referral" requires explicit package name at prob58.pl +line 14. Global symbol "$ip" requires explicit package name at prob58.pl line 1 +4. syntax error at prob58.pl line 16, near "}" prob58.pl has too many errors.

    Turn off strict, still no go:

    syntax error at prob58.pl line 7, near "$file {" syntax error at prob58.pl line 11, near "$account {" syntax error at prob58.pl line 16, near "}" Execution of prob58.pl aborted due to compilation errors.

    The problems with your code are as follows:

    • To get past the barrage of "Global symbol..." errors you need to use my.
    • The proper syntax for foreach is as follows: foreach [[my ] $var] (list)
    • Don't know the proper syntax for something? Check it out at http://www.perldoc.com or use the perldoc command.
    • You shouldn't use the backtick operators when you have something already built into perl for getting the same information. Check out opendir, readdir, and closedir for some options. Also, take a look at File::Find for another option.

    I don't know about the other monks, but I am offended when someone asks me for help and then throws what could at best be described as perl-esque pseudocode. Seek help for the wisdom, don't seek help for the answer.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1

Re: Re: Re: Opening Unknown Filenames
by hiddenlinux (Acolyte) on Jul 05, 2003 at 09:51 UTC
    the errors i get are:
    syntax error at ./cr_user.pl line 7, near "$file {" syntax error at ./cr_user.pl line 11, near "$account {" syntax error at ./cr_user.pl line 20, near "}" Execution of ./cr_user.pl aborted due to compilation errors.
Re: Re: Re: Opening Unknown Filenames
by bobn (Chaplain) on Jul 05, 2003 at 19:33 UTC

    "PTFO"?



    --Bob Niederman, http://bob-n.com
      Potential expansions include
      • Piss The Fuck Off
      • Private Tea Factory Owners
      • Parent Teacher Facilitation Organanizaion
      • Perls That Fall Over

      --
      Snazzy tagline here