Change your first line to #!/usr/bin/perl
insetead of #!/usr/bin/perl (take out the leading space) That's causing your shell to think it's a bash script, instead of perl, hence the errors. -------------------------- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -----Original Message----- > From: r p [mailto:[EMAIL PROTECTED] > Sent: Monday, March 17, 2003 8:52 AM > To: [EMAIL PROTECTED] > Subject: pb of listing and renaming files > > > hi all > > i am a beginner and i need some help from you: > here is my problem: > ------------------------------------------------------ > i have to filter all files *.BMP and to rename all by > *.bmp > ------------------------------------------------------ > here is my script: > ------------------------------------------------------- > #!/usr/bin/perl > > open(BMP, "find . -type f | grep .BMP |"); > > > foreach (<BMP>) { > chop; > /(.*)\.BMP/; > print "processing image $_ ..\n"; > system("mv", $_, "$1.bmp"); > } > print "Done."; > > close(BMP) > ----------------------------------------------------- > and i have the following message: > > $ . rename2bmp.pl > bash: ./rename2bmp.pl: line 3: syntax error near > unexpected token `open(BMP,' > bash: ./rename2bmp.pl: line 3: `open(BMP, "find . > -type f | grep .BMP |");' > > ----------------------------------------------------- > i do not unsdarstand what it means. > > Thanks a lot for helping me > > R.P > > ___________________________________________________________ > Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! > Yahoo! Mail : http://fr.mail.yahoo.com > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]