find2perl

E

Ed Doyle

Hi,
I am new to perl. Seems to me the following should work, but it does not

print("Hello World!\n\n");
find2perl . -name dsc00970.jpg -print;

When I run it I get the following:

[ed@localhost Flame]$ perl junk1.pl
Hello World!

Can't locate object method "name" via package "dsc00970"
(perhaps you forgot to load "dsc00970"?) at junk1.pl line 4.

Anyone have any idea what I am doing wrong?

Thanks

Ed
 
J

Joe Smith

Ed said:
Hi,
I am new to perl. Seems to me the following should work, but it does not

print("Hello World!\n\n");
find2perl . -name dsc00970.jpg -print;

No, that's not how you use it. That utility is supposed to be
invoked from the command line, not from inside a perl script.

#!/bin/sh
echo "Creating a perl script from a 'find' command"
find2perl . -name dsc00970.jpg -print > findit.pl
perl findit.pl

-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top