in reply to Regular Expression problem with $variable =~ m/C++/

Your sample could perhaps be better written using a __DATA__ section as:

use strict; #looked variable my $VarString = 'C++'; print "Start...\n"; #search string while (<DATA>) { #check with the matching expression next unless m/$VarString/; chomp; print "I have found the string $VarString at line $.\n"; } print "Stop\n"; __DATA__ VISUAL BASIC,PERL,PASCAL C#,C,C++ ASSEMBLER,PHP,JAVA HTML,XML,JAVA

but the major issue is the old problem of reinventing tricky wheels. CSV, in general, is tricky to parse correctly. You are much better to use something like Text::CSV.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Regular Expression problem with $variable =~ m/C++/
by mtar (Novice) on Jun 12, 2007 at 13:07 UTC
    Thank you for your suggestion!

    I would like to use very powerful module (that I have seen), but my Server Provider doesn't want to install any CPAN module, not included in the default Perl installation!! ;-(

    In fact I will open another discussion about this problem.

    "How is possible to use the CPAN module in local folder without installation in the Perl folder?"

    If I copy the module in my folder on the Server (where there are my scripts), can I call it as if they was included in the Perl folder?

    I would like to modify the call of the module (for example Text::CSV):
    use Text::CSV;
    with something like this:
    require '.../Text::CSV';
    (Like function library)

    In this way I could use all the module that I need, even if they are not installed inside the Perl folder.
    I have already made some tests but unfortunately with any positive result...
    bye
      You need to find your directory then point the LIB environment variable to it, or a subdirectory, as in this snippet:
      use FindBin; use lib "$FindBin::Bin/lib";
      jdtoronto