Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Re: using grep in perl

    Cy Kurtz wrote:
    > I'm trying to write a little program to take all of the fun out of the
    > daily jumble.
    >
    > My plan is to get a sequence of letters from the user, move the letters
    > around and bounce the resulting sequence of letters off of a spell check
    > dictionary until the program generates an English word.
    >
    > When I call grep from the command line, grep returns what I expect. When
    > I call grep from perl, I get:
    >
    > not enough arguments for grep
    >
    > or
    >
    > search pattern not terminated
    Code. We need code.

    --
    Andrew Gaffney
    Network Administrator
    Skyline Aeronautics, LLC.
    636-357-1548

    Andrew Gaffney Guest

  2. Similar Questions and Discussions

    1. perl grep..
      Taylor Lewick wrote: I didn't remove the "\n" character from the input line so it doesn't have to be added to the output line and print() prints...
    2. grep with [ ] brackets ... ?
      I'd thought I'd seen everything with perl until I saw John Krahn give this code as a solution: #syntax: unfold.pl filename > newfilename ...
    3. grep with ftp
      Howdy: I'm looking for information that will let me open an ftp connection and grep / search for files and then FTP them back to me. I saw...
    4. grep
      Hi. I'm trying to make the following work: $index = 0; foreach (@mac){ if (grep /$_/, $legalmacs !~ 0){ push @violators, join('',@mac,"...
    5. grep-dctrl
      Hi, I installed mysql-server on my server, and now I want to install lynx and/or ntpclient. This gives an error: kain:/var/log/apache#...
  3. #2

    Default using grep in perl

    I'm trying to write a little program to take all of the fun out of the
    daily jumble.

    My plan is to get a sequence of letters from the user, move the letters
    around and bounce the resulting sequence of letters off of a spell check
    dictionary until the program generates an English word.

    When I call grep from the command line, grep returns what I expect. When
    I call grep from perl, I get:

    not enough arguments for grep

    or

    search pattern not terminated

    Thanks,

    Cy Kurtz



    Cy Kurtz Guest

  4. #3

    Default Re: using grep in perl

    Cy Kurtz wrote:
    >
    > I'm trying to write a little program to take all of the fun out of the
    > daily jumble.
    >
    > My plan is to get a sequence of letters from the user, move the letters
    > around and bounce the resulting sequence of letters off of a spell check
    > dictionary until the program generates an English word.
    >
    > When I call grep from the command line, grep returns what I expect. When
    > I call grep from perl, I get:
    >
    > not enough arguments for grep
    >
    > or
    >
    > search pattern not terminated
    Perl isn't a scripting language, and the Perl 'grep' function
    isn't shelling out to run the grep program.

    'grep' takes either an expression or a Perl block as its first
    parameter. It returns those elements of the following list for
    which the expression/block are 'true'.

    We can't tell what's wrong without seeing your daily jumble :)

    Rob


    Rob Dixon Guest

  5. #4

    Default Re: using grep in perl

    On Feb 3, Cy Kurtz said:
    >I'm trying to write a little program to take all of the fun out of the
    >daily jumble.
    >
    >My plan is to get a sequence of letters from the user, move the letters
    >around and bounce the resulting sequence of letters off of a spell check
    >dictionary until the program generates an English word.
    >
    >When I call grep from the command line, grep returns what I expect. When
    >I call grep from perl, I get:
    Are you calling grep from Perl, or using Perl's grep() function?
    >not enough arguments for grep
    >search pattern not terminated
    Those sound like Perl error messages. Show us your code, please.

    --
    Jeff "japhy" Pinyan [email]japhy@pobox.com[/email] [url]http://www.pobox.com/~japhy/[/url]
    RPI Acacia brother #734 [url]http://www.perlmonks.org/[/url] [url]http://www.cpan.org/[/url]
    <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
    [ I'm looking for programming work. If you like my work, let me know. ]

    Jeff 'Japhy' Pinyan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139