Re: string manip.

2007-02-16 Thread John W. Krahn
Nishi Bhonsle wrote: > Hi: Hello, > I have a string such as > instance/bit/bitGroup/default/tz/l_cs > where the last directory stands for os languages. > > I have to get the last directory and assign it to a var such as > $mylang = l_cs, in the above example. > How can i achieve that? $ perl -l

Re: string manip.

2007-02-16 Thread Dr.Ruud
"Nishi Bhonsle" schreef: > I have a string such as > instance/bit/bitGroup/default/tz/l_cs > where the last directory stands for os languages. > > I have to get the last directory and assign it to a var such as > $mylang = l_cs, in the above example. > How can i achieve that? my $s = q{instan

Re: system()

2007-02-16 Thread Mumia W.
On 02/16/2007 07:25 PM, Jeff Pang wrote: The command "perldoc -f open" shows you how to do get the output from a command without starting a shell. Do you mean open a pipe? It still need to fork a child process for running the external commands. Read the "safe pipe opens" section of "perld

Re: system()

2007-02-16 Thread Jeff Pang
>The command "perldoc -f open" shows you how to do get the output from a >command without starting a shell. > Do you mean open a pipe? It still need to fork a child process for running the external commands. -- 祝所有中华Perl用户新春快乐! Happy New Year for all Chinese Perl guys! -- To unsubscribe, e-ma

Re: string manip.

2007-02-16 Thread Jeff Pang
> >I have a string such as >instance/bit/bitGroup/default/tz/l_cs >where the last directory stands for os languages. > >I have to get the last directory and assign it to a var such as >$mylang = l_cs, in the above example. >How can i achieve that? > Hello, Here is one way to do it: my ($mylang)

Re: How to reinvent the linux

2007-02-16 Thread Jeff Pang
> >Can someone suggest where I would look to reinvent "df" with perl? The "df" >command enumerates all the drives and partitions and interrogates them for >the amount of disk space total, used and available. Is there an OS neutral >way to write this program? I hope so. If not, this will be running

Re: string manip. @ 1171669455

2007-02-16 Thread Johan Meskens CS3 jmcs3
Intrah onat Diria .. Fri, 16 Feb 2007 15:08:02 -0800 , "Nishi Bhonsle" wrote "Revera y": > Thanks. > > How can i achieve that? my $s = 'instance/bit/bitGroup/default/tz/l_cs'; $s =~ /.*\/(.*)$/; print $1; > $mylang = l_cs, in the above example. > I have to get the last directory and

string manip.

2007-02-16 Thread Nishi Bhonsle
Hi: I have a string such as instance/bit/bitGroup/default/tz/l_cs where the last directory stands for os languages. I have to get the last directory and assign it to a var such as $mylang = l_cs, in the above example. How can i achieve that? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: system()

2007-02-16 Thread Mumia W.
On 02/16/2007 07:58 AM, Doroshok Stanislav wrote: hi all I need output from system(): @rrd = ("/usr/bin/rrdtool","graph","-","--title","hypergraph",); $rezult = system(@rrd); how can i get output? p.s. i don't wont use `` and run shell; thanks The command "perldoc -f open" show

Re: How to reinvent the linux "df" command

2007-02-16 Thread Mumia W.
On 02/16/2007 11:12 AM, siegfried wrote: Can someone suggest where I would look to reinvent "df" with perl? The "df" command enumerates all the drives and partitions and interrogates them for the amount of disk space total, used and available. Is there an OS neutral way to write this program? I h

How to reinvent the linux "df" command

2007-02-16 Thread siegfried
Can someone suggest where I would look to reinvent "df" with perl? The "df" command enumerates all the drives and partitions and interrogates them for the amount of disk space total, used and available. Is there an OS neutral way to write this program? I hope so. If not, this will be running on xub

Re: system()

2007-02-16 Thread Jeff Pang
>p.s. i don't wont use `` and run shell; Why don't ue ``? system() call would also fork a child process to do the things,as `` do. -- Jeff Pang EMAIL: [EMAIL PROTECTED] AIM: jeffpang -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

system()

2007-02-16 Thread Doroshok Stanislav
hi all I need output from system(): @rrd = ("/usr/bin/rrdtool","graph","-","--title","hypergraph",); $rezult = system(@rrd); how can i get output? p.s. i don't wont use `` and run shell; thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: hash constant

2007-02-16 Thread cz172638
thanks it looks well, but i tried to export them unsuccessfully. >On Fri, 16 Feb 2007 12:52:50 +0100, cz172638 wrote: >> use constant TESTERCONFIG => %testerscfg; >> >> foreach $b (keys %testerscfg) { >> print $b."\n"; >> } >> >> it works well, but when i put in foreach loop instead of %tester

Re: hash constant

2007-02-16 Thread Peter Scott
On Fri, 16 Feb 2007 12:52:50 +0100, cz172638 wrote: > use constant TESTERCONFIG => %testerscfg; > > foreach $b (keys %testerscfg) { > print $b."\n"; > } > > it works well, but when i put in foreach loop instead of %testerscfg > TESTERCONFIG > i got following: > > Type of arg 1 to keys must be

hash constant

2007-02-16 Thread cz172638
hi all, i need setup constant hash generated from file, if it is possible. i have following code: my %testerscfg = (); sub get_testerconfig { open(TESTERCONFIG,"@{[TESTERCFG]}") or die "@{[TESTERCFG]} doesn't exists or isn't readable!\n"; # loop while testers file contain a line while (my

Re: Perl DBI Oracle: bind an array list

2007-02-16 Thread Igor Sutton
Hi Nitin, 2007/2/16, Nitin Aggarwal <[EMAIL PROTECTED]>: Hi, I am using bind variables for executing a select query which uses "in" operator. Following is the prototype of my code: $query = "select a from tab where b in (:1)"; @list = {"A","B","C","D"}; $list_values = join("','",@list); $DBI->

a question about parsing

2007-02-16 Thread Neal Clark
hi all. i've been programming in perl for a few years, but i'm definitely no expert. the begginer's list seemed like the best place to ask for help on this program/solution i'm working on, so here goes... i am charged with the task of parsing a (basically) infinite set of plain text files

Perl DBI Oracle: bind an array list

2007-02-16 Thread Nitin Aggarwal
Hi, I am using bind variables for executing a select query which uses "in" operator. Following is the prototype of my code: $query = "select a from tab where b in (:1)"; @list = {"A","B","C","D"}; $list_values = join("','",@list); $DBI-> connect (..); $sth -> prepare($query); $sth-> execute ($