find2perl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Doyle

    find2perl

    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
  • Joe Smith

    #2
    Re: find2perl

    Ed Doyle wrote:[color=blue]
    > 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;[/color]

    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

    Comment

    Working...