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]
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
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,
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 $
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)=$_
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
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)"
"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
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
"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
> -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
> -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/\\/\//;
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
> -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
> -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
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
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
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
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
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$' );
>
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,
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
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
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
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
> -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
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
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
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
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)
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
>> 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
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)
> 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
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
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
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
--- 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
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
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
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
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]
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
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
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
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
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
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'
> 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
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
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
51 matches
Mail list logo