On Sun, Apr 6, 2008 at 11:17 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> Your problem is that the line "123\n" does not match the pattern /^\s*$/.
> Try it using two substitutions like this:
>
> s/^\s+//;
>
> s/\s+$//;
or use one,
s/^\s+|\s+$//g;
--
To unsubscribe, e-mail: [EMAIL
[EMAIL PROTECTED] wrote:
Hi,
Hello,
The script below is suppose to erase off, from a file, all blank lines
including newlines, I wrote the regex is as follows : s/^\s*$//;
however after running the script, a last newline remains.
Can someone explain why the regexp can erase off all newlines
On Sat, 05 Apr 2008 12:25:15 +1100, ken Foskey wrote:
> Is there any real advantage of
>
> use constant PART_NUMBER => 'P/N';
> over
> my $PART_NUMBER = 'P/N';
>
> Yes I know that it can be modified but conventions such as upper case
> constants can almost remove that problem.
Or totally remov
Hi,
The script below is suppose to erase off, from a file, all blank lines
including newlines, I wrote the regex is as follows : s/^\s*$//;
however after running the script, a last newline remains.
Can someone explain why the regexp can erase off all newlines in the file
except the last newlin
On 4月5日, 上午12时32分, [EMAIL PROTECTED] (Jeff Pang) wrote:
> use MIME::Words qw/:all/;
>
> for example,
>
> $subject = encode_mimeword($subject,'b','gb2312');
>
> On Fri, Apr 4, 2008 at 9:38 PM, kun niu <[EMAIL PROTECTED]> wrote:
> > Dear all,
>
> > I'm trying to send email with perl in my applicatio
On Sun, 2008-04-06 at 05:39 +0530, pradeep reddy wrote:
> Can this impletemented in shell script alsso?
Why do you ask this in a perl list?
look at `uniq -c`.
--
Ken Foskey
FOSS developer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http:/
Hi,
Thanks for the reply.
Can this impletemented in shell script alsso?
- Original Message
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]>
To: beginners@perl.org
Sent: Saturday, 5 April, 2008 3:01:41 PM
Subject: Re: problem with the script in counting
pradeep reddy wrote:
> I am stuck at
pradeep reddy wrote:
Hi,
Hello,
I have a script which greps for a word in a file contains records.
I grabbed a particular column & sent the colomn values to a file.
I need to find each column value, the times it appeared in the file.
My script is:
grep sceneority | cut -f 6
pradeep reddy wrote:
I am stuck at how to find the occurance of column values in "swi" file.
The file has following column values:
123
324
123
123
435
435
The output should be
123 is 3 times
324 is 1 time
435 is 2 times
Use a hash.
open my $fh, '<', 'swi' or die $!;
my %cnt;
Hi,
I have a script which greps for a word in a file contains records..
I grabbed a particular column & sent the colomn values to a file.
I need to find each column value, the times it appeared in the file.
My script is:
grep sceneority | cut -f 6 >> swi
I am stuck at how to fi
Hi,
I have a script which greps for a word in a file contains records..
I grabbed a particular column & sent the colomn values to a file.
I need to find each column value, the times it appeared in the file.
My script is:
grep sceneority | cut -f 6 >> swi
I am stuck at how to fi
Hi,
I have a script which greps for a word in a file contains records.
I grabbed a particular column & sent the colomn values to a file.
I need to find each column value, the times it appeared in the file.
My script is:
grep sceneority | cut -f 6 >> swi
I am stuck at how to fin
Prabu Ayyappan wrote:
I want to convert a string into a Hash data structure
For Example
String:
"[['aaa',{27' => '543','21' => '111','Client' => '543','chat' => '111'}]]"
Hash:
[['aaa',{27' => '543','21' => '111','Client' => '543','chat' => '111'}]
C:\home>type test.pl
use Data::Dumper;
$
On Fri, Apr 4, 2008 at 1:17 PM, <[EMAIL PROTECTED]> wrote:
snip
> > my $part = $parts{ $key }{ +PART_NUMBER };
snip
> Thanks for your help. Your suggestion worked, but what exactly is the
> '+' doing in this case?
snip
from perldoc perlop
Unary "+" has no effect whatsoever, even on str
On Fri, Apr 4, 2008 at 12:16 PM, Rascal <[EMAIL PROTECTED]> wrote:
> I am using Perl 5.8.5 on Red Hat Linux.
>
> The output of the following script:
>
> #!/usr/bin/perl -w
> @array = [0, 1, 2, 3];
snip
This is creating an array with one element. The element is a
reference to an array that hold
protoplasm wrote:
I'm using Find::File in my program. Unfortunately I get the ugly
'Permission denied' output that I'd normally redirect to /dev/null if
I was using bash.
Here is the command I used to generate the Find::File code:
$ find2perl /usr -name libaest.dylib -print
I saved that to a ne
> The output of the following script:
>
> #!/usr/bin/perl -w
> @array = [0, 1, 2, 3];
> $hash{0} = @array;
> print "array = @array\n";
> print "hash = ", $hash{0}, "\n";
>
> is:
>
> array = ARRAY(0x8d13c20)
> hash = 1
>
> I expected the results to be the same. Why aren't they?
First thi
Rascal schreef:
> The output of the following script:
>
> #!/usr/bin/perl -w
> @array = [0, 1, 2, 3];
> $hash{0} = @array;
> print "array = @array\n";
> print "hash = ", $hash{0}, "\n";
>
> is:
>
> array = ARRAY(0x8d13c20)
> hash = 1
>
> I expected the results to be the same. Why aren't they?
I'm using Find::File in my program. Unfortunately I get the ugly
'Permission denied' output that I'd normally redirect to /dev/null if
I was using bash.
Here is the command I used to generate the Find::File code:
$ find2perl /usr -name libaest.dylib -print
I saved that to a new file and tested:
On Apr 4, 10:30 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
> > use constant PART_NUMBER=> 'P/N';
>
> > print PART_NUMBER;
>
> > The above prints, "P/N", as I would expect. Later in the script I
> > want to access a hash value using the constant like this:
> > m
On Apr 4, 9:37 am, [EMAIL PROTECTED] (Jeff Pang) wrote:
> On Fri, Apr 4, 2008 at 11:42 PM, <[EMAIL PROTECTED]> wrote:
> > use constant PART_NUMBER=> 'P/N';
>
> > print PART_NUMBER;
>
> > The above prints, "P/N", as I would expect. Later in the script I
> > want to access a hash val
I am using Perl 5.8.5 on Red Hat Linux.
The output of the following script:
#!/usr/bin/perl -w
@array = [0, 1, 2, 3];
$hash{0} = @array;
print "array = @array\n";
print "hash = ", $hash{0}, "\n";
is:
array = ARRAY(0x8d13c20)
hash = 1
I expected the results to be the same. Why aren't they?
.
22 matches
Mail list logo