Steve Bertrand wrote:
John W. Krahn wrote:
Steve Bertrand wrote:
[ snip ]
In the third line of the following code, I want the replacement pattern
to be (whitespace * $_[1]). I'll deal with the undef issue after I
figure out how to use {$num} on essentially nothing. I haven't been able
to make
John W. Krahn wrote:
> Steve Bertrand wrote:
[ snip ]
>> In the third line of the following code, I want the replacement pattern
>> to be (whitespace * $_[1]). I'll deal with the undef issue after I
>> figure out how to use {$num} on essentially nothing. I haven't been able
>> to make it work with
Steve Bertrand wrote:
I'm attempting to write a patch for a module that I feel I can use
within one of my own modules, and I've run into something that I can't
solve (I can't come up with the proper query in Google).
Perhaps code will help here. First, I know 'word' does not include
whitespace,
I'm attempting to write a patch for a module that I feel I can use
within one of my own modules, and I've run into something that I can't
solve (I can't come up with the proper query in Google).
Perhaps code will help here. First, I know 'word' does not include
whitespace, and I know that one shou
Rajini Naidu wrote:
> I am new to CGI scripting.
Get this book and work your way through it (I prefer Debian GNU/Linux):
http://www.wiley.com/legacy/compbooks/stein/
HTH,
David
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@p
On 6/16/09 Tue Jun 16, 2009 9:14 PM, "Rajini Naidu"
scribbled:
> Hi,
>
>
> I have the following code in my program.
>
> use strict;
> use warnings;
> use diagnostics;
> use Time::Local;
>
> my @match_list;
> my $days1 = "";
> my $days2 = "";
> my $day = "";
>
>
>
> if ($failtag eq "Compi
On Wed Jun 17 2009 @ 3:42, Ajay Kumar wrote:
> Hi Irfan
> You can do all four task like below
>
> 1: open FILE ,">filename.txt" or die$!;
> 2: my @lines=
> 3: do changes through sed
> Like sed -e 's/original pattern/new pattern/p' filename
> 4:if you did changes it automatically get saved
Irfan Sayed wrote:
Hi All,
Hello,
need help on regular expression.
i have string like this
"ProductName" = "8:EXFO RTU System 1.2.42"
now i want regular expression in such a way that it will change the line to :
"ProductName" = "8:EXFO RTU System 1.2.43"
$ perl -le'
$_ = q["ProductNa
There's actually even a perl function called "rename" that does just
this. Here's some good reading for you. Maybe from there you can
look up other stuff when you have questions.
http://perldoc.perl.org/functions/rename.html
Aimee Mostella Cardena
Irfan Sayed wrote:
> OK. fine
> now i am able to write in a temp. file
>
> after this now i want to overwrite the contents of original file with the
> contents of temp. file.
> why i want the original file because i want to use this original file
> with changes in temp. file in my further build s
OK. fine
now i am able to write in a temp. file
after this now i want to overwrite the contents of original file with the
contents of temp. file.
why i want the original file because i want to use this original file with
changes in temp. file in my further build steps
please advice
Regards
I
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
looks like [1]. Does this appear to be acceptable? Could you recomme
Irfan Sayed asked:
> i am still not able to modify existing lines in the existing file.
> here is my code
> plz help
It doesn't work that way. Once you open the file for writing, it's truncated
and you can't read the old contents from it anymore.
Why don't you use a temporary new file for the o
It works for all
Just get any no after two (.) dot
For that regex would be
My $line="\"ProductName\" = \"8:EXFO RTU System 1.2.42\"";
my ($lastvalue)=$line=~ m/\d+.\d+.(\d+)\"/;
$lastvalue will give you value after two dot
Increment it by one and then replace it by old value from the line
It wor
hi all,
i am still not able to modify existing lines in the existing file.
here is my code
plz help
use strict;
use warnings;
use Cwd;
my $chver;
my $fina;
my @lines;
&chversion();
sub chversion {
print STDERR "Current directory is " . cwd() . "\n";
print "Reading version file\n";
open (VER, "
it is not just 1.2.43 it may be anything
it may be like 2.3.56 or 2.0.12 and so on...
plz advice
From: Ajay Kumar
To: Irfan Sayed
Cc: "beginners@perl.org"
Sent: Wednesday, June 17, 2009 5:01:41 PM
Subject: RE: regular expression help
Hi Irfan
This code sol
Hi Irfan
This code solve your problem
my $p="\"ProductName\" = \"8:EXFO RTU System 1.2.42\"";
my ($val)=$p=~ m/\d+.\d+.(\d+)\"/;
my $inval=$val+1;
$p=~s/$val/$inval/;
print"===$p\n";
thanks
Ajay
-Original Message-
From: Irfan Sayed [mailto:irfan_sayed2...@yahoo.com]
Sent: Wednesday, June
Hi ,
I am new to CGI scripting.
I have a below query.
I have one form say "xyz" with checkbox, where I am supposed to select
certain options using these checkboxes.
I have another form say "abc" where I am required to display the selected
options from form "xyz".
I have one perl module which act
Hi All,
need help on regular expression.
i have string like this
"ProductName" = "8:EXFO RTU System 1.2.42"
now i want regular expression in such a way that it will change the line to :
"ProductName" = "8:EXFO RTU System 1.2.43"
i tried in the following way.
$_ =~ s/:(.*)\s(.*)\s(.*)\
thanks all
From: Ajay Kumar
To: Irfan Sayed
Cc: "beginners@perl.org"
Sent: Wednesday, June 17, 2009 3:42:41 PM
Subject: RE: file handle in perl
Hi Irfan
You can do all four task like below
1: open FILE ,">filename.txt" or die$!;
2: my @lines=
3: do changes
Hi Irfan
You can do all four task like below
1: open FILE ,">filename.txt" or die$!;
2: my @lines=
3: do changes through sed
Like sed -e 's/original pattern/new pattern/p' filename
4:if you did changes it automatically get saved
5: close(FILE);
Thanks
Ajay
-Original Message-
Fr
Hi Irfan,
Irfan Sayed wrote:
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
Does this FAQ help?
Q: How do I change, delete, or insert a line in a file,
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 not getting which operand i should use to do this operation . i tried all
operands like >, >>, <,
23 matches
Mail list logo