Re: System

2007-09-22 Thread Gunnar Hjalmarsson
Somu wrote: About that PID problem, i found a program in Windows named tasklist, it prints all the processes running on the system with its id. I used the system command to execute the tasklist, like as my $data = system "tasklist" ; but i got nothing in $data. How can i get the data from the s

Re: System

2007-09-22 Thread Chris Charley
- Original Message - From: "Somu" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, September 21, 2007 11:27 AM Subject: System About that PID problem, i found a program in Windows named tasklist, it prints all the processes running on the system with its id. I used t

Re: How print a Hashtable with reference ?

2007-09-22 Thread Gunnar Hjalmarsson
Santana wrote: In this example this foreach loop in "printHT" function dont work , how is missed ? Really? What output did you get, and what did you expect? #!/usr/bin/perl use strict; use warnings; sub printHT($) { my $T =$_[0]; foreach my $id (keys (%$T)){ #This dont work

Re: How print a Hashtable with reference ?

2007-09-22 Thread Rodrick Brown
On 9/21/07, Santana <[EMAIL PROTECTED]> wrote: > Hei all, > how print a hashtable elements in a function that receives the > reference of > this hastable ??? > > > In this example this foreach loop in "printHT" function dont work , > how is missed ? > > #!/usr/bin/perl > use strict; > use warnin

Re: How print a Hashtable with reference ?

2007-09-22 Thread John W. Krahn
Santana wrote: Hei all, Hello, how print a hashtable elements in a function that receives the reference of this hastable ??? In this example this foreach loop in "printHT" function dont work , how is missed ? #!/usr/bin/perl use strict; use warnings; sub printHT($) You are using a pr

Re: Pbm in Sorting the hash

2007-09-22 Thread Dr.Ruud
sivasakthi schreef: > Could u help me to solve the pbm??? Try this first: s/\bu\b/you/ s/\bpbm\b/problem/ s/\?{3}/?/ -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

How print a Hashtable with reference ?

2007-09-22 Thread Santana
Hei all, hoe a print a hashtable elements in a function that receives the reference of this hastable ??? In this example this foreach loop in "printHT" function dont work , how is missed ? #!/usr/bin/perl use strict; use warnings; sub printHT($) { my $T =$_[0]; foreach my $id (keys (%$

Can the defined operator/function be overridden?

2007-09-22 Thread Marcio Faustino
Hi, Can the defined operator/function be overridden? I ask this because when I try to override it, apparently nothing happens. For example: # use strict; use subs 'defined'; use warnings; sub defined($@) { print "Inside defined\n"; } defined(0) or die; #-

Re: Environment variable evaluation in a conditional

2007-09-22 Thread smdspamcatcher
On Sep 20, 9:29 am, [EMAIL PROTECTED] wrote: > On Sep 20, 2:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > > I am currently trying to write a Perl program in a Solaris 9 > > > environment > > > I am trying to process a list of variables with UNIX environmen

database insert algorithm

2007-09-22 Thread Luke
Hello, I am looking for a proper, fastest and most reasonable way to insert data from pretty big file (~1,000,000 lines) to database. I am using Win32::ODBC (ActiveState Perl) module to connect with Access/MSSQL database and inserting line after line. I was wondering if there is a better way to do

Editing a text file with perl.

2007-09-22 Thread SerriaRomeo
Ok, this is a very newbie problem, I'm just not smart enough to figure out how to do it. I have text in a file that looks like this. 0 !~ Syntax: ! ! repeats the last command you typed. ~ 0 "REMOVE INVIS"~ Syntax: cast 'remove invis' This spell will make an invisible object in the character'

Re: Environment variable evaluation in a conditional

2007-09-22 Thread Tom Phoenix
On 9/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > $dir_to_check = `echo $dir_to_check`; > > if (-e $dir_to_check) now finds the appropriate directory. Does it really? When $dir_to_check ends with a newline? Surely you jest. But just for fun my $dir_to_check = 'fred; rm /your/favo

Re: Can the defined operator/function be overridden?

2007-09-22 Thread Tom Phoenix
On 9/21/07, Marcio Faustino <[EMAIL PROTECTED]> wrote: > Can the defined operator/function be overridden? Have you seen what the perlsub manpage has to say about "Overriding Built-in Functions"? http://perldoc.perl.org/perlsub.html#Overriding-Built-in-Functions-built-in-override-CORE-CORE%3

Re: Can the defined operator/function be overridden?

2007-09-22 Thread John W. Krahn
Marcio Faustino wrote: Hi, Hello, Can the defined operator/function be overridden? perldoc -f prototype prototype FUNCTION Returns the prototype of a function as a string (or "undef" if the function has no prototype). FUNCTION is a reference to, or the

Re: Can the defined operator/function be overridden?

2007-09-22 Thread Gunnar Hjalmarsson
Marcio Faustino wrote: Can the defined operator/function be overridden? I ask this because when I try to override it, apparently nothing happens. For example: # use strict; use subs 'defined'; use warnings; sub defined($@) { print "Inside defined\n"; } defined(0

Re: Editing a text file with perl.

2007-09-22 Thread John W. Krahn
SerriaRomeo wrote: Ok, this is a very newbie problem, I'm just not smart enough to figure out how to do it. I have text in a file that looks like this. 0 !~ Syntax: ! ! repeats the last command you typed. ~ 0 "REMOVE INVIS"~ Syntax: cast 'remove invis' This spell will make an invisible obj