Any wrong?

From: Jame brooke (muarlove_at_yahoo.com.hk)
Date: 05/30/04

  • Next message: Randy W. Sims: "Re: Any wrong?"
    Date: Mon, 31 May 2004 00:10:21 +0800 (CST)
    To: beginners@perl.org
    
    

    Friend, anybody have idea regarding this problem. Assume I want know where the word call "fish" locate in which line number, and this word i save under file call nlexample. Assume we already know fish save under line number 2, how we show this?

    Example:nlexample

    I love vegetable
    I love fish
    I love perl

    my script
    -----------
    my $lineno;
                                                                                    
    while (<>){
            if (/pattern/){
            print $lineno++;
            print ": $_";
        }
      }

    As i know we can use pattern tester to matching right? But why i perl no allow me compiler?

    [root@localhost root]# ./pattern nlexample fish
    Can't open fish: No such file or directory at ./pattern line 7, <> line 6.

    Any comment regarding this problem, please advise.

    ---------------------------------
    Do You Yahoo!?
    Get your free @yahoo.com.hk address at Yahoo! Mail.


  • Next message: Randy W. Sims: "Re: Any wrong?"

    Relevant Pages

    • RE: Any wrong?
      ... > Friend, anybody have idea regarding this problem. ... > Assume we already know fish save under line number 2, ... > why i perl no allow me compiler? ... > Get your free @yahoo.com.hk address at Yahoo! ...
      (perl.beginners)
    • Bot::BasicBots forkit() creating zombies
      ... First of all I'd like to tell you all that I'm a total Perl newbie, ... Bot::BasicBot's forkit() method to run for example a Yahoo! ... my $message = shift; ...
      (comp.lang.perl.misc)
    • Summary: array in ksh
      ... IFS environment variable to a newline. ... Ilhan Narili ... Some suggested that I use perl. ... Do you Yahoo!? ...
      (SunManagers)
    • Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
      ... Google search along the lines of "CPAN yahoo mail". ... you could indeed get the job done with a few lines of Perl. ... this newsgroup was a perfectly good forum for sketching ...
      (comp.lang.perl.misc)
    • Re: perl
      ... I am sure about it shows very clear in error message The system cannot find the path ... Subject: perl ... I am using apache 2.0.04 win32 version in window XP, ... Have a HUGE year through Yahoo! ...
      (perl.beginners)