Re: Help needed with '-e' operator

2009-07-09 Thread Robert Citek
On Wed, Jul 8, 2009 at 6:57 PM, John Refiorjref...@gmail.com wrote: On Wed, Jul 8, 2009 at 7:34 AM, Anu P anurao_...@yahoo.com wrote: I am trying to use the '-e' filetest operator and encountered some wired behavior. I have a tar.gz file which is around 2.6 G and this is the code...Tar.gz

Re: Help needed with '-e' operator

2009-07-09 Thread Anu P
Hi Robert, I am sorry for the typos in the mail.. Actually the file is tar.gz only, Tar.gz was a typo, and secondly the error message was still showing as file.tar.gz does not exist but again it was a mistake from my end. Actually your response helped me get the solution. I figured out that

Edit a config file using perl cgi script

2009-07-09 Thread Alpesh Naik
Hi, I need to edit a config file using perl cgi script. i.e., Search with the 'key' string and edit the 'value'. For eg: below is what I have in the config file configfile.cfg. Key1=OldValue1 Key2=OldValue2 I want to search for Key1 and change OldValue1 to NewValue1 *(Note that, permission

Re: Edit a config file using perl cgi script

2009-07-09 Thread Jenn G.
On Thu, Jul 9, 2009 at 5:34 PM, Alpesh Naiknaik.alp...@gmail.com wrote: For eg: below is what I have in the config file configfile.cfg. Key1=OldValue1 Key2=OldValue2 I want to search for Key1 and change OldValue1 to NewValue1 Read the content into memory, search the key (i.e, use a regex)

Re: Edit a config file using perl cgi script

2009-07-09 Thread Eric Veith
sudo perl -e 'open($fh, , /tmp/foo); @f = $fh; close($fh); open($fh, , /tmp/foo); foreach(@f) { s/^(Key1=).*/$1NewValue1/; print $fh $_; } close($fh);' As always, TIMTOWTDI. HTH, -- Eric, Alpesh Naik naik.alp...@gmail.com wrote on 07/09/2009 11:34:43 AM: From: Alpesh Naik

Re: Edit a config file using perl cgi script

2009-07-09 Thread Eric Veith
A config file in /etc is just another data file. Your problem has nothing to do with Perl itself, as it seems. You need to look up how to configure your web server to allow suexec for a script. And, normally, it is not a good idea to let the webserver edit files in /etc, but you'll probably know

Re: Edit a config file using perl cgi script

2009-07-09 Thread Randal L. Schwartz
Eric == Eric Veith erve...@de.ibm.com writes: Eric sudo perl -e 'open($fh, , /tmp/foo); @f = $fh; close($fh); open($fh, Eric , /tmp/foo); foreach(@f) { s/^(Key1=).*/$1NewValue1/; print $fh $_; } Eric close($fh);' Eric As always, TIMTOWTDI. Much easier way is in-place editing: perl -pi.bak -e

Help Me

2009-07-09 Thread Umar Draz
Dear User! I want to get all telephone and mobile number from a string and save into a variable. Here is my example what i am doing. #!/usr/bin/perl $str = This is my string my mobile number is 0300-4459899, 042-8494949 041-8580880 now the string is complete while($line =~

Re: Help Me

2009-07-09 Thread Steve Bertrand
Umar Draz wrote: Dear User! I want to get all telephone and mobile number from a string and save into a variable. Here is my example what i am doing. #!/usr/bin/perl $str = This is my string my mobile number is 0300-4459899, 042-8494949 041-8580880 now the string is complete

Re: Help Me

2009-07-09 Thread Chas. Owens
On Thu, Jul 9, 2009 at 15:18, Umar Drazi_deb...@yahoo.com wrote: Dear User! I want to get all telephone and mobile number from a string and save into a variable. Here is my example what i am doing. #!/usr/bin/perl $str = This is my string my mobile number is 0300-4459899, 042-8494949

Need some module help

2009-07-09 Thread Travis Thornhill
I'm trying to learn to develop Perl modules in an effort to have clean directory structure and more reusable code. I'm hitting a little snag in my test code that I don't quite understand. I'm hoping someone can help explain where I may be going wrong here. The error I'm receiving is this:

Re: Need some module help

2009-07-09 Thread Chas. Owens
On Fri, Jul 10, 2009 at 00:58, Travis Thornhillmadslashers2...@yahoo.com wrote: snip Can't locate object method new via package myMod (perhaps you forgot to load myMod?) at uses_Mod.pl line 11. snip my $obj = myMod-new(); # - THIS IS THE LINE THAT ERRORS snip package Mod::myMod; snip The

Re: Need some module help

2009-07-09 Thread Jim Gibson
At 9:58 PM -0700 7/9/09, Travis Thornhill wrote: I'm trying to learn to develop Perl modules in an effort to have clean directory structure and more reusable code. I'm hitting a little snag in my test code that I don't quite understand. I'm hoping someone can help explain where I may be going