[comp.lang.perl] File name substitution - perl-3.0 pl8 on Sun4 OS4

crehta@tasu74.UUCP (Ran Ever-Hadani) (12/26/89)

The following problem occurs under a SunOS 4.0.3c, on a SPARCstation 1.

Script started on Tue Dec 26 11:29:04 1989
tasu74 % cat try
#!/users/c764/crehta/perl

while (<*.c>) {
	print $_,"\n";
}

tasu74 % ls -F
a.c		b.c		c.c		try*		typescript
tasu74 % try
*.c: Ambiguous.
tasu74 % ^D
script done on Tue Dec 26 11:29:39 1989

The same "try" perl script listed a.c, b.c and c.c correctly on 
a Sun3 under OS 3.5 .

-- Ran
-----------------------------------------------
Reply-To: crehta@taux01.nsc.com (Ran Ever-Hadani)
Disclaimer: The above is to be attributed to me only, not to any organization.
Apology: Bad English.  E-mailed spelling and style corrections are welcome.

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (12/28/89)

In article <3142@taux01.UUCP> crehta@taux01.nsc.com (Ran Ever-Hadani) writes:
: The following problem occurs under a SunOS 4.0.3c, on a SPARCstation 1.
: 
: Script started on Tue Dec 26 11:29:04 1989
: tasu74 % cat try
: #!/users/c764/crehta/perl
: 
: while (<*.c>) {
: 	print $_,"\n";
: }
: 
: tasu74 % ls -F
: a.c		b.c		c.c		try*		typescript
: tasu74 % try
: *.c: Ambiguous.
: tasu74 % ^D
: script done on Tue Dec 26 11:29:39 1989
: 
: The same "try" perl script listed a.c, b.c and c.c correctly on 
: a Sun3 under OS 3.5 .

Are you running with a non-standard csh?  I can't reproduce it on my
SPARCstation.  It acts like *.c is being fed to some csh command that
only expects one argument, such a 'cd'.

In evalargs.xc, you should have some lines that read:

    #ifdef CSH
			    str_nset(tmpstr,cshname,cshlen);
			    str_cat(tmpstr," -cf 'set nonomatch; glob ");
			    str_scat(tmpstr,str);
			    str_cat(tmpstr,"'|");
    #else

Check for corruption in your copy.  You might do
    printf("%s",tmpstr->str_ptr);
to find out what it's trying to execute.

Larry