Re: scp status

2010-01-14 Thread Majian
't it it looks like this : tar cf -/home/majian/389-ds/ | pv --wait > 389.tar maj...@192.168.56.101's password: tar: Removing leading `/' from member names 16.2MB 0:00:04 [3.62MB/s] [ <=>] Enjoy ~ :-)

Re: About the Perl multiple lines problem

2010-01-14 Thread Majian
On 01/14/2010 12:25 AM, Grove, Michael wrote: > At 6:47 PM +0800 1/13/10, Majian wrote: > >> Hi,all >> >> There is a problem confused me for a long time . >> It is: >> >> cat test.txt >> >> 1, >&g

About the multiple lines problem

2010-01-13 Thread Majian
Hi,all There is a problem confused me for a long time . It is: cat test.txt 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, Then I want to this result : 1 2 3 6 9 4 7 10 5 8 11 I don't know how to print the multiple lines with th

About the Perl multiple lines problem

2010-01-13 Thread Majian
Hi,all There is a problem confused me for a long time . It is: cat test.txt 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, Then I want to this result : 1 2 3 6 9 4 7 10 5 8 11 I don't know how to print the result use the Perl scrip

convert binary to hex

2009-12-09 Thread Majian
Hi ,all : I'd like to convert binary file intohex , but when I use perl's built in functions I keep getting extra bits on the end. cat bin_file 11100010 0001010100111110 My perl script is the following : #!/usr/bin/perl use strict; while (<>){

Re: About the perl index function question

2009-12-08 Thread Majian
Thanks Dermot and erez.schatz I got it ~ On Tue, Dec 8, 2009 at 4:59 PM, Erez Schatz wrote: > 2009/12/8 Majian : > > my $s = "The black cat jumped from the green tree"; > > print index $s, "e", 3 The result is 18 > > It's slightly conf

About the perl index function question

2009-12-08 Thread Majian
Hi,all : I have a problem about the perl index function , the problem is the following : #!/usr/bin/perl use strict ; my $s = "The black cat jumped from the green tree"; print index $s, "e", 3 The result is 18 I don't understand the result clearly ,Could someone help me to explain

About the uninstall the new perl version

2009-12-02 Thread Majian
Hi, guys: I have a problem about the perl uninstall , my laptop's system is CentOS 5.3 x86_64, and the default perl version is perl -5.8.8; I installed the newer version called perl -5.11.1by the tar.gz package , but now I don't want it ~ In other worlds , I want to uninstall it fr

Re: A simple question about the Perl line

2009-11-27 Thread Majian
Thanks all . On Sat, Nov 28, 2009 at 3:00 AM, Randal L. Schwartz wrote: > >>>>> "Majian" == Majian writes: > > Majian> Hi ,all: > Majian> I have a problem about this : > > Majian> cat test: > Majian> 12 > Majian> 23 > Maji

a simple question about the line

2009-11-27 Thread Majian
Hi, all : I have a problem about the lines of the file , like this : cat test 12 23 34 45 56 67 78 ... == I want to display like this : 1223 3445 5667 It means the next line is after the last line . How do it by the Perl ? Thanks in advance ~ -- To unsubscribe, e-

A simple question about the Perl line

2009-11-27 Thread Majian
Hi ,all: I have a problem about this : cat test: 12 23 34 45 56 67 ... I want to become like this : 1223 3445 5667 ... That means the next line is after the above line ~ I thought it for a long time , but I have no idea yet~~ Can someone help me ? Thanks

Re: a match question

2009-11-25 Thread Majian
Orchid Fairy (兰花仙子) wrote: > On Wed, Nov 25, 2009 at 11:06 AM, John W. Krahn wrote: > > >> $ perl -le '$_="aXXXb"; print "one word is $1 at $-[0] to $+[0]" while >> /(X*)/g;' >> one word is at 0 to 0 >> one word is XXX at 1 to 4 >> one word is at 4 to 4 >> one word is at 5 to 5 >> >> >

Increment Operator (++) question in Perl

2009-11-03 Thread Majian
Hi ,all: When I test the increment operator in Perl and find a question : The question is : #!/usr/bin/perl use warnings; my $i = 1; print ++$i + ++$i, "\n"; The above code prints out the answer 6 . But in the other language the anser is 5 , So I don't understand the reason why it is

Re: How do I pick one random element from an array?

2009-11-03 Thread Majian
element of the array like this ,what should I do ? Thanks in advance ~~ On Tue, Nov 3, 2009 at 6:13 PM, tom smith wrote: > On Tue, Nov 3, 2009 at 12:11 AM, Majian wrote: > >> Hi ,all : >> >> I want to know if there is a way in which I can randomnize(?) the conten

How do I pick one random element from an array?

2009-11-02 Thread Majian
Hi ,all : I want to know if there is a way in which I can randomnize(?) the content in an array. In this example : my @array = ('uriel', 'daniel', 'joel', 'samuel'); Now what I want is create a process so every time I print the array it prints one element from the array . I wrote it like this

Re: About the hash case insensitive ~~~

2009-10-27 Thread Majian
ot; in force. See perllocale and perlunicode for more details about locale and Unicode support. It does not attempt to do titlecase mapping on initial letters. See "ucfirst" for that If EXPR is omitted, uses $_. On Tue, Oct 27, 2009 at 8:11 PM, Thomas Bätzler w

About the hash case insensitive ~~~

2009-10-27 Thread Majian
Hello,all: I had a question about the perl hash case insensitive . And I had this script : == #!/usr/bin/perl use warnings; %courses = ( "2CPR2B"=> "C Language", "1UNX1B"=> "Intro to Unix", "3SH414"=> "Shel

Re: newbie question : about the perl sprintf

2009-10-25 Thread Majian
~~ On Sat, Oct 24, 2009 at 7:28 PM, Peter Scott wrote: > On Wed, 21 Oct 2009 20:52:05 +0800, Majian wrote: > > And I modify it like this "sprintf "The number in > > scientific > > notation is %e", 01.255;" > >

About the $nextline question ~~

2009-10-24 Thread Majian
Hi,all: I have the text like this: xxx sum = 1, xx xx xx d_bits xxx xxx xx sum =0 xx xx xx d_bit xx My question is : How can I read the nextline after the d_bits if sum = 1? I thought it for some days, but had no result . Forgive I am maybe an newbie , please give me a hand ~~ Thanks

newbie question : about the perl sprintf

2009-10-21 Thread Majian
Hi, all ; I want to print this sentence " The number in scientific notation is 1.255000e+02". So I write a perl script like this : #!/usr/bin/perl sprintf "The number in scientific notation is %e", 1.255; But the screen output is "

The Perl question of the here document

2009-10-21 Thread Majian
Dear list: Sorry to distrub all . When I learned Perl on the book called "Perl by example 4th Chinese Edition ", I found there was an error on this book . There had a perl script writted by this : #!/usr/bin/perl print << 'END';

How can I split a string into chunks of size n bytes?

2009-10-20 Thread Majian
Dear list: I have a question on learning Perl . Please give me a help . The problem is : How can I split a string into chunks of size n bytes?Like this : #!/usr/bin/perl my $string = "1234567890abcdefghijABCDEFGHIJK"; my $n = 2;# $n is group size. my @groups = unpack "a$n" x (length( $st

Re: How to set a proxy server.

2009-10-20 Thread Majian
Dear list: I have a question on learning Perl . Please give me a help . The problem is : How can I split a string into chunks of size n bytes?Like this : #!/usr/bin/perl my $string = "1234567890abcdefghijABCDEFGHIJK"; my $n = 2;# $n is group size. my @groups = unpack "a$n" x (length( $st