David Gilden schreef:
> my $Comments = param('(Comments');
There is an extra '(' in there that you might not want.
Do you use Capitalization to show that the variable is initialised with
the value of a parameter?
Consider $p_comments or $param_comments or $param{Comments}.
--
Affijn, Ruud
"Ge
On Jun 4, 8:00 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> April wrote:
> > sprintf( "%s%$Fmt%s", ("%$Fmt=|", $TestStr, "|"))
>
> > This is in Perl for Dummies, 4th ed, p160.
>
> > I'm trying to understand this ...
>
> > the first part, "%s%$Fmt%s", my understanding is the format part,
> > which spe
Octavian:
> Yitzle:
>> 1) If you are interested in learning to program for the sake of
>> programming (vs getting XYZ done), Perl probably isn't the best first
>> choice. (Not that its the last choice or anything, but not first.)
>> I'd personally advocate C/C++ or maybe Java. Maybe make Perl a th
- Original Message - > Whee! Inflammatory topic!
>
> 1) If you are interested in learning to program for the sake of
> programming (vs getting XYZ done), Perl probably isn't the best first
> choice. (Not that its the last choice or anything, but not first.) I'd
> personally advocate C/C++
Gunnar Hjalmarsson wrote:
bill lam wrote:
Sorry this must be a faq but I cannot find any answer in google.
Google?? If you think it's a FAQ, you'd better check the Perl FAQ.
perldoc -q "insert a line"
Within that basic form, add the parts that you need to insert, change,
or delete lines
Whee! Inflammatory topic!
1) If you are interested in learning to program for the sake of
programming (vs getting XYZ done), Perl probably isn't the best first
choice. (Not that its the last choice or anything, but not first.) I'd
personally advocate C/C++ or maybe Java. Maybe make Perl a third
ch
Most likely just out of curiosity factor, I picked up a book "Learning
to program " the facets of ruby series..
While very simple in nature, book try to teach computer programming
concept while giving some ruby lesson..
Even though I am still a beginner for perl, I just wanted to pick up 2nd
l
Rob Dixon wrote:
If you think the one-liner is non-trivial then all the more reason that you
should use a proper script. It is a bad idea to use any code unless you
understand why and how it works.
The script isn't trivial (to me) either. Incidentally the same can be done in
sed one-liner.
se
Steve Bertrand wrote:
David Gilden wrote:
Could someone please help me the syntax here
my $Comments = param('(Comments');
&BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
This should go to &BADemail if $Comments contains either string,
regardless else is contained i
David Gilden wrote:
Could someone please help me the syntax here
my $Comments = param('(Comments');
&BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
This should go to &BADemail if $Comments contains either string, regardless
else is contained in the $Comments.
In a
David Gilden wrote:
>
> my $Comments = param('(Comments');
> &BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
>
> This should go to &BADemail if $Comments contains either string, regardless
> else is contained in the $Comments.
The answer to your question is
BADemail()
Could someone please help me the syntax here
my $Comments = param('(Comments');
&BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
This should go to &BADemail if $Comments contains either string, regardless
else is contained in the $Comments.
Thanks,
Dave
(kora musi
Hello,
I have this situation wherein I have to run a perl script over
pre-processed files. Eg: File "A.cfg" needs to be preprocessed to say
"A" and then my perl script works on it. This preprocessing is done, as
of now, by command line call of " gcc -E A.cfg > A" and then a command
to run the per
bill lam wrote:
> Thomas Bätzler wrote:
>> perl -i -ple '$_ = "cc\n$_" if $p =~ m/aa/ && m/bb/; $p=$_'
>
> Thanks. looks non-trivial for me. Anyway I will copy this idiom into my cheat
> sheet.
>
> Thank Gunnar for suggestion too. However I prefer one-liner.
If you think the one-liner is non-tr
Thomas Bätzler wrote:
perl -i -ple '$_ = "cc\n$_" if $p =~ m/aa/ && m/bb/; $p=$_'
Thanks. looks non-trivial for me. Anyway I will copy this idiom into my cheat
sheet.
Thank Gunnar for suggestion too. However I prefer one-liner.
regard,
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
bill lam wrote:
Sorry this must be a faq but I cannot find any answer in google.
Google?? If you think it's a FAQ, you'd better check the Perl FAQ.
perldoc -q "insert a line"
Suppose I want to change 2 lines to 3 line in files as follow using perl
-p -i -e command
aa
bb
aa
cc
bb
this
Thanks Thomas... :)
It helped.
Thanks and Best regards,
~ Rajnikant
Software Engg.
Persistent Sys. Ltd.
Ph. +91 98222 04088
-Original Message-
From: Thomas Bätzler [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2008 5:50 PM
To: beginners@perl.org
Cc: Rajnikant
Su
Rajnikant <[EMAIL PROTECTED]> asked:
> I'm reading one directory using readdir call. but I'm getting
> different output from that I got by running ls -l command on
> same directory manually. Following is the snippet I'm using:
>
#!/usr/bin/perl -w
$dirname = '/test_dir';
opendir ( DIR, $dirna
Hello everyone,
I'm reading one directory using readdir call. but I'm getting different
output from that I got by
running ls -l command on same directory manually. Following is the snippet
I'm using:
#!/usr/bin/perl -w
$dirname = "/test_dir";
opendir ( DIR, $dirname ) || die "Error in opening
bill lam <[EMAIL PROTECTED]> asked:
> Suppose I want to change 2 lines to 3 line in files as follow
> using perl -p -i -e command aa bb
>
> aa
> cc
> bb
>
> this doesn't work
> perl -p -i -e "s/aa\nbb/aa\ncc\nbb/g;" foo.txt
That won't work since you ever only see a single line of input.
Since
Hello,
Sorry this must be a faq but I cannot find any answer in google.
Suppose I want to change 2 lines to 3 line in files as follow using perl -p -i
-e command
aa
bb
aa
cc
bb
this doesn't work
perl -p -i -e "s/aa\nbb/aa\ncc\nbb/g;" foo.txt
what is the correct command (I use linux).
Thanks
On Thu, Jun 5, 2008 at 3:09 PM, ram <[EMAIL PROTECTED]> wrote:
>
> On Thu, 2008-06-05 at 12:32 +0530, Santosh Reddy wrote:
>> how do i do this. thanks a lot in advance
>>
> perl -pli -e 's/abcd/xyz/' a.txt
>
or use the unix command 'sed'.
--
Jeff Peng - [EMAIL PROTECTED]
Professional Squid sup
On Thu, 2008-06-05 at 12:32 +0530, Santosh Reddy wrote:
> Hi All,
>
> I have a file called a.txt which has the following lines
>
> abcd
> efgh
> ijkl
> abcd123
> 12abcd
>
> I want to replace abcd with xyz.
>
> how do i do this. thanks a lot in advance
>
perl -pli -e 's/abcd/xyz/' a.txt
--
Hi All,
I have a file called a.txt which has the following lines
abcd
efgh
ijkl
abcd123
12abcd
I want to replace abcd with xyz.
how do i do this. thanks a lot in advance
--
Thanks & Regards,
Santosh Reddy.
24 matches
Mail list logo