[28763] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 8 14:06:06 2007

Date: Mon, 8 Jan 2007 11:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 8 Jan 2007     Volume: 11 Number: 7

Today's topics:
    Re: gtk2 treeview and threads : custom sort while updat erwan.barrier@gmail.com
    Re: OSCON 2006 - Perl programming vs. scripting <dominique.dumont@hp.com>
    Re: OSCON 2006 - Perl programming vs. scripting usenet@DavidFilmer.com
    Re: PERL5LIB variable does not work as expected (on aioe)
    Re: PERL5LIB variable does not work as expected <stahl.karl@gmail.com>
        Simple yet peculiar bug rthompson414@gmail.com
    Re: Simple yet peculiar bug <glex_no-spam@qwest-spam-no.invalid>
    Re: Simple yet peculiar bug <bpatton@ti.com>
    Re: stalling server client program <jgibson@mail.arc.nasa.gov>
    Re: To do parallel processing.. (on aioe)
    Re: To do parallel processing.. xhoster@gmail.com
    Re: using 'Not' while greping using regex <tadmc@augustmail.com>
    Re: using 'Not' while greping using regex anno4000@radom.zrz.tu-berlin.de
    Re: using 'Not' while greping using regex <shafa.fahad@gmail.com>
    Re: using 'Not' while greping using regex <jurgenex@hotmail.com>
    Re: Xah's Edu Corner: Introduction to 3D Graphics Progr ajsiegel@optonline.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 8 Jan 2007 04:15:33 -0800
From: erwan.barrier@gmail.com
Subject: Re: gtk2 treeview and threads : custom sort while updating rows
Message-Id: <1168258533.027770.291230@11g2000cwr.googlegroups.com>

hello

> Your threaded code example runs for me, so possibly
> you need to upgrade to a more recent library version.
> I'm using Glib-1.140 and Gtk2-1.140
>

i'm using Gtk2-1.141 and Glib-1.142 with threads 1.57

> 1. It leaks memory every 500ms. You create a new thread for each
> update_action call. The threads will not clean up after themselves,
> and the memory they use will accumulate.  It is best to make 1 thread,
> then reuse it, over and over.  Watch the memory usage of your script
> as it runs.
>
> 2. I realize its just a simple example, but your threaded version has no
> exit, if you hit the window manager's exit button, the threads keep on
> going.
>

thanks for pointing me the threads problem,
i had memory leaks because of that and if i fixed it.

> # Your original non-threaded dosn't work, just add a random number

it runs ok for me, it's strange

> Another problem, is you are trying to access the set_sort_func from
> the thread. This may work, or may not. You may be better off completely
> encapsulating the SimpleList in a the thread, then use enter-leave to
> add to it.

set_sort_func is called before i launch any thread.
the thread just push new lines of data.
i'm not sure but i think my sorting func is called from the gtk loop in
the main thread
I have tested many possibilities and it doesn't work like it should:
with thread automatic sorting works
with thread custom sorting doesn't work
I'm looking at python if it can do what i want easily.
thanks for helping zentara



------------------------------

Date: Mon, 08 Jan 2007 11:38:24 GMT
From: Dominique Dumont <dominique.dumont@hp.com>
Subject: Re: OSCON 2006 - Perl programming vs. scripting
Message-Id: <kgips9pygd6.fsf@komarr.grenoble.hp.com>

John Bokma <john@castleamber.com> writes:

> Yup, I try to use more and more program on my website instead of script as 
> well. I advertise myself as a Perl programmer, not Perl scripter (which 
> sounds more to me like I work for the movies industry anyway).

I wonder if the computer industry has Perl script doctors ... ;-)



-- 
Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner


------------------------------

Date: 8 Jan 2007 10:32:06 -0800
From: usenet@DavidFilmer.com
Subject: Re: OSCON 2006 - Perl programming vs. scripting
Message-Id: <1168281126.740065.29930@i15g2000cwa.googlegroups.com>

Dominique Dumont wrote:
> I wonder if the computer industry has Perl script doctors ... ;-)

Just medics.  http://tinyurl.com/y476fj

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



------------------------------

Date: Mon, 08 Jan 2007 03:43:12 -0600
From: "Mumia W. (on aioe)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: PERL5LIB variable does not work as expected
Message-Id: <entak0$dap$1@aioe.org>

On 01/07/2007 01:40 PM, Ishmael wrote:
> I am trying to get Perl to recognize a module (Math::GMP) that is
> installed in a local directory, i.e. not the same directory as the rest
> of Perl.  I've been trying to use the PERL5LIB environment variable to
> get Perl to search on the correct path, but it doesn't work.  Here's
> what I mean:
> 
> 
> First I set (what I believe to be) the search path:
> 
> setenv PERL5LIB
> /home/kstahl/PERL/Digest-1.15:/home/kstahl/PERL/Digest-SHA1-2.11:
> /home/kstahl/PERL/Scalar-List-Utils-1.19:/home/kstahl/PERL/gmp-4.2.1:
> /home/kstahl/PERL/Math-GMP-2.04:/home/kstahl/PERL/Math-GMP-2.04/lib:
> /home/kstahl/PERL/Math-GMP-2.04/blib:
> /home/kstahl/PERL/Math-GMP-2.04/lib/site_perl/5.6.1/sol2.sun4/auto/Math/GMP:
> /home/kstahl/PERL/Net-SSH-Perl-1.30
> 
> 
> Now I check to see if it finds the module.
> 
> perl -MMath::GMP -e 'print "ok\n"'
> 
> 
> Answer: Nope, it's still looking in the perl installation directory.
> 
> Can't load
> '/apps/gnu/perl_local/lib/site_perl/5.6.1/sol2.sun4/auto/Math/GMP/GMP.so'
> for
> module Math::GMP: ld.so.1: perl: fatal: libgmp.so.3: open failed: No
> such file
> or directory at /apps/gnu/perl-5.6.1/lib/sol2.sun4/DynaLoader.pm line
> 206.
>  at -e line 0
> Compilation failed in require.
> BEGIN failed--compilation aborted.
> 
> 
> Check to make sure correct directory is on the path:
> 
> perl -e 'while(<@INC>) { print "$_\n"; }'
> 
> /home/kstahl/PERL/Digest-1.15
> /home/kstahl/PERL/Digest-SHA1-2.11
> /home/kstahl/PERL/Scalar-List-Utils-1.19
> /home/kstahl/PERL/gmp-4.2.1
> /home/kstahl/PERL/Math-GMP-2.04
> /home/kstahl/PERL/Math-GMP-2.04/lib/sol2.sun4
> /home/kstahl/PERL/Math-GMP-2.04/lib
> /home/kstahl/PERL/Math-GMP-2.04/blib
> /home/kstahl/PERL/Math-GMP-2.04/lib/site_perl/5.6.1/sol2.sun4/auto/Math/GMP
> /home/kstahl/PERL/Net-SSH-Perl-1.30
> /apps/gnu/perl-5.6.1/lib/sol2.sun4
> /apps/gnu/perl-5.6.1/lib
> /apps/gnu/perl_local/lib/site_perl/5.6.1/sol2.sun4
> /apps/gnu/perl_local/lib/site_perl/5.6.1
> /apps/gnu/perl_local/lib/site_perl
> ..
> 
> 
> Looks to me like the every conceivable subdirectory is included (as
> well as the complete path to the actual library, GMP.so).  What am I
> missing here?
> 
> Thanks a priori!
> 

I don't think you installed Math::GMP right.

First, you would decide on a place to install Perl modules such as 
/home/kstahl/perlinst/

After you've downloaded and unpacked the source package for Math::GMP, 
you would go into the directory where the package was unpacked (e.g. 
/home/kstahl/PERL/Math-GMP-2.04/) and do this:

perl Makefile.PL PREFIX=/home/kstahl/perlinst
make test && make install

That should install the module into /home/kstahl/perlinst.

Then, PERL5LIB might be set like so:
PERL5LIB=/home/kstahl/perlinst/share/perl:/home/kstahl/perlinst/share/lib

You definitely should not need to add a path to PERL5LIB for each module 
installed.


-- 
paduille.4060.mumia.w@earthlink.net
Windows Vista and your
freedom in conflict: http://www.badvista.org/
http://home.earthlink.net/~mumia.w.18.spam/


------------------------------

Date: 8 Jan 2007 10:25:42 -0800
From: "Ishmael" <stahl.karl@gmail.com>
Subject: Re: PERL5LIB variable does not work as expected
Message-Id: <1168280742.609735.326820@v33g2000cwv.googlegroups.com>

>
> I don't think you installed Math::GMP right.
>

That was my first thought too, but when I run 'make test', it tells me
'All tests successful', so I think it should be ok.


> First, you would decide on a place to install Perl modules such as
> /home/kstahl/perlinst/

I wasn't entirely clear about where I could install the modules, so I
(naively) installed each module into it's own directory (i.e. the same
directory the module was unpacked in).  For example, to install GMP, I
ran 'perl Makefile.PL PREFIX=/home/kstahl/PERL/Math-GMP-2.04' )
Thinking this might be the problem, I just recompiled GMP in a separate
directory, as you suggest, but alas, even though 'make test' gives no
errors, perl refuses to search on the new path (which I added to the
PERL5LIB variable)

> After you've downloaded and unpacked the source package for Math::GMP,
> you would go into the directory where the package was unpacked (e.g.
> /home/kstahl/PERL/Math-GMP-2.04/) and do this:
>
> perl Makefile.PL PREFIX=/home/kstahl/perlinst
> make test && make install
>
> That should install the module into /home/kstahl/perlinst.
>
> Then, PERL5LIB might be set like so:
> PERL5LIB=/home/kstahl/perlinst/share/perl:/home/kstahl/perlinst/share/lib
>
> You definitely should not need to add a path to PERL5LIB for each module
> installed.
>

I noticed you used 'share/perl' and 'share/lib' as subdirectories above
- but I don't have those.  I only have a lib/ and a man/ directory
under perlinst.  Could this be the problem?



------------------------------

Date: 8 Jan 2007 05:07:39 -0800
From: rthompson414@gmail.com
Subject: Simple yet peculiar bug
Message-Id: <1168261659.013738.38820@s34g2000cwa.googlegroups.com>

I've been working on a simple script file in Perl to open a series of
excel files, and extract specific data from each file to place into a
single new excel file.  The only problem is I'm getting an error I
really can't seem to fix.

retrying default method at C:/Perl/site/lib/Win32/OLE/Lite.pm line 156
Win32::OLE(0.1403) error 0x80020003: "Member not found"
    in METHOD/PROPERTYGET "" at C:\mini-FNDTN\automation.pl line 107

I've tried to pinpoint the problem by trying out more simple test
programs, and it seems I'm unable to even to simply just open any excel
files (ones even I created on the fly for testing).  This is my first
time really working with excel through Perl, so I'm stumped.  What's
going on you think, any suggestions?



------------------------------

Date: Mon, 08 Jan 2007 10:11:20 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Simple yet peculiar bug
Message-Id: <45a26ca8$0$503$815e3792@news.qwest.net>

rthompson414@gmail.com wrote:
> I've been working on a simple script file in Perl to open a series of
> excel files, and extract specific data from each file to place into a
> single new excel file.  The only problem is I'm getting an error I
> really can't seem to fix.
> 
> retrying default method at C:/Perl/site/lib/Win32/OLE/Lite.pm line 156
> Win32::OLE(0.1403) error 0x80020003: "Member not found"
>     in METHOD/PROPERTYGET "" at C:\mini-FNDTN\automation.pl line 107
> 
> I've tried to pinpoint the problem by trying out more simple test
> programs, and it seems I'm unable to even to simply just open any excel
> files (ones even I created on the fly for testing).  This is my first
> time really working with excel through Perl, so I'm stumped.  What's
> going on you think, any suggestions?
> 

Either post a simple example or use your favorite search engine to
see if it's been reported before (it has) and see if any of those
are similar to what you're doing.


------------------------------

Date: Mon, 08 Jan 2007 09:46:54 -0600
From: Billy Patton <bpatton@ti.com>
Subject: Re: Simple yet peculiar bug
Message-Id: <entp18$910$1@home.itg.ti.com>

rthompson414@gmail.com wrote:
> I've been working on a simple script file in Perl to open a series of
> excel files, and extract specific data from each file to place into a
> single new excel file.  The only problem is I'm getting an error I
> really can't seem to fix.
> 
> retrying default method at C:/Perl/site/lib/Win32/OLE/Lite.pm line 156
> Win32::OLE(0.1403) error 0x80020003: "Member not found"
>     in METHOD/PROPERTYGET "" at C:\mini-FNDTN\automation.pl line 107
> 
> I've tried to pinpoint the problem by trying out more simple test
> programs, and it seems I'm unable to even to simply just open any excel
> files (ones even I created on the fly for testing).  This is my first
> time really working with excel through Perl, so I'm stumped.  What's
> going on you think, any suggestions?
> 
Imma rookie for excel stuff.
Here is my first attempt.  I takes an excel spreadsheet (row 1 is 
assumed to be column names and not data) and puts it into a perl hash
I can either be called as a perl module or as a standalone script

#!/usr/local/bin/perl
######################################################################
# Purpose   : To parse a .xls file and store into a perl hash
# Author    : Billy N. Patton
# Original  : 16AUG2006
# Notes     : Each sheet will be a top level hash
# Input     :
# Changes   :
######################################################################
use Data::Dumper; $Data::Dumper::Indent = 1;
use Carp;
use Spreadsheet::ParseExcel;
use strict;
use warnings;

$| = 1;  # output auto flush


######################################################################
## use module as a standalone script
######################################################################
if ( !defined caller )
{
   XHelp("2 arguments are required, recieved none") if scalar(@ARGV) == 0;
   XHelp("2 arguments are required, Only recieved " . scalar(@ARGV))
       if scalar(@ARGV) < 2;
   my $ifile = $ARGV[0];
   my $ofile = $ARGV[1];
   my %hash;
   XHelp("'$ifile' does not exist!") unless -f $ifile;
   my $ret = ExcelToHash::ExcelToHash($ifile,\%hash);
   croak "Unable to open file '$ofile' for writing!\n" unless open OUT , 
">$ofile";
   print OUT Dumper(\%hash);
   close OUT;
   exit $ret;
   sub XHelp
   {
     my ($msg) = @_;
     $_ = `pod2text $0`;
     print "\n\n$_\n\n";
     print "$msg\n" if defined $msg;
     exit 1;
   }
}

######################################################################
## Module ExcelToHash
######################################################################
package ExcelToHash;
use Exporter;
use vars qw(@EXPORT @ISA $VERSION);
$VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
@ISA = qw ( Exporter );
@EXPORT = qw ( ExcelToHash );

sub ExcelToHash
{
   my ($ifile,$hash) = @_;
   my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($ifile);
   print("Spreadsheet::ParseExcel::Workbook->Parse($ifile) 
failed!\n"),return(0) unless defined $oBook;
   my($iR, $iC, $oWkC);
   my $sheet_p   = undef;  # hold pointer to the current sheet
   my $sheet_n   = undef;  # hold name of current sheet
   my @column_names  = (); # hold the column names
   foreach $sheet_p (@{$oBook->{Worksheet}})
   {
     $sheet_n        = $sheet_p->{Name};
     #warn $sheet_n;
     $hash->{$sheet_n} = undef;
     $iR             = $sheet_p->{MinRow};
     @column_names   = ();
     for($iC = $sheet_p->{MinCol} ; defined $sheet_p->{MaxCol} && $iC <= 
$sheet_p->{MaxCol} ; $iC++)
     {
       $oWkC = $sheet_p->{Cells}[$iR][$iC];
       push @column_names , $oWkC->Value if defined $oWkC;
     }
     #print Dumper(\@column_names);
     for($iR = $sheet_p->{MinRow} + 1; defined $sheet_p->{MaxRow} && $iR 
<= $sheet_p->{MaxRow} ; $iR++)
     {
       for ($iC = 0; $iC < scalar(@column_names); $iC++)
       {
         $oWkC = $sheet_p->{Cells}[$iR][$iC];
         $hash->{$sheet_n}->{$iR+1}->{$column_names[$iC]} = $oWkC->Value 
if($oWkC);
       }
     }
   }
   return 1;
}

__END__

=head1 NAME

   ExcelToHash.pm  - converts an excel spread sheet to a perl hash As a 
module or standalone

=head1 SYNOPSIS

   As a standalone script
   ExcelToHash.pm my_sheets.xls my_hash.hash
   or
   as a callable module
   use Data::Dumper; $Data::Dumper::Indent = 1;
   use ExcelToHash;
   my %hash;
   my $ifile = 'something.xls';
   croak "ExcelToHash failed\n" unless ExcelToHash($ifile,\%hash);
   print Dumper(\%hash);

=head1 INPUT

   As a standalone
   Both are required
   1. .xls file
   2. output file for hash
   As a module
   1. .xls file
   2. pointer to hash table

=head1 DESCRIPTION

   NOTE : Row 1 of each sheet is presumed to be header information and 
those column names
          are used as keyword of the hash

   The following is an example of the output.
   The first layer are the sheet names
   The second layer are the row numbers
   the third layer is the column name
   The values are sheet->row->column
   $VAR1 = {
   'DrawnLayers' => {
     '2' => {
       'Design Rule Number' => '2',
       'Design Rule Level' => 'ACTIVE'
     }
   },
   'DesignRules' => {
     '4' => {
       'Layer' => 'NWELL',
       'Relation' => 'space with square corner',
       'Image' => 'Rule-1-NWELL-drawing.doc',
       'Rule Code' => '1B.',
       'Description' => '*NWELL spacing',
       'Drawing Size' => '420'
     },
     '3' => {
       'Layer' => 'SELF',
       'Relation' => 'width with square corner ',
       'Image' => 'Rule-1-NWELL-drawing.doc',
       'Rule Code' => '1A.',
       'Description' => '*NWELL width',
       'Drawing Size' => '420'
     },

   This is as generic as possible.  No names are hard coded.

=head1 AUTHOR

   Billy N. Patton
   bpatton@ti.com

=head1 ORIGINAL

   17AUG2006

=head1 CHANGES

=cut


------------------------------

Date: Mon, 08 Jan 2007 10:39:31 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: stalling server client program
Message-Id: <080120071039311138%jgibson@mail.arc.nasa.gov>

In article <1168047444.311981.54020@s80g2000cwa.googlegroups.com>,
deadpickle <deadpickle@gmail.com> wrote:

> This program is designed to transfer a file to a client. When i go to
> run the program It sends the file once then sits there. The file that
> is sent is not closed and there fore conatins no data. I'm not sure
> what the problem is.
> 
> client
> =================================

[client requesting and processing incoming records snipped]

> 
> Server
> ===============================
> use strict;
> use IO::Socket;
> my $sock = new IO::Socket::INET(
>                    LocalPort => '7890',  #port to bind socket to
>                    Proto     => 'tcp',
>                    Listen    => SOMAXCONN,
>                    Reuse     => 1);
> $sock or die "no socket :$!";
> my($new_sock, $c_addr, $buf);
> while (($new_sock, $c_addr) = $sock->accept()) {
>     my ($client_port, $c_ip) =
>                      sockaddr_in($c_addr);
>     my $client_ipnum = inet_ntoa($c_ip);
>     my $client_host =
>              gethostbyaddr($c_ip, AF_INET);
>     print "got a connection from: $client_host",
>           " [$client_ipnum]\n";
>     while (defined ($buf = <$new_sock>)) {
>         print $buf;
>     } 
> }
> 

Your server code shown above is not sending anything to the client. It
is only reading from the client and printing to the screen. Is this
your real server program?

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


------------------------------

Date: Mon, 08 Jan 2007 06:13:34 -0600
From: "Mumia W. (on aioe)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: To do parallel processing..
Message-Id: <entcq3$i3j$1@aioe.org>

On 01/08/2007 04:22 AM, rajendra wrote:
> Hello All,
> 
> I would like to know is it possible to process the array elements while the
> array itself if being updated(storing elements)  using some parallel
> processing technology in perl...
> 
> With Rgds,
> Raj
> 
> 

 From "perldoc perlsyn":
> If any part of LIST is an array, "foreach" will get very confused if 
> you add or remove elements within the loop body, for example with 
> "splice".   So don't do that.


Nonetheless it's probably possible depending upon the situation and the 
program.

Since you didn't show any program, it's not possible for me to comment 
further.


-- 
paduille.4060.mumia.w@earthlink.net
Windows Vista and your
freedom in conflict: http://www.badvista.org/
http://home.earthlink.net/~mumia.w.18.spam/


------------------------------

Date: 08 Jan 2007 16:50:24 GMT
From: xhoster@gmail.com
Subject: Re: To do parallel processing..
Message-Id: <20070108115157.485$93@newsreader.com>

"rajendra" <rajendra.prasad@in.bosch.com> wrote:
> Hello All,
>
> I would like to know is it possible to process the array elements while
> the array itself if being updated(storing elements)  using some parallel
> processing technology in perl...

Not natively, but there are many ways to achieve effectively the same
thing.  Maybe Thread::Queue would suit you.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Mon, 8 Jan 2007 05:48:40 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: using 'Not' while greping using regex
Message-Id: <slrneq4bso.8mj.tadmc@tadmc30.august.net>

Kimi <shafa.fahad@gmail.com> wrote:

> I would like to know how to use 'Not' option while grepping using regex

> cat File1.txt | grep '\error' ----> returns both the lines which has
> error


This is the Perl newsgroup.

Did you mean to ask something regarding Perl?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 8 Jan 2007 11:54:54 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: using 'Not' while greping using regex
Message-Id: <50epoeF1eq4n9U1@mid.dfncis.de>

Kimi <shafa.fahad@gmail.com> wrote in comp.lang.perl.misc:
> Hi,
> 
> I would like to know how to use 'Not' option while grepping using regex

Your question is (apparently) about the Unix utility "grep".  It
has nothing to do with Perl.

> I have a file "File1.txt" whose contents are as below
> 
> ----
> INFO: error did not occur
> ERROR: an error has occured
> INFO: the machine has been started
> ---
> 
> cat File1.txt | grep '\error' ----> returns both the lines which has
> error

Why do you cat File.text before you give it to grep?  What is the
backslash before "error" for?  Why quote "error"?  Your command is
better written as

    grep error File1.txt

> I would like to retrieve only the lines which has "error" but not
> "Info"

Your file doesn't contain the string "Info".

    grep error File1.txt | grep -v INFO

Anno


------------------------------

Date: 8 Jan 2007 04:52:37 -0800
From: "Kimi" <shafa.fahad@gmail.com>
Subject: Re: using 'Not' while greping using regex
Message-Id: <1168260757.470058.159070@38g2000cwa.googlegroups.com>

Hi,

Thanks for the help...

I am firing unix command from my Perl script.... sorry that i have
posted in here.

regards,
Kimi


On Jan 8, 4:54 pm, anno4...@radom.zrz.tu-berlin.de wrote:
> Kimi <shafa.fa...@gmail.com> wrote in comp.lang.perl.misc:
>
> > Hi,
>
> > I would like to know how to use 'Not' option while grepping using regexYour question is (apparently) about the Unix utility "grep".  It
> has nothing to do with Perl.
>
> > I have a file "File1.txt" whose contents are as below
>
> > ----
> > INFO: error did not occur
> > ERROR: an error has occured
> > INFO: the machine has been started
> > ---
>
> > cat File1.txt | grep '\error' ----> returns both the lines which has
> > errorWhy do you cat File.text before you give it to grep?  What is the
> backslash before "error" for?  Why quote "error"?  Your command is
> better written as
>
>     grep error File1.txt
>
> > I would like to retrieve only the lines which has "error" but not
> > "Info"Your file doesn't contain the string "Info".
> 
>     grep error File1.txt | grep -v INFO
> 
> Anno



------------------------------

Date: Mon, 08 Jan 2007 13:09:51 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: using 'Not' while greping using regex
Message-Id: <zoroh.1958$us1.1778@trndny04>

Kimi wrote:
> I would like to know how to use 'Not' option while grepping using
> regex

You just do. The first argument to grep() can be a general expression, it is 
not limited to a regex only.
    grep (not /...../, .....)

> cat File1.txt | grep '\error' ----> returns both the lines which has
> error

This does not look like Perl code?

jue 




------------------------------

Date: 8 Jan 2007 07:40:59 -0800
From: ajsiegel@optonline.com
Subject: Re: Xah's Edu Corner: Introduction to 3D Graphics Programing
Message-Id: <1168270858.969940.282070@42g2000cwt.googlegroups.com>

Xah Lee wrote:
> Here's their license:
> http://www.vpython.org/webdoc/visual/license.txt
>
> I read it wrong before.
> Thanks for correction.
>
> This is superb! I'll be looking into vpython!
>
>  Xah

Of course it does what it does by resort to OpenGL and C++, so is part
of the problem ;)

I am looking forward to your tutorial efforts, and hoping those efforts
can be accessed without exposure to too much polemics.  Though if that
is the price of admission, that is the price of admission.

BTW, VPython is most of the way through a 4.xxx release which provides
some nice additional functionality to the 3.xx series core - like
transparency and texturing.  Problem being the the lead developer has
graduated and moved on, and the NSF funding that had supported the
effort has run out.

And the core folks around the project are either science educators or
Python folks - there is little C++ expertise currently involved with
the project.

The project is looking for help.

Anyone willing to jump in should perhaps reply here or at:


visualpython-users@lists.sourceforge.net

Art



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 7
************************************


home help back first fref pref prev next nref lref last post