Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!mips!cmic!garvey From: garvey@cmic.UUCP (Joe Garvey) Newsgroups: comp.lang.perl Subject: Is there an easy way around this problem? Keywords: perl error "Arguments too long", help, please Message-ID: <237@cmic.UUCP> Date: 12 Feb 90 01:12:09 GMT Reply-To: garvey%cmic@mips.com Organization: Califonia Microwave Inc., Sunnyvale, CA. Lines: 41 I was in the middle of creating a perl script for archiving off certain files plucked from the news, when I got the message "Arguments too long". The directory I was in had several hundred files (I need the disk space back, so it's time to write our own little news archiving tool). Here is a little demo script that creates the problem. On small directories, this works great. --------------------------------------- #!/usr/contrib/bin/perl $dir = "/users/garvey/tmp/archive/tmp"; foreach $afile (<$dir/*>) { print ($afile, "\n"); } exit 0; -------------------------------------- *** Question *** Is there an easy way around this? There seems to be a limit built into the <$dir/*> of about 250 files (no it's not 256). Have I done something wrong? Why would there be a limit? I'm sure I'm not running out of memory, and Larry says in the first page of the man-page "Unlike most Unix utilities, perl does not arbitrarily limit the size of your data -- if you've go the memory". What gives? perl -v yeilds: $Header: perly.c,v 3.0.1.3 89/12/21 20:15:41 lwall Locked $ Patch level: 8 E-mail replies preferred. -- Joe Garvey UUCP: {apple,backbone}!versatc!mips!cmic!garvey California Microwave Internet: garvey%cmic@mips.com 990 Almanor Ave HP Desk: garvey (cmic@mips.com) /hp1900/ux Sunnyvale, Ca, 94086 800-831-3104 (outside CA) 408-720-6439 (let it ring) 800-824-7814 (inside CA)