Re: Map out a directory heirarchy

2004-10-09 Thread John W. Krahn
Harry Putnam wrote: I want to get a daily list of all the directories under a kind of large (by home standards) news heirarchy. I know a little about using File::Find but wonder if there is a better way. Here are the things one runs into with File::Find. if you run it looking for type d (-d) direct

Re: A problem of pattern matching

2004-10-09 Thread John W. Krahn
Teng Wang wrote: I wanna match a specific pattern using grep(). My pattern has two parts: 1. exclude "." or ".." (to exclude the current and parent directory in unix) 2. the file type is jpg. The first pattern I am using is !/^\.\.?$/ The second is /\.jpg$/i How to combine them together? using t

Re: How to reinvent grep with perl?

2004-10-09 Thread Harry Putnam
"Siegfried Heintze" <[EMAIL PROTECTED]> writes: > This, works, but it sure is ugly. Is there not an easier way to do this with > perl? > > perl -e'@ARGV = ("-") unless @ARGV; while(@ARGV){ $ARGV= shift @ARGV; > if(!open(ARGV, $ARGV)){ warn "Cannot open $ARGV: $!\n"; next;} while > (){ print "$ARGV

Re: reflection in perl

2004-10-09 Thread Todd W
"Michael Seele" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi, > i'm new to perl and i want to know if perl has reflection like java? > how can i acces reflection and how powerfull is the reflection in perl? > thx mseele > Perls reflection support is probably my most favorite th

A problem of pattern matching

2004-10-09 Thread Teng Wang
I wanna match a specific pattern using grep(). My pattern has two parts: 1. exclude "." or ".." (to exclude the current and parent directory in unix) 2. the file type is jpg. The first pattern I am using is !/^\.\.?$/ The second is /\.jpg$/i How to combine them together? using two greps or a s

RE: How to reinvent grep with perl?

2004-10-09 Thread Siegfried Heintze
Perl works better than grep because the grep statement you give below does not find any instances of the pattern and perl finds quite a few. I'm using Cygwin on Win2003Server. Since there is something obviously wrong with my cygwin implementation of grep, how do I get the file names with perl? Thi

Re: How to reinvent grep with perl?

2004-10-09 Thread Harry Putnam
"Siegfried Heintze" <[EMAIL PROTECTED]> writes: > This works better than grep, except for the fact it does not print the file > name. How can I make perl print the file file name? How is it better than grep? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

Re: How to reinvent grep with perl?

2004-10-09 Thread Harry Putnam
"Siegfried Heintze" <[EMAIL PROTECTED]> writes: > My man pages and info pages are not working well and I cannot figure out how > to make grep search for a certain pattern. I even tried egrep and fgrep. So > how do I reinvent grep with perl? Here is my attempt: > > > > perl -n -e 'print "$. $_" i

Map out a directory heirarchy

2004-10-09 Thread Harry Putnam
I want to get a daily list of all the directories under a kind of large (by home standards) news heirarchy. I know a little about using File::Find but wonder if there is a better way. Here are the things one runs into with File::Find. if you run it looking for type d (-d) directories it still ta

Re: How to reinvent grep with perl?

2004-10-09 Thread Andrew Gaffney
Siegfried Heintze wrote: Andrew, Thanks. When I hit "n" to go to the next page, it says "No previous regular expression (press RETURN)". So I can only display the first page. I have it expanded to the full screen but I still cannot see the portion of the display that tells me how to use extended

Re: How to reinvent grep with perl?

2004-10-09 Thread Andrew Gaffney
Siegfried Heintze wrote: My man pages and info pages are not working well and I cannot figure out how to make grep search for a certain pattern. I even tried egrep and fgrep. So how do I reinvent grep with perl? Here is my attempt: There's no need. When you do 'man whatever', you can hit '/', type

How to reinvent grep with perl?

2004-10-09 Thread Siegfried Heintze
My man pages and info pages are not working well and I cannot figure out how to make grep search for a certain pattern. I even tried egrep and fgrep. So how do I reinvent grep with perl? Here is my attempt: perl -n -e 'print "$. $_" if /^ *END *$/' *.f This works better than grep, except fo

RE: Logical order to read perldocs

2004-10-09 Thread Bob Showalter
Steve Bertrand wrote: > I'm trying very hard to get a good grasp on OOP, references, complex > data structures etc. > > I just ordered Learning Perl Objects, References and Modules from > amazon.ca, and have been tredging through the perldoc documentation. > > After getting into a few of the page

Re: Logical order to read perldocs

2004-10-09 Thread Steve Bertrand
> Steve Bertrand wrote: >> I'm trying very hard to get a good grasp on OOP, references, complex >> data structures etc. >> >> I just ordered Learning Perl Objects, References and Modules from >> amazon.ca, and have been tredging through the perldoc documentation. >> >> After getting into a few of t

Re: Logical order to read perldocs

2004-10-09 Thread Wiggins d'Anconia
Steve Bertrand wrote: I'm trying very hard to get a good grasp on OOP, references, complex data structures etc. I just ordered Learning Perl Objects, References and Modules from amazon.ca, and have been tredging through the perldoc documentation. After getting into a few of the pages, it appears as

Logical order to read perldocs

2004-10-09 Thread Steve Bertrand
I'm trying very hard to get a good grasp on OOP, references, complex data structures etc. I just ordered Learning Perl Objects, References and Modules from amazon.ca, and have been tredging through the perldoc documentation. After getting into a few of the pages, it appears as though I get a cert

Re: pass a filehandle then use it in grep{}?

2004-10-09 Thread John W. Krahn
West, William M wrote: oddly- the grep documentation in perldoc doesn't even mention filehandles. readdir does show proper use though- readdir does not use a filehandle and therefore does not show the proper use of them. The opendir/readdir/rewinddir/seekdir/telldir/closedir functions all use d

Re: pass a filehandle then use it in grep{}?

2004-10-09 Thread John W. Krahn
West, William M wrote: my @array =grep {-d "$directory\/$_"} readdir ; gives me this error:: Type of arg 1 to readdir must be HANDLE (not ) at ./subdirs.pl line 30, near ";" Execution of ./subdirs.pl aborted due to compilation errors. The expression "readdir ;" is the same as "readdir readline LS2;

Re: Simple OO problem ... Updated

2004-10-09 Thread Randal L. Schwartz
> "Bee" == Bee <[EMAIL PROTECTED]> writes: Bee> use test::Foo; Please name your packages with an initial cap. Lowercase are reserved for pragmas. Bee> return bless $self; You're still needlessly avoiding the two-arg bless, which means your constructors cannot be inherited. Bee> PS. I

Re: Tcl/Tk training class

2004-10-09 Thread Randal L. Schwartz
> "William" == William Ampeh <[EMAIL PROTECTED]> writes: William> Can anyone recommend a Tcl/Tk training in DC/MD/VA? Why did you ask about *Tcl/Tk*, on a *Perl* list? Most people using Perl are using Perl/Tk, or Perl/Gtk, etc. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc.

Re: Copy image from one web server to another

2004-10-09 Thread Randal L. Schwartz
> "Nicolay" == Nicolay A Vasiliev <[EMAIL PROTECTED]> writes: Nicolay> Hallo, Chris! Nicolay> Oh, in this library "getstore" is more matching I suppose. In fact, "mirror" is even better, if it's an image that changes on a regular basis and you want a local copy. -- Randal L. Schwartz - Ston