in reply to Re: regular expression function: grep, split, substr OR NO need?
in thread regular expression function: grep, split, substr OR NO need?

"But the regular expression binding operator =~ only applies a match. What you do with the result is where split and grep come in."
Firstly, thx for quick reply!
Well, yes, I misunderstanding the difference.
If I would like to use functions grep, split, substr... etc
I need to use "use module" ?
use module use IO::File;
thank you
  • Comment on Re^2: regular expression function: grep, split, substr OR NO need?
  • Download Code

Replies are listed 'Best First'.
Re^3: regular expression function: grep, split, substr OR NO need?
by hdb (Monsignor) on Sep 09, 2013 at 09:00 UTC

    In order to read and process a file, you do not need a module. As a starting point it is probably good, if you would read the documentation of split, grep and substr and find out under which circumstances they are useful. Do you have any particular application in mind? If not, search PerlMonks to find 1000s of examples for the usage of these functions!

      "search PerlMonks to find 1000s of examples for the usage of these functions! "
      thank you for advise, sorry that I am so stupid...
      how can I get the examples? howto SEARCH I mean?

        On this page, top right, there is a link called Super Search which leads to the PerlMonk's Search Function.

        Alternatively, there is a useful website called Google that let's you specify the site to search. Just enter: grep site:perlmonks.org and you get some useful links. For example this one: map grep and sort.

      further question
      if talking about module, it means OO object oriented?
        Instead of asking all the basic questions, you might try reading a book or Perl documentation.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Some modules provide an OO interface (e.g., LWP::UserAgent). Others export functions for their caller to use (e.g. List::Util). Others do neither and instead affect the behavior of Perl (e.g. strict).

        use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name