substitution problem

2003-10-23 Thread Steve Massey
Hi I though I had sussed this s/ stuff but #! /usr/bin/perl -w $test = "BRIGHTON (Firm)"; print "$test\n"; $test =~ s/,*/,/; $test =~ s/,*$/,/g; print "$test\n"; does not work, I want to substitute all multiple commas into a single one. any hel

RE: substitution problem

2003-10-23 Thread Steve Massey
Ok scrub that + works but * doesn't i'm guess the * is matching anything took me 2 hours to figure that ;) -Original Message- From: Steve Massey [mailto:[EMAIL PROTECTED] Sent: 23 October 2003 11:33 To: [EMAIL PROTECTED] Subject: substitution problem Hi I though I had sussed

Re: substitution problem

2003-10-23 Thread Gary Stainburn
On Thursday 23 Oct 2003 11:52 am, Steve Massey wrote: > Ok scrub that > > + works but * doesn't > > i'm guess the * is matching anything > > took me 2 hours to figure that ;) > Hi Steve, + matches 1 or more, * matches 0 or more. for better efficiency, you really want to do s/,,+/,/; which

Question on transliteration

2003-10-23 Thread Paul Harwood
Can someone translate into English: ($filename) = $file =~ m!([^/]*)$!; Why is $filename in parens?

Regex searches including spaces

2003-10-23 Thread Paul Harwood
I am trying to parse through the following line: TUITimer> TUI Dead Air Timer::1828ms:: I want to extract the 1828 value. The regex I have is: if ( /TUI Dead Air(\d+)/ ) { I know this is wrong but I have tried every variation of \s that I can think of with no success. Also, is there a Regex

Deleting # and other characters

2003-10-23 Thread Raghu Murthy
I tried using next if s?\([ /]\)\./?\1?g; and it did not work. The file looks like this a b ./zyc/dfdk ./dkld/kdj k l ./ksdk/ksk/ksd./kskd/kdsk Thanks _ Never get a busy signal because you are always connected with high

Re: Deleting # and other characters

2003-10-23 Thread Raghu Murthy
I tried doing the following next if s?\([ /]\)\./?\1?g; For some reason it is not removing the ./ from the file. Any suggestions are welcome. The file is in this format a b ./dsfj/dfl/dksl ./ksdfl/dsld c d ./sds/dsl/dksld ./kdf/ksd/ksdk Thanks Raghu In article <[EMA

Re: Regex searches including spaces

2003-10-23 Thread Gary Stainburn
On Thursday 23 Oct 2003 1:03 am, Paul Harwood wrote: > I am trying to parse through the following line: > > TUITimer> TUI Dead Air Timer::1828ms:: > > I want to extract the 1828 value. The regex I have is: > > if ( /TUI Dead Air(\d+)/ ) { > > I know this is wrong but I have tried every variation of

Tool for Tk developer?

2003-10-23 Thread EXTERN Chakirov Timour (TZ CIS; DS/ESQ3)
Hello there, I'm lookoing for a tool that I could use to sketch a Perl Tk GUI. Prefferable platform - Sun Solaris, but Windows is also Ok. Could you please tell me if such a tool exists? TIA, Tim --- Robert Bosch GmbH Tel:

DBMHashes , a question...

2003-10-23 Thread Jones, Jeremy
Hello All, are DBM Hashes a limited data structure? as in must they remain a standard hash and not %HoA or %HoH (Hash of array / Hash of Hash)? I have a program that should create a DBM hash %HoA but the only thing that remains is the Key. the array (Value does not get saved!) any thoughts?

Re: What is the best way to set options in a constructor

2003-10-23 Thread R. Joseph Newton
James Edward Gray II wrote: > > my $self; > > $self isn't a reference to a hash, even though you're about to start > using it like one. > > my $self = { }; > > > $self->{BOOL_1} = 0; > > $self->{BOOL_2} = 0; Actuaqlly, it will work the way he has it. The anonymous hash is auto-vivified on

Re: What is the best way to set options in a constructor

2003-10-23 Thread R. Joseph Newton
"Randal L. Schwartz" wrote: > > "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: > > Dan> my $class = ref($proto) || $proto; > > Don't do this! > > . Hi Randal, Read the article, and it percursor thread. I'm still a little mystified as to

Re: What is the best way to set options in a constructor

2003-10-23 Thread Randal L. Schwartz
> "R" == R Joseph Newton <[EMAIL PROTECTED]> writes: R> "Randal L. Schwartz" wrote: >> > "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: >> Dan> my $class = ref($proto) || $proto; >> >> Don't do this! >> >> . R> Hi Randal, R> Read the

RE: substitution problem

2003-10-23 Thread Wiggins d Anconia
> Ok scrub that > > + works but * doesn't > > i'm guess the * is matching anything > > took me 2 hours to figure that ;) > To de-mystify the regexes some have a look at: perldoc perlretut perldoc perlre http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

RE: Regex searches including spaces

2003-10-23 Thread Perry, Alan
Paul Harwood wrote: >I am trying to parse through the following line: > >TUITimer> TUI Dead Air Timer::1828ms:: > >I want to extract the 1828 value. The regex I have is: > >if ( /TUI Dead Air(\d+)/ ) { > >I know this is wrong but I have tried every variation >of \s that I can think of with no su

RE: DBMHashes , a question...

2003-10-23 Thread Bob Showalter
Jones, Jeremy wrote: > Hello All, > > are DBM Hashes a limited data structure? as in must they remain a > standard hash and not %HoA or %HoH (Hash of array / Hash of Hash)? Yes, but the MLDBM module is the answer here. It uses Storable (or other modules) to serialize the complex hash value into a

Re: Question on transliteration

2003-10-23 Thread Stefan Lidman
>Can someone translate into English: > >($filename) = $file =~ m!([^/]*)$!; > > >Why is $filename in parens? The parens put $filename in list context so that it contains whatever is after the last '/'. In scalar context it contains the number of times the regexp matched. /Stefan -- To unsubscrib

Re: trouble backup with perl.

2003-10-23 Thread Goffredo Saffioti
Wiggins d'Anconia ha scritto: Goffredo Saffioti wrote: Good Evening all . I'm experiencing to write a perl script for to make backup with afio under perl . But a have some problem when try to execute the system command with the " @_ " this seem to be not the right way for exec this system com

Re: What is the best way to set options in a constructor

2003-10-23 Thread Steve Grazzini
On Thu, Oct 23, 2003 at 06:48:29AM -0700, R. Joseph Newton wrote: > "Randal L. Schwartz" wrote: > > > "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: > > > > Dan> my $class = ref($proto) || $proto; > > > > Don't do this! > > I'm still a little mystified as to what you find offensive there.

Re: What is the best way to set options in a constructor

2003-10-23 Thread Randal L. Schwartz
> "Steve" == Steve Grazzini <[EMAIL PROTECTED]> writes: Steve> Now, I don't particularly like "$obj->new", but it's not really "wrong" Steve> either. If you want to let people call your constructor that way, then Steve> go ahead and use "ref($proto) || $proto". And conversely, if you think S

run in background from qx//?

2003-10-23 Thread McMahon, Chris
Hi... This should be easy, but I can't seem to do it. I'm trying to launch an external process from a Perl script to run in the background on a FreeBSD system. The process starts fine, but won't run in the background. I've tried: qx/ &/ qx/ \&/

Re: run in background from qx//?

2003-10-23 Thread Stefan Lidman
>Hi... >This should be easy, but I can't seem to do it. I'm trying to >launch an external process from a Perl script to run in the background on a >FreeBSD system. The process starts fine, but won't run in the background. >I've tried: > >qx/ &/ >qx/ \&/ >

RE: substitution problem

2003-10-23 Thread Mark Anderson
> From: Steve Massey [mailto:[EMAIL PROTECTED] > Sent: 23 October 2003 11:33 > > #! /usr/bin/perl -w > > $test = "BRIGHTON (Firm)"; > > > print "$test\n"; > $test =~ s/,*/,/; > $test =~ s/,*$/,/g; > > print "$test\n"; It looks like the +/* issue has bee

Re: What is the best way to set options in a constructor

2003-10-23 Thread Wiggins d Anconia
> > "Steve" == Steve Grazzini <[EMAIL PROTECTED]> writes: > > Steve> Now, I don't particularly like "$obj->new", but it's not really "wrong" > Steve> either. If you want to let people call your constructor that way, then > Steve> go ahead and use "ref($proto) || $proto". And conversely, if

RE: SMS messages from Windows

2003-10-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Rajendra Babu, Praveen wrote: > Hi there, >Did anyone send free SMS mobile messages from Perl under > Windows environment ? If yes, can you please share your "how to ?" > > Thanks heaps. > > Best regards, > Praveen You need only to know what provider you are going through and then

No dice;details . RE: run in background from qx//?

2003-10-23 Thread McMahon, Chris
Stefan... The line I'm trying to execute looks like: "/dir/dir2/program -a -a -B 5000 -c $var1 -d value $var2&" I'm trying to do this with 'system' and failing. How would you parse this run line for 'system' to execute? -Chris -Original Message- From

Re: Deleting # and other characters

2003-10-23 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Raghu Murthy wrote: > I tried doing the following > > next if s?\([ /]\)\./?\1?g; That looks to me more like sed (as best I can tell) and not Perl. > For some reason it is not removing the ./ from the file. Any suggestions > are welcome. > The file is in this fo

How to delete a file from the file system

2003-10-23 Thread Chinku Simon
Hi, Is there any module which has methods that can be used to delete a file from the filesystem in the windows NT environment. Thanks in Advance Chinku __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- To unsu

RE: How to delete a file from the file system

2003-10-23 Thread Bakken, Luke
H. Look at "perldoc -f unlink" > -Original Message- > > Hi, > > Is there any module which has methods that can be used to > delete a file from the filesystem in the > windows NT environment. > > Thanks in Advance > Chinku -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: No dice;details . RE: run in background from qx//?

2003-10-23 Thread Stefan Lidman
>Stefan... > The line I'm trying to execute looks like: > >"/dir/dir2/program -a -a -B 5000 -c $var1 -d value $var2&" > > I'm trying to do this with 'system' and failing. How would you >parse this run line for 'system' to execute? > -Chris system '/dir/dir2/program -a -

ftp file list filters?

2003-10-23 Thread Jeffrey Pearson
Im trying to write a script the ftp's a bunch of files from different locations. I only want to grab files that are of specific file type and whose name begins with a certain combination of characters. Can I filter it at the listing side in other words do something like dir abc*.gif and go throu

Re: ftp file list filters?

2003-10-23 Thread Wiggins d Anconia
> Im trying to write a script the ftp's a bunch of files from different locations. I only want to grab files that are of specific file type and whose name begins with a certain combination of characters. Can I filter it at the listing side in other words do something like dir abc*.gif and go thro

RE: SMS messages from Windows

2003-10-23 Thread Rajendra Babu, Praveen
Thanks David ! I reckon the mobile should be capable to receive e-mails rather than SMS ?? Please correct me if I am wrong. Regards, Praveen -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, 24 October 2003 2:06 AM To: Ra

Re: trouble backup with perl.

2003-10-23 Thread Wiggins d'Anconia
Goffredo Saffioti wrote: Ok your script work fine, but my problem still persist, because the work directory is too big so i need to do backup on more little portion of dir , i attempt to process i wish to process $backup_dir/2 or /4 how can do it? Which part of the process is failing because

RE: SMS messages from Windows

2003-10-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Rajendra Babu, Praveen wrote: > Subject: RE: SMS messages from Windows > > > Thanks David ! I reckon the mobile should be capable to receive > e-mails rather than SMS ?? Please correct me if I am wrong. > > Regards, > Praveen > I send to my cell phone which I assume is what you are afte

passing DOS command in perl

2003-10-23 Thread Trina Espinoza
Trying to send a DOS command using perl, but get a little confused as to how this changes when passing this in as a system call in perl. The DOS command: C:\>del /q /S "c:\Documents and Settings\test\Local Settings\Temp\*.*" When I run the command in perl I try escaping the second set of quotes

Re: passing DOS command in perl

2003-10-23 Thread Wiggins d'Anconia
Trina Espinoza wrote: Trying to send a DOS command using perl, but get a little confused as to how this changes when passing this in as a system call in perl. The DOS command: C:\>del /q /S "c:\Documents and Settings\test\Local Settings\Temp\*.*" When I run the command in perl I try escaping th

Re: substitution problem

2003-10-23 Thread R. Joseph Newton
Steve Massey wrote: > Hi > > I though I had sussed this s/ stuff but > > #! /usr/bin/perl -w > > $test = "BRIGHTON (Firm)"; > > print "$test\n"; > $test =~ s/,*/,/; > $test =~ s/,*$/,/g; > > print "$test\n"; > > does not work, I want to substitute all m

Re: What is the best way to set options in a constructor

2003-10-23 Thread R. Joseph Newton
"Randal L. Schwartz" wrote: > > "R" == R Joseph Newton <[EMAIL PROTECTED]> writes: > > R> "Randal L. Schwartz" wrote: > >> > "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: > >> > Dan> my $class = ref($proto) || $proto; > >> > >> Don't do this! > >> > >>