RE: Perl help

2006-07-18 Thread Jeff Peng
foreach (@vob_list) { my @repl = `$CT lsreplica -invob $_ | grep cmvobsvr1mum`; print @repl; } Could you use perl's grep instead?Like: for (@vob_list){ my @repl = `$CT lsreplica -invob $_`; my @repl2 = grep { /cmvobsvr1mum/ } @repl; print @repl2; } -- To unsubscribe, e-mai

RE: Perl help

2006-07-18 Thread Owen Cook
On Tue, 18 Jul 2006, Sayed, Irfan (Irfan) wrote: > > tried. but still same error. > On Tue, 18 Jul 2006, Sayed, Irfan (Irfan) wrote: > > > > > I am executing following code > > > > foreach (@vob_list) > > { > > my @repl = `$CT lsreplica -invob $_ | grep cmvobsvr1mum`; print > > @

Re: pattern matching

2006-07-18 Thread Rob Dixon
Ryan Dillinger wrote: Hello All, I was studying some pattern matching. And I ran into this piece of code. Now I believe I understand it up until the the last part \1. Can someone explain it for me please? Match lowercase a through z, uppercase A through lc z no more than three times, with white s

RE: Perl help

2006-07-18 Thread Sayed, Irfan \(Irfan\)
thanks jeff. now I want to redirect the output of this grep command to file . how do I do that I tried in the following way for (@vob_list){ my @repl = `$CT lsreplica -invob $_`; my @repl2 = grep { /cmvobsvr1mum/ } @repl >> /tmp/log ; print @repl2; } but it didn't work plz help Reg

RE: Perl help

2006-07-18 Thread Jeff Peng
my @repl2 = grep { /cmvobsvr1mum/ } @repl >> /tmp/log ; Hi,that should not work certainly,:) You could open a file and optain a filehandle and write to this filehandle. for example: open FILE,">",$filename or die $!; print FILE @repl2; close FILE; -- To unsubscribe, e-mail:

Passing a hash to a function

2006-07-18 Thread Leonid Grinberg
Hello all, I have a question about passing a hash to a fucntion. Suppose you had the following script: sub function { my %operating_systems = &populate_hash(%operating_systems); do_something_with_hash(); } sub populate_hash { my %operating_systems = ?; $operating_systems{"microsoft"} =

Modification of table -limited by programming constraint

2006-07-18 Thread Nath, Alok (STSD)
Hi, In my current program I am not sure where to use rowSpan so that I create table like below. In otherwords, I want switch 1 to appear once only for the two rows. My main constraint is I dont want to change the program style to create such a table . Any help will be greatly appreciated. |--

RE: Passing a hash to a function

2006-07-18 Thread Jeff Peng
sub function { my %operating_systems = &populate_hash(%operating_systems); do_something_with_hash(); } sub populate_hash { my %operating_systems = ?; $operating_systems{"microsoft"} = "Windows"; $operating_systems{"apple"} = "Macintosh"; ... return %operating_systems; } What should t

search option in perl

2006-07-18 Thread Sayed, Irfan \(Irfan\)
Hi all, I need to search a file for a specific string thru perl script. for example i want to put following condition in the script. --- > first search the string string1 > and if that string found then search for another string string2 > if both the string found then print both the

Re: Passing a hash to a function

2006-07-18 Thread John W. Krahn
Leonid Grinberg wrote: > Hello all, Hello, > I have a question about passing a hash to a fucntion. Suppose you had > the following script: > > > sub function > { > my %operating_systems = &populate_hash(%operating_systems); my %operating_systems = populate_hash(%operating_systems); > do_

Re: Passing a hash to a function

2006-07-18 Thread Bjørge Solli
On Tuesday 18 July 2006 16:45, John W. Krahn wrote: > Leonid Grinberg wrote: > > sub function > > { > > my %operating_systems = &populate_hash(%operating_systems); > > my %operating_systems = populate_hash(%operating_systems); Why do you want to remove the ampersand? In /the Llama book/, includ

Re: Modification of table -limited by programming constraint

2006-07-18 Thread Rob Dixon
Nath, Alok (STSD) wrote: Hi, In my current program I am not sure where to use rowSpan so that I create table like below. In otherwords, I want switch 1 to appear once only for the two rows. My main constraint is I dont want to change the program style to create such a table . Any help will

Re: search option in perl

2006-07-18 Thread Rob Dixon
Sayed, Irfan (Irfan) wrote: Hi all, I need to search a file for a specific string thru perl script. for example i want to put following condition in the script. --- > first search the string string1 > and if that string found then search for another string string2 > if both the s

Re: Passing a hash to a function

2006-07-18 Thread John W. Krahn
Bjørge Solli wrote: > On Tuesday 18 July 2006 16:45, John W. Krahn wrote: >>Leonid Grinberg wrote: >>>sub function >>>{ >>> my %operating_systems = &populate_hash(%operating_systems); >> my %operating_systems = populate_hash(%operating_systems); > > Why do you want to remove the ampersand? In /th

RE: Passing a hash to a function

2006-07-18 Thread Ryan Frantz
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 18, 2006 11:48 AM > To: Perl Beginners > Subject: Re: Passing a hash to a function > > Bjørge Solli wrote: > > On Tuesday 18 July 2006 16:45, John W. Krahn wrote: > >>Leonid Grinberg wrote: > >>>su

RE: search option in perl

2006-07-18 Thread Sayed, Irfan \(Irfan\)
Hi rob, you are right . basically I need to search two different strings in one file which are at different lines. means string1 is on one line and string2 is on another line can u plz give then actual syntax to achieve this ? that will be really good. regards irfan. -Original Message---

Re: Passing a hash to a function

2006-07-18 Thread Rob Dixon
Bjørge Solli wrote: > > On Tuesday 18 July 2006 16:45, John W. Krahn wrote: > >>Leonid Grinberg wrote: >> >>>sub function >>>{ >>> my %operating_systems = &populate_hash(%operating_systems); >> >> my %operating_systems = populate_hash(%operating_systems); > > > Why do you want to remove the amper

File transfer over socket connection

2006-07-18 Thread Jerry DuVal
I have a socket connection running on listener - Server A port 50 client - Server B I can talk btwn the client and server with no problem, but I want to send a file over the TCP socket connection. Does any one have any examples?

Re: search option in perl

2006-07-18 Thread Rob Dixon
Sayed, Irfan (Irfan) wrote: > >> -Original Message- >> From: Rob Dixon [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, July 18, 2006 9:09 PM >> To: beginners@perl.org >> Subject: Re: search option in perl >> >> Sayed, Irfan (Irfan) wrote: >> >>>I need to search a file for a specific string thr

Re: Passing a hash to a function

2006-07-18 Thread John W. Krahn
Rob Dixon wrote: > > I am surprised that the Llama book encourages coding in this way as the > ampersand has been undesirable for a long time. Do you have the latest > edition - > the third? The fourth. http://www.oreilly.com/catalog/learnperl4/index.html John -- use Perl; program fulfillment

Re: pattern matching

2006-07-18 Thread Dr.Ruud
"Timothy Johnson" schreef: You should south-post. You should trim. > \1 is the same thing as $1 inside of a regex, but it is generally > recommended that you don't use it. That is a misinterpretation. It is OK (and efficient) to use the backreferences \1, \2, \3 etc. in a regex. The \1 (as a b

RE: search option in perl

2006-07-18 Thread Sayed, Irfan \(Irfan\)
-Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 9:47 PM To: beginners@perl.org Subject: Re: search option in perl Sayed, Irfan (Irfan) wrote: > >> -Original Message- >> From: Rob Dixon [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, Jul

Can't figure out why File::Path::rmtree says "Operation not permitted"

2006-07-18 Thread RICHARD FERNANDEZ
Hi folks, I have a script that calls rmtree. The operation works; my directory and its contents are removed. However, I get this error: Can't make directory /u01/mydocs/mytest001 read+writeable: Operation not permitted at /u02/home/myacct_rem.pl line 41 If the directory has been deleted, why the

Re: Can't figure out why File::Path::rmtree says "Operation not permitted"

2006-07-18 Thread Tom Phoenix
On 7/18/06, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote: I have a script that calls rmtree. The operation works; my directory and its contents are removed. However, I get this error: Can't make directory /u01/mydocs/mytest001 read+writeable: Operation not permitted at /u02/home/myacct_rem.pl li

Re: Modification of table -limited by programming constraint

2006-07-18 Thread D. Bolliger
Nath, Alok (STSD) am Dienstag, 18. Juli 2006 15:30: > Hi, > In my current program I am not sure where to > use rowSpan so that I create table like below. > In otherwords, I want switch 1 to appear > once only for the two rows. > > My main constraint is I dont want to change the program > style to c

Re: search option in perl

2006-07-18 Thread D. Bolliger
Hi Irfan [...] > hi rob, > > Thanks for your mail. > > let me modify my request in more clear manner. > basically I have one file. The format of that file is as follows. > > Replica name : some string > master replica : some string > hostname : some string > > replica name : some s

RE: Can't figure out why File::Path::rmtree says "Operation not permitted"

2006-07-18 Thread RICHARD FERNANDEZ
> > I'm not running as user "nobody", but I'm in group "nobody". > > Then you shouldn't be able to change permission bits on user > "nobody"'s files and directories; they're not yours. Perhaps > you should ask user "nobody" to rmtree? Or if the files are > supposed to be yours, maybe you just n

RE: File transfer over socket connection

2006-07-18 Thread Jeff Peng
I can talk btwn the client and server with no problem, but I want to send a file over the TCP socket connection. Does any one have any examples? Maybe you would take a look at CPAN's some modules like Rsync,Scp,etc. If you just want to transmit a text file from client to server,it's easy to

First big project

2006-07-18 Thread Mathew Snyder
Hello all, I've been asked to create a web front-end for a Solaris Jumpstart server. This would entail several text boxes and dropdown lists that will insert data into a text file to be used by the system to build new servers when they boot from the network. So basically, as this would be my firs