change \ to /

2001-10-25 Thread Konstantin Berman
Hi. All I want is to change \ to / . The \ is in the variable $line, so I run the command: $line=~s/\\/\//; But it doesn't change anything. Can anyone please help? Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Regular expression help!!

2001-10-25 Thread Woz
Hi, I'm relatively new to the wonders of Perl programming and I've yet to quite get my head around regular expressions. I'm attempting to generate a search and replace expression that will turn the following string insert_job: DUKS_rtcf_daily_log_purge job_type: c into DUKS_rtcf

RE: Regular expression help!!

2001-10-25 Thread Robert Graham
Hi You can try the following: $line = "insert_job: DUKS_rtcf_daily_log_purge job_type: c"; ($rest) = $line =~ m/(\W\w.*)/; Regards Robert -Original Message- From: Woz [mailto:[EMAIL PROTECTED]] Sent: 25 October 2001 11:17 To: [EMAIL PROTECTED] Subject: Regular expression help!! Hi,

Re: change \ to /

2001-10-25 Thread RAHUL SHARMA
I tried by the same syntax. $line =~ s/\\/\//s; It works fine. - Original Message - From: Konstantin Berman <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 25, 2001 1:54 PM Subject: change \ to / > Hi. > All I want is to change \ to / . > The \ is in the variable $

RE: Regular expression help!!

2001-10-25 Thread Woz
Wow, that was fast! Thanks very much, that works well. For my next question (:-)) how can I make it strip the leading space that it leaves on the resulting string. i.e. I want it to strip 'insert_job: ' from the string - note the trailing space. At the moment I have: - ($Value)=$_

RE: Regular expression help!!

2001-10-25 Thread Robert Graham
You can use the following to remove the space in front $Value =~ /s/^\s+//; And for the sake of interest $Value =~ s/\s+$//; will remove any trailing spaces from a string Regards Robert Graham -Original Message- From: Woz [mailto:[EMAIL PROTECTED]] Sent: 25 October 2001 12:04 To: [EMA

Re: Regex query

2001-10-25 Thread pApA_rOACh
Try this in your cycl: foreach $x (keys %Replacements) { eval("\$inputstr =~ s/$x/$Replacements{$x}/g"); } Or somthing like this; feature to remember: $inputstr should not extends; we do this by \$inputstr but other variables shoul go. - Original Message - From: "Girish (Skyscape)"

Re: Newbie: Need string substitution

2001-10-25 Thread RaFaL Pocztarski
"José A. Ferrer" wrote: > I have a bunch of old xBase *.prg text files. I need to replace the > sentence ON ERROR or on error with *ON ERROR in all *.prg text files in a > given directory. > How can it be done in Perl ? Use this from the command line: perl -pi.bak -e 's/\bON ERROR\b/*ON ER

Hash Assignment

2001-10-25 Thread Heely, Paul
Hi, I'm creating a hash like this: %h = (a => 1, b => 2); I want to also be able to define a key 'c' in terms of value in a and b. I can do it in two lines: %h = (a => 1, b => 2); $h{c} = $h{a} + $h{b}; Is there any way to do this when creating the hash? %h = (a => 1, b => 2, c => a + b) I've

Re: workaround for unix2dos system command

2001-10-25 Thread RaFaL Pocztarski
"Rice, Elizabeth A." wrote: > on OS/390 there is no unix2dos command available. So, if I use the file as > is, it is sent in the email but it comes out with no carriage returns, etc., > making the file unreadable when it is of any significant size. You can use a simple oneliner in Perl to conve

RE: system() and STDOUT & STDERR

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Gupta, Ashish [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 3:21 AM > To: '[EMAIL PROTECTED]' > Subject: system() and STDOUT & STDERR > > > please help me solve another prob i am facing. > > i have 2 scripts --> a.pl and b.pl > both scripts h

RE: change \ to /

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Konstantin Berman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 4:25 AM > To: '[EMAIL PROTECTED]' > Subject: change \ to / > > > Hi. > All I want is to change \ to / . > The \ is in the variable $line, so I run the command: > $line=~s/\\/\//;

Re: change \ to /

2001-10-25 Thread Jos I. Boumans
make your code readable, try this: $line =~ s|\|/|; perhaps it's not working because you dont have the /s and /g modifiers? /s = read beyond newlines /g = chnage them all, not just the first hth, Jos - Original Message - From: "RAHUL SHARMA" <[EMAIL PROTECTED]> To: "Konstantin Berma

RE: change \ to /

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Jos I. Boumans [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 9:01 AM > To: RAHUL SHARMA; Konstantin Berman; [EMAIL PROTECTED] > Subject: Re: change \ to / > > > make your code readable, try this: > > $line =~ s|\|/|; Nope. You still need to

RE: change \ to /

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 9:16 AM > To: 'Jos I. Boumans'; [EMAIL PROTECTED] > Subject: RE: change \ to / > > Nope. /s only affects how ^ and $ match, which he isn't using. Nope to myself. /s affects how . match

Re: Regex query

2001-10-25 Thread Jeff 'japhy' Pinyan
On Oct 25, Girish (Skyscape) said: >%Replacements = ( >";s(\d)", "$1" > ,";b(\d)", "$1" >); Your problem is that these double-quoted strings get interpolated right here. "\d" is "d", and "$1" is whatever the value of $1 is at the time. You'll need to take a more involvi

Re: Regular expression help!!

2001-10-25 Thread Jeff 'japhy' Pinyan
On Oct 25, Woz said: >turn the following string > >insert_job: DUKS_rtcf_daily_log_purge job_type: c > >into > >DUKS_rtcf_daily_log_purge job_type: c > >i.e. remove from the beginning of the line up the space following the >first : You're probably trying s/.*: //; which is matching greed

RE: Regular expression help!!

2001-10-25 Thread Woz
Many thanks for the help Robert, those pointers were enough to give me a kickstart in the right direction and everything is working perfectly now! :-) Cheers, Woz -Original Message- From: Robert Graham Sent: Thu 25/10/2001 11:19 To: Woz

Quick question ...

2001-10-25 Thread Jason LaMar
I'm trying to modify the ubiquitous FormMail CGI scripts so that Web form results are sent ONLY to recipients on campus. Right now, there's a line to accomplish this for [EMAIL PROTECTED] e-mail addresses ... @validrecipients = ( '^[a-z]{1,}\@cc\.owu\.edu$' ); My question is: What code do I have

Re: Quick question ...

2001-10-25 Thread Jeff 'japhy' Pinyan
On Oct 25, Jason LaMar said: >I'm trying to modify the ubiquitous FormMail CGI scripts so that Web form >results are sent ONLY to recipients on campus. Right now, there's a line to >accomplish this for [EMAIL PROTECTED] e-mail addresses ... > >@validrecipients = ( '^[a-z]{1,}\@cc\.owu\.edu$' ); >

TTF problem with GD

2001-10-25 Thread Beau E. Cox
I'm trying to produce truetype text in an image using GD. All I get is junk text output (please see http://beaucox.com/_test_/gd/ttf.html). All characters are mono-spaced "boxes"!!!?? The code is: ... my @bounds = $img->stringTTF ($black,"verdana.ttf", 12, 0,

Re: apache can't run cgi scripts

2001-10-25 Thread Michael D. Risser
On Wed, 2001-10-24 at 20:41, Jorge Rocha wrote: > Hi all!!! > > i'm new using perl, i downloaded a system. it uses PostgreSQL, DBI and > PG DBD. i have installed all ok, but when i try to run the index.cgi, it > sends an error message. error 403 forbidden, You don't have permission > to access /i

Re: Newbie: Need string substitution

2001-10-25 Thread "José A. Ferrer"
Thank you RaFal, That's the idea!! >Use this from the command line: > > perl -pi.bak -e 's/\bON ERROR\b/*ON ERROR/ig' *.prg > >it will process all *.prg files in current directory, making backups of >originals in .bak files. Is that what you need? -- To unsubscribe, e-mail: [EMAIL PROTECT

if statement question

2001-10-25 Thread Bradshaw, Brian
Hi list, I have some strange goings on in my code. and it might be the if statement. I have the code: if ($reason eq 'sale' && $method_of_payment != 'Purchase Order') { } else } I expect if $reason is 'sale' and $method_of_payment is "Visa" the if bleck will execute instead of the els

learning perl

2001-10-25 Thread Daniela Montiel Aguirre
hi!! i'm begginer in perl. i'm begining to learning this language ... could you tell me any link where i can learn this language?? with any manual ... where can i obtain the software to install it in my machine w95 or w2000?? could you tell me the general structure of this language?? where can i

RE: if statement question

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Bradshaw, Brian [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 11:14 AM > To: [EMAIL PROTECTED] > Subject: if statement question > > > Hi list, > > I have some strange goings on in my code. and it might be the > if statement. > > I have the

Re: Get MAC address from Win32 Machine

2001-10-25 Thread Tim Musson
Hey Mike, My MUA believes you used (X-Mailer not set) to write the following on Wednesday, October 24, 2001 at 5:01:29 PM. MR> Hi all -- MR> I need to gather the MAC address from some win32 MR> machines. Which module would you recommend? MR> Is Win32::NetAdmin the right one? I would probabl

Re: learning perl

2001-10-25 Thread Tim Musson
Hey Daniela, My MUA believes you used (X-Mailer not set) to write the following on Thursday, October 25, 2001 at 10:15:32 AM. DMA> where can i obtain the software to install it DMA> in my machine w95 or w2000?? www.activestate.com It comes with Doc's (perldoc, and c:\perl\html\index.html) DMA

RE: if statement question

2001-10-25 Thread Bradshaw, Brian
That fixed that. Too much Java nd PHP. Thanks Bob. -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 11:19 AM To: 'Bradshaw, Brian'; [EMAIL PROTECTED] Subject: RE: if statement question > -Original Message- > From: Bradshaw, Bria

no luck pie charts and perl

2001-10-25 Thread P lerenard
I tried this example, didn't work. In place of the picture I got nothing, but something was using the space. see the code do I miss anything? thank you Pierre use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $red = $im->colorAllocate(255,0,0)

Help...Perl CGI generating core file

2001-10-25 Thread Rajeev Nalluri
Hi, I had a cgi script in Perl. It takes few values in the HTML FORM from the user and then does database update and prints back the results on the webpage. Approximately 1 in 20 times, it is not working as it is supposed to do. It is giving 'Internal Server Error' and generating a core file. Ana

Re: workaround for unix2dos system command

2001-10-25 Thread Rice, Elizabeth A.
>> on OS/390 there is no unix2dos command available. So, if I use the file as >> is, it is sent in the email but it comes out with no carriage returns, etc., >> making the file unreadable when it is of any significant size. >You can use a simple oneliner in Perl to convert text files see >htt

Weekly list FAQ posting

2001-10-25 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)

no luck pie charts and perl

2001-10-25 Thread zentara
> tried this example, didn't work. In place of the picture I got nothing, >but something was using the space. >see the code do I miss anything? >thank you > >Pierre > use GD; > > # create a new image >$im = new GD::Image(100,100); ># allocate some colors >$red = $im->colorAllocate

Re: workaround for unix2dos system command

2001-10-25 Thread Jeff 'japhy' Pinyan
On Oct 25, Rice, Elizabeth A. said: >2- I get "Illegal Hexadecimal Digit '\' ignored" against the line that has >the regex. If I change the regexto s/\xa/\xda/g > then I no longer get this error, but still no output is given. This is >on OS/390 Unix. I'm not sure if EBCDIC is messing

spawn processes

2001-10-25 Thread Prachi Shroff
Hi! I want to spawn multiple instances of one perl program from another perl program. I could do it with Win32::Process::Create or Win32::Spawn (this is deprecated). I am working on Windows 2000. Now, the problem is, to "Create" a child process which is a perl program, I have to convert it to

Re: no luck pie charts and perl

2001-10-25 Thread tom poe
On Thursday 25 October 2001 12:04, zentara wrote: > > tried this example, didn't work. In place of the picture I got nothing, > >but something was using the space. > >see the code do I miss anything? > >thank you > > > >Pierre > > use GD; > > > > # create a new image > >$im = new GD::Image

Re: no luck pie charts and perl

2001-10-25 Thread Curtis Poe
--- tom poe <[EMAIL PROTECTED]> wrote: > Hi, Zentara: I fiddled [far more than one would expect], and used the > recently posted write to file format above, and it works with the top line, > "#! /usr/bin/perl -w". But, if I add "use strict;" at the top of the script, > I can't compile: > tomp

Re: no luck pie charts and perl

2001-10-25 Thread Rex Arul
If you declare the pragma, "use strictl" then you should declare all variables as my: my($im, $red, $blue); - Original Message - From: "tom poe" <[EMAIL PROTECTED]> To: "zentara" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 25, 2001 7:10 PM Subject: Re: no luck pie c

Re: no luck pie charts and perl

2001-10-25 Thread Mel Matsuoka
At 04:10 PM 10/25/2001 -0700, tom poe wrote: >Hi, Zentara: I fiddled [far more than one would expect], and used the >recently posted write to file format above, and it works with the top line, >"#! /usr/bin/perl -w". But, if I add "use strict;" at the top of the script, >I can't compile: >tom

wanted help in Selection of User Interface

2001-10-25 Thread Lok Group of companies
Hi, I am having learning Perl. I am in the process of selecting a complete Open Source environment for Development of common business application for the organisation. Perl is the language of choice as it is stable, documented and more importantly because of DBI. We cannot do away with xBase eit

Re: no luck pie charts and perl

2001-10-25 Thread tom poe
To everyone: Thanks! I think I want to use "use strict;" a lot more, now. This is a Good Thing. Tom -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: system() and STDOUT & STDERR

2001-10-25 Thread Gupta, Ashish
Thanks for your help ... Actually, I am running these on WNT. The scripts work fine on unix (after putting in the #!/usr/local/bin/perl -w line). But do not work correctly on WNT. b.pl is working fine. If I do not use a log file, then the output as shown on the screen is ok. It is only when I u

weird problem with forking

2001-10-25 Thread Maxim Goncharov
Hi all, I ran into the problem with forking and I am not able to figure out what happens. Here is the code (let's call the program server): $pid = open(HHH,"|- "); if($pid){ print HHH "something\n"; }else{ exec "client" } Notice that I do not call close(HHH) because I want the parent just t

need help with forking

2001-10-25 Thread Maxim Goncharov
Hi all, I ran into the problem with forking and I am not able to figure out what happens. Here is the code (let's call the program server): $pid = open(HHH,"|- "); if($pid){ print HHH "something\n"; }else{ exec "client" } Notice that I do not call close(HHH) because I want the parent just to

weird forks

2001-10-25 Thread Maxim Goncharov
Hi all, I ran into the problem with forking and I am not able to figure out what happens. Here is the code (let's call the program server): $pid = open(HHH,"|- "); if($pid){ print HHH "something\n"; }else{ exec "client" } Notice that I do not call close(HHH) because I want the parent just t

Re: Quick question ...

2001-10-25 Thread Ta Chien
additional comment, for the username can be any cases, what happen if you have username Abc_123 ?? well, . try this too: '[^@]+\@(cc\.)?owu\.edu$' Jeff 'japhy' Pinyan wrote: > On Oct 25, Jason LaMar said: > > >I'm trying to modify the ubiquitous FormMail CGI scripts so that Web form > >r

Chainging values in a hash..

2001-10-25 Thread Daniel Falkenberg
Hey List, I am working on a problem where I have a hash of a hash that need updating and to be writen back into a text file. At the moment the hash looks like this... %hash = ( 'Crud1' => { 'test1' => 'crud10', 'test2' => 'crud11'

Re: weird forks

2001-10-25 Thread smoot
> Maxim Goncharov <[EMAIL PROTECTED]> said: > I ran into the problem with forking and I am not able to figure out what > happens. Here is the code (let's call the program server): > > $pid = open(HHH,"|- "); > if($pid){ > print HHH "something\n"; > }else{ > exec "client" > } > > Notice that

RE: Chainging values in a hash..

2001-10-25 Thread Beau E. Cox
Hey Daniel, It seems you change only a single hash value: the value at key $hashname: $hash{$hashname}{'test1'}= "crud9"; Each hash within the major hash is independent (has its own storage.) To do what you want, you would have to: $hash{"Crud1'}{'test1'}= "crud9"; $hash{"Crud2'}{'test1'}= "c

Re: Using Perl to contol an FTP session

2001-10-25 Thread Ta Chien
I have something done for you already , follow this link : http://www.geocities.com/chien_ta/send_files.pl Gary Stainburn wrote: > Have a look at Net::FTP. it's a perl module to do just what you want > > On Wednesday 24 October 2001 4:39 pm, Eddie T Kayes wrote: > > I want to control an ftp se