Removing many files and subdirectories under a folrder

2004-10-04 Thread John
can the above be done with one perl function?

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread Denzil Kruse
Not a perl master, but can't you just do a: system("rm -r "); Is that what you mean? Denzil --- John <[EMAIL PROTECTED]> wrote: > can the above be done with one perl function? ___ Do you Yahoo!? Declare Yourself - Register online to vote today! h

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread John
I want a solution that will work on all platforms. I read in Lerning Perl that unlink <*> could delete all files. But what if i want to delete all files under a certain directory? will unlink <./mydir/*> work? - Original Message - From: "Denzil Kruse" <[EMAIL PROTECTED]> To: <[EMAIL PR

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread Sano Babu
On Mon, 4 Oct 2004 00:26:22 -0700 (PDT), Denzil Kruse <[EMAIL PROTECTED]> wrote: > Not a perl master, but can't you just do a: > > system("rm -r "); What if its windows system? blahhh... :-000ps..!! Moreover if it was some other **ix type system, I don't think the above code will smell right when

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread John
Well unlink <./mydir/*> worked as i expected for all the files but not directories. - Original Message - From: "Sano Babu" <[EMAIL PROTECTED]> To: "perlmailing List" <[EMAIL PROTECTED]> Sent: Monday, October 04, 2004 11:01 AM Subject: Re: Removing many files and subdirectories under a

array of hashes looping prob

2004-10-04 Thread Graeme McLaren
Hey all I'm stuck looping through an array of hashes, here is what I have: ## for my $a (@result){ for my $h (keys %$a){ $tst = "$h->{$a}"; } } ## @result contains a hashes, I can die it out ok... there is something wrong when I try looping and ass

RE: array of hashes looping prob

2004-10-04 Thread Graeme McLaren
Ok everyone I got it: for my $a (@result){ for my $h (keys %$a){ print "$h = $a->{$h} "; } } Cheers, G :) From: "Graeme McLaren" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: array of hashes looping prob Date: Mon, 04 Oct 2004 10:27:37 +0100 MIME-Version: 1.0 X-Originating-IP:

perl regex to array

2004-10-04 Thread Ramprasad A Padmanabhan
Hi, I have slightly a tricky situation, in my large program. I am trying the best to reproduce it I have a string like this $x='a{1}b{21}c{5}d'; # The numbers in the {} are random and are not of interest I want to access all elements from the string 'a' 'b' 'c' & 'd' How do I do it best ?

Net::SFTP and different port than 22

2004-10-04 Thread John
Can i define a different port than 22 ?

RE: Removing many files and subdirectories under a folrder

2004-10-04 Thread Bob Showalter
John wrote: > can the above be done with one perl function? No; you need to write a script. You might look at http://ppt.perl.org/commands/rm/index.html for an implementation of rm(1) in Perl. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-10-04 Thread West, William M
>William> My impression was that OO in Perl has historically been fraught >with >William> CPU overhead - this will change in Perl 6? (argument number 2) > >FUD FUD FUD. > >*All* late binding takes a bit of time. Perl caches what it can. > well, i'll be a mother's son! I figured that Perl had

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread Randal L. Schwartz
> "John" == John <[EMAIL PROTECTED]> writes: John> can the above be done with one perl function? use File::Path qw(rmtree); rmtree('/some/path/to/the/top'); -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>

Re: OT: Email syntax validation

2004-10-04 Thread Randal L. Schwartz
> "Gunnar" == Gunnar Hjalmarsson <[EMAIL PROTECTED]> writes: Gunnar> As a result of the thread "Check for valid email address", I have Gunnar> modified my emailsyntax() function to better conform to RFC 822. After Gunnar> all, I wouldn't like e.g. my contact form module to reject Randal when G

Re: Need Help with 'Out of Memory!' Error message situation

2004-10-04 Thread Jenda Krynicky
From: Tony Frasketi <[EMAIL PROTECTED]> > Hello group > I'm getting the following error message when running my Perl program: > > Out of Memory! > > The program reads in an ASCII file into a string variable $lines. Then > parses $lines looking for certain types of entities as follows... > >

Re: perl regex to array

2004-10-04 Thread Jenda Krynicky
From: Ramprasad A Padmanabhan <[EMAIL PROTECTED]> > I have slightly a tricky situation, in my large program. I am trying > the best to reproduce it > > > I have a string like this > $x='a{1}b{21}c{5}d'; > # The numbers in the {} are random and are not of interest > > I want to access all elem

RE: Removing many files and subdirectories under a folrder

2004-10-04 Thread Bob Showalter
Bob Showalter wrote: > John wrote: > > can the above be done with one perl function? > > No; you need to write a script. Oops, I guess you can do it in one function. Sorry 'bout that :~) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

SFTP failed to get a file from remote host

2004-10-04 Thread John
Here is the debug monster: sftp: Sent SSH2_FXP_OPEN I:1 P:/usr/local/apache/logs/access_log monster: sftp: Sent message SSH2_FXP_READ I:2 O:0 monster: sftp: Received reply T:103 I:2 monster: sftp: In read loop, got 8192 offset 0 monster: sftp: Sent message SSH2_FXP_READ I:3 O:8192 monster: channel

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread Sano Babu
On 04 Oct 2004 05:15:04 -0700, Randal L. Schwartz <[EMAIL PROTECTED]> wrote: > > "John" == John <[EMAIL PROTECTED]> writes: > > John> can the above be done with one perl function? > > use File::Path qw(rmtree); > rmtree('/some/path/to/the/top'); > If the directory has read-only permission s

Re: SFTP failed to get a file from remote host

2004-10-04 Thread Chris Devers
On Mon, 4 Oct 2004, John wrote: Here is the debug Where is the code ? Do you know what is going on here and why the get method fails? No. Where is the code ? -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Net::SFTP and different port than 22

2004-10-04 Thread Chris Devers
On Mon, 4 Oct 2004, John wrote: Can i define a different port than 22 ? I don't see anything about specifying a port in the Net::SFTP docs, but the underlying SSH protocol does provide support for this, so it should be possible. Have you tried specifying the port as part of the host name? my

Re: OT: Email syntax validation

2004-10-04 Thread Gunnar Hjalmarsson
Randal L. Schwartz wrote: "Gunnar" == Gunnar Hjalmarsson <[EMAIL PROTECTED]> writes: Gunnar> As a result of the thread "Check for valid email address", I have Gunnar> modified my emailsyntax() function to better conform to RFC 822. After Gunnar> all, I wouldn't like e.g. my contact form module to r

Re: OT: Email syntax validation

2004-10-04 Thread JupiterHost.Net
Again, why aren't you just using Email::Valid? I have already explained that: http://www.mail-archive.com/beginners%40perl.org/msg62450.html Faulty reasoning, the modules are available for public download to and if they don't have them they'll know it from the error you output about it informing

Re: Net::SFTP and different port than 22

2004-10-04 Thread Chris Devers
On Mon, 4 Oct 2004, Chris Devers wrote: On Mon, 4 Oct 2004, John wrote: Can i define a different port than 22 ? I don't see anything about specifying a port in the Net::SFTP docs, but the underlying SSH protocol does provide support for this, so it should be possible. Have you tried specifying t

RE: OT: Email syntax validation

2004-10-04 Thread Bob Showalter
Gunnar Hjalmarsson wrote: > Randal L. Schwartz wrote: > > Again, why aren't you just using Email::Valid? > > I have already explained that: > http://www.mail-archive.com/beginners%40perl.org/msg62450.html Interesting; if you visit that link, www.mail-archive.com evidently doesn't properly match R

Re: OT: Email syntax validation

2004-10-04 Thread Gunnar Hjalmarsson
JupiterHost.Net wrote: Again, why aren't you just using Email::Valid? I have already explained that: http://www.mail-archive.com/beginners%40perl.org/msg62450.html Faulty reasoning, the modules are available for public download to and if they don't have them they'll know it from the error you outpu

Re: Removing many files and subdirectories under a folrder

2004-10-04 Thread Jenda Krynicky
From: Sano Babu <[EMAIL PROTECTED]> > On 04 Oct 2004 05:15:04 -0700, Randal L. Schwartz > <[EMAIL PROTECTED]> wrote: > > "John" == John <[EMAIL PROTECTED]> writes: > > John> can the above be done with one perl function? > > use File::Path qw(rmtree); > > rmtree('/some/path/to/the/top'); >

Re: OT: Email syntax validation

2004-10-04 Thread Gunnar Hjalmarsson
Bob Showalter wrote: Gunnar Hjalmarsson wrote: Randal L. Schwartz wrote: Again, why aren't you just using Email::Valid? I have already explained that: http://www.mail-archive.com/beginners%40perl.org/msg62450.html Interesting; if you visit that link, www.mail-archive.com evidently doesn't properly

Re: Net::SFTP and different port than 22

2004-10-04 Thread John
I fixed that Here is the solution my $sftp = Net::SFTP->new($myhost, user=>"user", password=>"pass", debug=>0,ssh_args => [port =>145]) or die(); - Original Message - From: "Chris Devers" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent

perl.beginners Weekly list FAQ posting

2004-10-04 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: OT: Email syntax validation

2004-10-04 Thread JupiterHost.Net
Gunnar Hjalmarsson wrote: JupiterHost.Net wrote: Again, why aren't you just using Email::Valid? I have already explained that: http://www.mail-archive.com/beginners%40perl.org/msg62450.html Faulty reasoning, the modules are available for public download to and if they don't have them they'll kno

Re: perl regex to array

2004-10-04 Thread Jeff 'japhy' Pinyan
On Oct 4, Ramprasad A Padmanabhan said: > I have a string like this >$x='a{1}b{21}c{5}d'; ># The numbers in the {} are random and are not of interest > >I want to access all elements from the string 'a' 'b' 'c' & 'd' >How do I do it best ? I'd do: my @parts = split /{\d+}/, $string; -- Jeff

Re: sum a column

2004-10-04 Thread rmck
I tried the suggestion below, and it appears to have worked, thanks. I had to add a "print $sum !=" to inside and outside the while loop. Im not sure why it is working this way?? Also Im getting an error "Use of uninitialized value in string ne at ./clean1.pl line 28, line 1." ?? If anyone can

Re: OT: Email syntax validation

2004-10-04 Thread Gunnar Hjalmarsson
JupiterHost.Net wrote: Gunnar Hjalmarsson wrote: I hear that you have never distributed CGI scripts to people who You hear? From who? Who told! :) Well, that was the only explanation I could figure out to your firm opinion in the matter. typically have never heard of CPAN and don't have shell acces

Re: OT: Email syntax validation

2004-10-04 Thread JupiterHost.Net
When people undiscriminatingly advocate the use of modules whenever possible, I get unhappy. I'm using modules when I consider it to be suitable. Peace my friend, do whatever you want. It wasn't an attack, that's what the smiley's are for :) Chill chill chill ;p -- To unsubscribe, e-mail: [EMAIL P

Re: Need help with script

2004-10-04 Thread Paul Johnson
On Thu, Sep 30, 2004 at 04:44:36PM -0700, John W. Krahn wrote: > Paul Johnson wrote: > > > >>>On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > >>> > perl -l -00pe's/\n/\t/;s/\"//g;' FILENAME > > > >$ perl -MO=Deparse -l00pe's/\n/\t/;s/\"//g' > >BEGIN { $/ = "\n"; $\ = "\000"; } > > In y

Re: OT: Email syntax validation

2004-10-04 Thread Gunnar Hjalmarsson
JupiterHost.Net wrote: When people undiscriminatingly advocate the use of modules whenever possible, I get unhappy. I'm using modules when I consider it to be suitable. Peace my friend, do whatever you want. It wasn't an attack, that's what the smiley's are for :) I didn't think you were attacking

Re: OT: Email syntax validation

2004-10-04 Thread JupiterHost.Net
Gunnar Hjalmarsson wrote: JupiterHost.Net wrote: When people undiscriminatingly advocate the use of modules whenever possible, I get unhappy. I'm using modules when I consider it to be suitable. Peace my friend, do whatever you want. It wasn't an attack, that's what the smiley's are for :) I did

Can you help me design a perl class/classes ?

2004-10-04 Thread Graeme McLaren
Hey all .. I'm thinkin about writing a web application using perl and object oriented techniques. I want to start off small ... lets say I want to put together a company intranet and the part I want to implement first is staff profiles. Each profile would contain their email addres

speed of grep{s///} vs ??? or am i asking the wrong question?

2004-10-04 Thread West, William M
here's what works for me so far: #!/usr/bin/perl use strict; use warnings; sub get_subdirectories{ # retrieves list of directories from passed directory # returns directory list as an array my $directory = shift; open LS, "ls -l $directory|"; local $/ =

Serial Port Access

2004-10-04 Thread Tim Donahue
I'm looking for a module that will allow me to send/receive ascii data to a serial port. I have a program that will allow me to query its status over a serial connection, but I can't find a module on CPAN to handle the interface. Well, at least I'm not seeing one for *nix, I did find Win32API::Co

RE: speed of grep{s///} vs ??? or am i asking the wrong question?

2004-10-04 Thread Bakken, Luke
> #!/usr/bin/perl > > > use strict; > use warnings; > > sub get_subdirectories{ > # retrieves list of directories from passed directory > # returns directory list as an array > > my $directory = shift; > open LS, "ls -l $directory|"; > local $/ = undef; >

Re: Serial Port Access

2004-10-04 Thread Chris Devers
On Mon, 4 Oct 2004, Tim Donahue wrote: I'm looking for a module that will allow me to send/receive ascii data to a serial port. I have a program that will allow me to query its status over a serial connection, but I can't find a module on CPAN to handle the interface. Well, at least I'm not seein

Doubt

2004-10-04 Thread Sprogis, Rubens \(V-Emeritis\)
How can I do to concatenate 2 strings? *** Esta mensagem pode conter informacoes confidenciais e privadas. A nao ser que voce seja o destinatario (ou autorizado pelo destinatario para re

Re: Doubt

2004-10-04 Thread Errin Larsen
On Mon, 4 Oct 2004 18:33:51 -0300, Sprogis, Rubens (V-Emeritis) <[EMAIL PROTECTED]> wrote: > How can I do to concatenate 2 strings? > > Hi! Glad you are trying Perl! Welcome to the group! Let me offer you some advice. This mailing list works best when you write some of your own code, try it,

How can I do to concatenate 2 strings?, was Re: Doubt

2004-10-04 Thread Chris Devers
Please use a constructive subject line. On Mon, 4 Oct 2004, Sprogis, Rubens (V-Emeritis) wrote: How can I do to concatenate 2 strings? There are many ways to do it. Here's one of them: $foo = $a . $b; This should be introductory material in any beginner's Perl book. -- Chris Devers -- To unsub

CPAN

2004-10-04 Thread Bob Gordon
Hello! Anyone know how to remove a mirror from the list that CPAN uses? I would like to remove ftp://carroll.cac.psu.edu from the list as it keeps timing out Thanks! -- --==[ Bob Gordon ]==-- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

deleting a mirror from CPAN.pm, was Re: CPAN

2004-10-04 Thread Chris Devers
Please use a more descriptive subject line. On Mon, 4 Oct 2004, Bob Gordon wrote: Anyone know how to remove a mirror from the list that CPAN uses? I would like to remove ftp://carroll.cac.psu.edu from the list as it keeps timing out Do you have a file at ~/.cpan/CPAN/MyConfig.pm ? If so, it'

Re: deleting a mirror from CPAN.pm, was Re: CPAN

2004-10-04 Thread Bob Gordon
On Mon, 4 Oct 2004 19:04:09 -0400 (EDT), Chris Devers <[EMAIL PROTECTED]> wrote: > > Anyone know how to remove a mirror from the list that CPAN uses? I > > would like to remove ftp://carroll.cac.psu.edu from the list as it > > keeps timing out > > Do you have a file at ~/.cpan/CPAN/MyConfig.p

RE: array of hashes looping prob

2004-10-04 Thread Charles K. Clarkson
From: Graeme McLaren wrote: : Ok everyone I got it: : : for my $a (@result){ : : for my $h (keys %$a){ : : print "$h = $a->{$h} "; : } : } Avoid using $a and $b as variables. They are used by 'sort' and treated special by perl. Use descriptive var

Problems installing IPC::Run on Mac OS X 10.3.5

2004-10-04 Thread Michael Glaesemann
Hello! I'm having some difficulty installing IPC::Run on Mac OS X 10.3.5. perl -v returns This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level (with 1 registered patch, see perl -V for more detail) Interested parties can find perl -V output at the end of this email. I'm using CPANPLUS t

smtp support attach?

2004-10-04 Thread Adam Saeed
could any one tell me that SMTP::Net support attachment, if yes how it could be to do so... thanks -- Allah Hafiz O! God Thy sea is so great and my boat is so small. Adam -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How TO CREATE RUNTIME CONTROLS

2004-10-04 Thread Charles K. Clarkson
atul ashpalia <[EMAIL PROTECTED]> wrote: Please reply to the list. : Thanks in advance for your help. please find the : attached "filltasks.cgi". Why attached it? Show it inline. where it is easier to view. You are not using strict and warnings. How did you learn perl? use strict;