find2perl

Discussion in 'Perl' started by Ed Doyle, Dec 28, 2005.

  1. Ed Doyle

    Ed Doyle Guest

    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
     
    Ed Doyle, Dec 28, 2005
    #1
    1. Advertising

  2. Ed Doyle

    Joe Smith Guest

    Ed Doyle wrote:
    > 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
     
    Joe Smith, Dec 29, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sunil

    help with find2perl

    Sunil, Nov 25, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    133
    Anno Siegel
    Nov 25, 2003
  2. Sunil

    find2perl and File::Find examples

    Sunil, Nov 28, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    1,004
    Michele Dondi
    Nov 28, 2003
  3. GU
    Replies:
    4
    Views:
    342
    Peter J. Holzer
    Aug 31, 2009
Loading...

Share This Page