parsing website and building xml file

2007-10-18 Thread Siva Prasad
Hi Gurus, I have the webpage as below, COMPUTER COURSES BIOLOGY . . .. . Now I want to parse this webpage and build xml file like below COMPUTER COURSES CS 162

Re: Filtering output of readdir

2007-10-18 Thread Paul Lalli
On Oct 18, 4:53 pm, [EMAIL PROTECTED] (Chas. Owens) wrote: > Also, don't use > dirhandles if you are just going to use readdir in list context. > dirhandles are for iterative reading. Use a glob to get a list: First time I've ever heard that piece of advice. Can't understand why you'd give it.

Re: Search for IP address and delete from file

2007-10-18 Thread Matthew Whipple
> > > mv $TMP_FILE $FILE_NAME > > > > Be careful, the 192.168.0.0 can also match a line with 192.168.010 in > > it. See also the -F option of grep. > > > > -- > > Affijn, Ruud > > > > "Gewoon is een tijger." > > > > Good point, bad example (although natural continuation of previous > discuss

Re: Overlapping substitution

2007-10-18 Thread Dr.Ruud
Kevin Viel schreef: > [.] matches . > [?] matches ? > [*] matches * > > Can they be combined? > > [.*] Yes, and that looks better than (?:\.|\*), but could actually be somewhat slower. (not slower in Perl 5.10 though) -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL

Re: Search for IP address and delete from file

2007-10-18 Thread Matthew Whipple
On Fri, 2007-10-19 at 01:55 +0200, Dr.Ruud wrote: > yitzle schreef: > > > If you are on a Linux machine, it might just be easier > > to use the grep command with a shell script. > > > > FILE_NAME="./log" > > TMP_FILE="./tmp" > > IP_TO_REMOVE="192.168.0.0|192.168.0.255" > > > > COUNT=`grep $IP_TO_R

Re: Search for IP address and delete from file

2007-10-18 Thread Dr.Ruud
yitzle schreef: > If you are on a Linux machine, it might just be easier > to use the grep command with a shell script. > > FILE_NAME="./log" > TMP_FILE="./tmp" > IP_TO_REMOVE="192.168.0.0|192.168.0.255" > > COUNT=`grep $IP_TO_REMOVE $FILE_NAME | wc -l` > echo "The IPs occur $COUNT times" > > grep

Re: Reading files for values

2007-10-18 Thread Matthew Whipple
Joseph L. Casale wrote: > I have to search for text strings in files and then do something with the > line that matches in one scenario and in another I need to store the contents > of the following n lines. > > In the first requirement I think I have it beat, but I am lost on the second. > I th

Re: Reading files for values

2007-10-18 Thread Gunnar Hjalmarsson
Joseph L. Casale wrote: I have to search for text strings in files and then do something with the line that matches in one scenario and in another I need to store the contents of the following n lines. In the first requirement I think I have it beat, but I am lost on the second. I thought I m

Reading files for values

2007-10-18 Thread Joseph L. Casale
I have to search for text strings in files and then do something with the line that matches in one scenario and in another I need to store the contents of the following n lines. In the first requirement I think I have it beat, but I am lost on the second. I thought I might be able to search for

RE: Filtering output of readdir

2007-10-18 Thread Joseph L. Casale
Thanks Chas and Tom, its working great. jlc -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Filtering output of readdir

2007-10-18 Thread Joseph L. Casale
@Tom, Thanks! @Chas, I am still *very* new to Perl, so can you enlighten me as to what I did wrong with the dir handle? When you say iterative reading, I am lost. This "globbing" does look simpler... As this turns out, it looks like I could just grep the output into an array making sure only i

Re: Overlapping substitution

2007-10-18 Thread Chas. Owens
On 10/18/07, Kevin Viel <[EMAIL PROTECTED]> wrote: snip > Are these character classes that have single elements? In other words: > > [.] matches . > [?] matches ? > [*] matches * > > Can they be combined? > > [.*] snip Yes, that last example is a character class that will match '.' or '*'. -- T

Re: Filtering output of readdir

2007-10-18 Thread Chas. Owens
On 10/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: > Hi All, > > I am needing to perform some work on files located in a directory. I am > reading > the contents of the directory in and but need to filter what's read in. So > far I > can filter out the "." and ".." but I need to add two mor

Re: Filtering output of readdir

2007-10-18 Thread Tom Phoenix
On 10/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: > I am needing to perform some work on files located in a directory. I am > reading > the contents of the directory in and but need to filter what's read in. So > far I can > filter out the "." and ".." but I need to add two more cases. I

RE: Overlapping substitution

2007-10-18 Thread Kevin Viel
> -Original Message- > From: Dr.Ruud [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 18, 2007 3:03 AM > To: beginners@perl.org > Subject: Re: Overlapping substitution > I started using "[.]" and "[?]" and "[*]" etc., in procmail recipes. Are these character classes that have single

Filtering output of readdir

2007-10-18 Thread Joseph L. Casale
Hi All, I am needing to perform some work on files located in a directory. I am reading the contents of the directory in and but need to filter what's read in. So far I can filter out the "." and ".." but I need to add two more cases. I need to make sure none of the entries in the array are dir

Re: Removing line return from variable - RESOLVED

2007-10-18 Thread unix
On Thu, October 18, 2007 2:47 pm, Chas. Owens wrote: > On 10/18/07, Paul <[EMAIL PROTECTED]> wrote: > snip >> The output is: >> text >> 0 > snip >> The function is like this: >> >> my$variable = (system "/usr/sfw/bin/openssl rsautl -decrypt -inkey >> private.pem -in cryptedfile") > s

Re: Removing line return from variable

2007-10-18 Thread Chas. Owens
On 10/18/07, Paul <[EMAIL PROTECTED]> wrote: snip > The output is: > text > 0 snip > The function is like this: > > my$variable = (system "/usr/sfw/bin/openssl rsautl -decrypt -inkey > private.pem -in cryptedfile") snip There is no way that $variable will have the data you want. Th

Re: printing elements of an arrays of references

2007-10-18 Thread Paul Lalli
On Oct 18, 11:44 am, [EMAIL PROTECTED] (Pedro Soto) wrote: > Dear all, > I am trying to make a matrix out of a file (row-columns) using perl. In > particular I would like to print the first row of an array of arrays which > contains the headings of the file. > I tried to do it but I can't print it.

Re: Removing line return from variable

2007-10-18 Thread Steve Bertrand
Steve Bertrand wrote: > Paul wrote: >> I am assigned the output of a function to a variable. >> >> my$variable = (function); >> print "$variable\n"; >> >> The output is: >> text >> 0 >> >> So I try this: >> >> chop my$variable = (function); >> print "$variable\n"; >> >> The output is: >> text >> **

Re: Removing line return from variable

2007-10-18 Thread Steve Bertrand
Paul wrote: > I am assigned the output of a function to a variable. > > my$variable = (function); > print "$variable\n"; > > The output is: > text > 0 > > So I try this: > > chop my$variable = (function); > print "$variable\n"; > > The output is: > text > *** this is blank space output * >

Re: Removing line return from variable

2007-10-18 Thread Paul
On Thu, October 18, 2007 11:20 am, Matthew Whipple wrote: > [EMAIL PROTECTED] wrote: >> On Thu, October 18, 2007 9:39 am, Matthew Whipple wrote: >> >>> Paul wrote: >>> I am assigned the output of a function to a variable. my$variable = (function); print "$variable\n";

Re: Removing line return from variable

2007-10-18 Thread Matthew Whipple
[EMAIL PROTECTED] wrote: > On Thu, October 18, 2007 9:39 am, Matthew Whipple wrote: > >> Paul wrote: >> >>> I am assigned the output of a function to a variable. >>> >>> my$variable = (function); >>> print "$variable\n"; >>> >>> The output is: >>> text >>> 0 >>> >>> So I try this: >>> >>> c

Re: Removing line return from variable

2007-10-18 Thread unix
On Thu, October 18, 2007 11:50 am, Rob Dixon wrote: > Paul wrote: >> I am assigned the output of a function to a variable. >> >> my$variable = (function); >> print "$variable\n"; >> >> The output is: >> text >> 0 >> >> So I try this: >> >> chop my$variable = (function); >> print "$variable\n"; >> >

Re: Removing line return from variable

2007-10-18 Thread unix
On Thu, October 18, 2007 9:39 am, Matthew Whipple wrote: > Paul wrote: >> I am assigned the output of a function to a variable. >> >> my$variable = (function); >> print "$variable\n"; >> >> The output is: >> text >> 0 >> >> So I try this: >> >> chop my$variable = (function); >> print "$variable\n";

Re: printing elements of an arrays of references

2007-10-18 Thread Chas. Owens
On 10/18/07, Pedro Soto <[EMAIL PROTECTED]> wrote: > Dear all, > I am trying to make a matrix out of a file (row-columns) using perl. In > particular I would like to print the first row of an array of arrays which > contains the headings of the file. > I tried to do it but I can't print it. If used

Re: printing elements of an arrays of references

2007-10-18 Thread Matthew Whipple
Pedro Soto wrote: > Dear all, > I am trying to make a matrix out of a file (row-columns) using perl. In > particular I would like to print the first row of an array of arrays which > contains the headings of the file. > I tried to do it but I can't print it. If used $AoA[0], I get the reference > t

Re: Removing line return from variable

2007-10-18 Thread Matthew Whipple
Paul wrote: > I am assigned the output of a function to a variable. > > my$variable = (function); > print "$variable\n"; > > The output is: > text > 0 > > So I try this: > > chop my$variable = (function); > print "$variable\n"; > > The output is: > text > *** this is blank space output * > > So

Re: Removing line return from variable

2007-10-18 Thread Rob Dixon
Paul wrote: I am assigned the output of a function to a variable. my$variable = (function); print "$variable\n"; The output is: text 0 So I try this: chop my$variable = (function); print "$variable\n"; The output is: text *** this is blank space output * So it get's rid of the "0", but

printing elements of an arrays of references

2007-10-18 Thread Pedro Soto
Dear all, I am trying to make a matrix out of a file (row-columns) using perl. In particular I would like to print the first row of an array of arrays which contains the headings of the file. I tried to do it but I can't print it. If used $AoA[0], I get the reference to the array.How can I deferenc

Removing line return from variable

2007-10-18 Thread Paul
I am assigned the output of a function to a variable. my$variable = (function); print "$variable\n"; The output is: text 0 So I try this: chop my$variable = (function); print "$variable\n"; The output is: text *** this is blank space output * So it get's rid of the "0", but outputs a new

Re: Configuring Apache::DBI in Apache2

2007-10-18 Thread Matthew Whipple
Subhash Chandran wrote: > Hi > > Can anyone help me to configure Apache::DBI to the Apache2 server. > System config: > OS Windows XP > Perl 5.8.8 > Apache 2.2.4 > mod_perl: 2.0.3 > Apache::DBI 1.06 > > I was able to make mod_perl and now the server is mod_perl enabled. But as > per the README

Re: RE

2007-10-18 Thread Chas. Owens
On 10/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > Comment me if there is any mistake of mine please? > Even the @weekdays doen't yield all the days instead it > yields the combination of three days... snip > my @weekdays = join '|', qw; > my @months = join '|', qw; snip That is b

Re: Sleep apnea

2007-10-18 Thread [EMAIL PROTECTED]
On Oct 16, 2:09 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > use FileHandle; The FileHandle module exists largely for reasons of backward compatibility. New code should: use IO::Handle; or use IO::File; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: local *FH

2007-10-18 Thread Dr.Ruud
"lists user" schreef: > I saw this code piece in perldoc perldata, > >sub newopen { >my $path = shift; >local *FH; # not my! >open (FH, $path) or return undef; >return *FH; >} >$fh = n

Re: Overlapping substitution

2007-10-18 Thread Dr.Ruud
"Chas. Owens" schreef: > The brackets are being used because some people find [.] easier to > read than \.. Yes, I do that for expressions that are not in a loop that runs a zillion times, this because in Perl up to 5.8.8 the "[.]" is a bit less fast than "\.". In Perl 5.10 this difference is gon

Re: OT: Problem Distributing my Perl Program

2007-10-18 Thread Inventor
Thanks to all for your kind responses. I'm a long time fan of Usenet from my college days in the 80's and 90's, and it is nice to know that the sense of community still thrives here. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.per