spaces in file name

2009-06-18 Thread Irfan Sayed
Hi All, I am stuck on parsing file name if it has space. I have file name as : file system.proj now this file contains space between worf file and system   now i want to do ceratin operation on this file but whenever i give this file name in any command then it fails saying that file does not ex

Re: Replace pattern with a variable num of spaces

2009-06-18 Thread Steve Bertrand
John W. Krahn wrote: > Steve Bertrand wrote: >> I wasted about two hours of my coding time trying to come up with a >> special JAPH, but I just haven't been able to make map() do what I think >> it should do ;) > > What did you think it should do? What did you want it to do? Originally, I was t

perldoc perlboot

2009-06-18 Thread Dave Tang
Hello, I've been going through perldoc perlboot and I have a question about using the SUPER class. Here's the code in the documentation: #!/usr/bin/perl use strict; use warnings; { package Animal; sub speak { my $class = shift; print "a $class goes ", $class->sound, "!\n";

Re: spaces in file name

2009-06-18 Thread Steve Bertrand
Irfan Sayed wrote: > Hi All, > > I am stuck on parsing file name if it has space. > I have file name as : file system.proj > now this file contains space between worf file and system > > now i want to do ceratin operation on this file > but whenever i give this file name in any command then it

"list the user working on a single file"

2009-06-18 Thread Ajay Kumar
Hi all I have one requirement that Suppose I have one file sample.txt I just want one mail if anybody touch this file Can you guys suggest me how I can implement this ? Your suggestion would be appreciated Thanks in advanced

Re: file handle in perl

2009-06-18 Thread perl pra
you can also Tie::File. On Wed, Jun 17, 2009 at 2:42 PM, Irfan Sayed wrote: > Hi All, > > I am struggling with file handling in perl. i want to do following > operation . > > 1: open the file > 2: read the file > 3: do the changes in specific lines > 4: save the file > 5: close the file > > i am

AW: perldoc perlboot

2009-06-18 Thread Thomas Bätzler
Dave Tang asked: > I've been going through perldoc perlboot and I have a question about > using the SUPER class. Here's the code in the documentation: > > #!/usr/bin/perl > > use strict; > use warnings; > > { > package Animal; > sub speak { >my $class = shift; >print "a

Re: "list the user working on a single file"

2009-06-18 Thread Steve Bertrand
Ajay Kumar wrote: > Hi all > I have one requirement that > Suppose I have one file sample.txt > > I just want one mail if anybody touch this file > Can you guys suggest me how I can implement this ? Here's a very quick and dirty implementation of a program that will loop in a check/sleep cycle. I

Re: "list the user working on a single file"

2009-06-18 Thread Raymond Wan
Hi Ajay, Ajay Kumar wrote: Hi all I have one requirement that Suppose I have one file sample.txt I just want one mail if anybody touch this file Can you guys suggest me how I can implement this ? In addition to Steve's code, if you are using a Linux/Unix system, you can make his script run

Re: spaces in file name

2009-06-18 Thread Chas. Owens
On Thu, Jun 18, 2009 at 03:14, Irfan Sayed wrote: > Hi All, > > I am stuck on parsing file name if it has space. > I have file name as : file system.proj > now this file contains space between worf file and system > > now i want to do ceratin operation on this file > but whenever i give this file n

RE: "list the user working on a single file"

2009-06-18 Thread Ajay Kumar
Thanks a lot -Original Message- From: Steve Bertrand [mailto:st...@ibctech.ca] Sent: Thursday, June 18, 2009 3:01 PM To: Ajay Kumar Cc: beginners@perl.org Subject: Re: "list the user working on a single file" Ajay Kumar wrote: > Hi all > I have one requirement that > Suppose I have one fi

Re: "list the user working on a single file"

2009-06-18 Thread Chas. Owens
On Thu, Jun 18, 2009 at 05:37, Raymond Wan wrote: > > Hi Ajay, > > Ajay Kumar wrote: >> >> Hi all >> I have one requirement that >> Suppose I have one file sample.txt >> >> I just want one mail if anybody touch this file >> Can you guys suggest me how I can implement this ? > > > In addition to Ste

Re: POD, and coding techniqes

2009-06-18 Thread Chas. Owens
On Wed, Jun 17, 2009 at 08:24, Steve Bertrand wrote: > Hi all, > > One of the things that came out of my last thread was my lack of > documentation, so now I'm keeping the documentation up-to-date as I make > code changes. > > I'm trying to come up with a decent layout for this. Tentatively, it > l

Google CGI API

2009-06-18 Thread Mimi Cafe
Has anyone knowledge of the same of the Google API which will enable me send request to their search engine programmatically? Google offer many APIs on their website, but I could not find the right one for me task. Thanks Mimi -Original Message- From: dan [mailto:d...@entropy.homelinux

Re: Replace pattern with a variable num of spaces

2009-06-18 Thread John W. Krahn
Steve Bertrand wrote: John W. Krahn wrote: Steve Bertrand wrote: +sub is_word ($) { +return unless defined $_[0] && $_[0] ne ''; +return if $_[0] =~ /[\w\s]+/; +return 1; +} The other is_* functions in that module use anchors with their regular expressions so you probably should

Re: Google CGI API

2009-06-18 Thread John Refior
On Thu, Jun 18, 2009 at 10:27 AM, Mimi Cafe wrote: > Has anyone knowledge of the same of the Google API which will enable me > send > request to their search engine programmatically? > > Google offer many APIs on their website, but I could not find the right one > for me task. > I don't have any

word substitute with character count.

2009-06-18 Thread Nisse Tuta
Hi all, I'm having a problem solving this one. I need to replace/substitute a word in a text file. The problem is that i need to keep the same amount of characters as the replaced word. This is for replacing words in a template/postscript file that I use for printing labels. After upgrading t

Re: word substitute with character count.

2009-06-18 Thread Gunnar Hjalmarsson
Nisse Tuta wrote: I need to replace/substitute a word in a text file. The problem is that i need to keep the same amount of characters as the replaced word. my $oldword = 'hello'; my $newword = 'hi'; my $length_old = length $oldword; my $replace = length $newword < length $o

Re: word substitute with character count.

2009-06-18 Thread John W. Krahn
Nisse Tuta wrote: Hi all, Hello, I'm having a problem solving this one. I need to replace/substitute a word in a text file. The problem is that i need to keep the same amount of characters as the replaced word. This is for replacing words in a template/postscript file that I use for printi