how to open a file with 666 permission

2004-09-29 Thread arjun.mallik
Hai! My requirement is to open file with 666 permissions.[If fine doesn't exists it should get created ].Iam doing as below,is this ok. === sysopen(LOG,"$main::TRACELOGFILE",O_CREATE,0666) or die "Can't open trace file $main::TRACELOGFILE"; am

How to track the success of insert

2004-09-29 Thread Anish Kumar K.
Hi I was trying out some practice examples with DBI and CGI and kind of stuck while doing a comparison That is if I could insert successfully into a databse a script window shld come "Success". but when the insert fails a window shld come saying "Can;t insert ".. How will I track if the inse

RE: How to track the success of insert

2004-09-29 Thread NYIMI Jose \(BMB\)
> -Original Message- > From: Anish Kumar K. [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 9:28 AM > To: beginners perl > Subject: How to track the success of insert > > > Hi > > I was trying out some practice examples with DBI and CGI and > kind of stuck while doing

RE: How to track the success of insert

2004-09-29 Thread NYIMI Jose \(BMB\)
> -Original Message- > From: Anish Kumar K. [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 9:28 AM > To: beginners perl > Subject: How to track the success of insert > > > Hi > > I was trying out some practice examples with DBI and CGI and > kind of stuck while doing a

How to find if a key exist in hash?

2004-09-29 Thread Edward Wijaya
Hi, I have the following code, and I know it is HORRIBLE. I wonder if I can do it in more efficient and elegant way? Thanks so much and Regards, Edward WIJAYA SINGAPORE __BEGIN__ use strict; use warnings; use Getopt::Std; use Data::Dumper; my %hash = ( A => 'blabla', B => 'dadada',

Re: How to find if a key exist in hash?

2004-09-29 Thread Gunnar Hjalmarsson
Edward Wijaya wrote: Subject: How to find if a key exist in hash? There is a builtin Perl function for the purpose. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to find if a key exist in hash?

2004-09-29 Thread NYIMI Jose \(BMB\)
> -Original Message- > From: Edward Wijaya [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 12:17 PM > To: [EMAIL PROTECTED] > Subject: How to find if a key exist in hash? > > > Hi, > > I have the following code, > and I know it is HORRIBLE. > > I wonder if I can do it

UNIX Process List (U)

2004-09-29 Thread Meidling, Keith, CTR, ISD
UNCLASSIFIED Is there a module to get a list of processes on a UNIX/Linux machine, or would I just do a `ps` and save it to an array? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: directory copy command

2004-09-29 Thread Jenda Krynicky
From: Urs Wagner <[EMAIL PROTECTED]> > Is there a similar perl command for directory copy like the File:Copy? > I thinks this one does not work for directories. If you did not mind it's Windows only then Win32::FileOp::Copy. Comes with optional progress and confirmation dialogs and other goodies

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Randal L. Schwartz
> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: Gavin> I really like Perl, but lately everywhere I seem to go and talk Gavin> to say I shouldn't be learning Perl as it's old and Python is Gavin> better. Perl is more powerful. Python is simpler. Python is for people who don't want to ma

Re: How to find if a key exist in hash?

2004-09-29 Thread max4o
%a = ( "a" => 1, "b" => 2, "c" => 3 ); $searchKey = "a"; print "Found $searchKey" if defined($a{$searchKey}); - This mail is from: <[EMAIL PROTECTED]> - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

fork/exec/pipe

2004-09-29 Thread Zafer Leylek
Hi I am trying to control to start an octave process where I can write to it read the output back into perl. For example I would like to : 1 - Start octave 2 - Write a=1 b=2. Read output into perl 3 - Write a+b. Read output into perl and so on. Could someone please help me do this. Thanks --

Re: How to find if a key exist in hash?

2004-09-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: %a = ( "a" => 1, "b" => 2, "c" => 3 ); $searchKey = "a"; print "Found $searchKey" if defined($a{$searchKey}); Try that with this hash: my %a = ( a => undef, b => undef, c => undef, ); defined() does not tell you if a key exists. perldoc -f exists Jo

RE: how to open a file with 666 permission

2004-09-29 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hai! > My requirement is to open file with 666 permissions. You need to set umask to 0 before creating the file. But don't do that. It's inadvisable to mess with the umask in a program, IMO. If the user wants to create files as 666, let him set the umask before running

Re: how to open a file with 666 permission

2004-09-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hai! Hello, My requirement is to open file with 666 permissions.[If fine doesn't exists it should get created ].Iam doing as below,is this ok. === sysopen(LOG,"$main::TRACELOGFILE",O_CREATE,0666) or die "Can't open trace file $main::TRACELOGFILE"; ==

Re: how to open a file with 666 permission

2004-09-29 Thread John W. Krahn
Bob Showalter wrote: [EMAIL PROTECTED] wrote: My requirement is to open file with 666 permissions. You need to set umask to 0 before creating the file. But don't do that. It's inadvisable to mess with the umask in a program, IMO. If the user wants to create files as 666, let him set the umask befor

RE: how to open a file with 666 permission

2004-09-29 Thread arjun.mallik
Hey guys ! Thanks for the support .the following is the code I have written. Working fine. === open(LOG,">$main::TRACELOGFILE") or die "Can't open trace file $main::TRACELOGFILE"; system("chown XXX:Y $main::TRACELOGFILE"); system("chmod 0666 $main::TRACELOGF

Re: how to open a file with 666 permission

2004-09-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hey guys ! Thanks for the support .the following is the code I have written. Working fine. === open(LOG,">$main::TRACELOGFILE") or die "Can't open trace file $main::TRACELOGFILE"; system("chown XXX:Y $main::TRACELOGFILE"); system("chmo

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
Randal L. Schwartz said: >> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: Wow I didn't know that you read this list. I am learning from your book and I am catching up with all the columns you have ever published on your site. I am actually getting paid to learn Python now, and fran

Fwd: UNIX Process List (U)

2004-09-29 Thread Errin Larsen
On Wed, 29 Sep 2004 07:52:53 -0400, Meidling, Keith, CTR, ISD <[EMAIL PROTECTED]> wrote: > UNCLASSIFIED > > Is there a module to get a list of processes on a UNIX/Linux machine, or > would I just do a `ps` and save it to an array? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional

current directory

2004-09-29 Thread Urs Wagner
Hello How can I find out the current directory? I call chdir, afterwards I should switch back to the old one. Thanks Urs -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread John W. Krahn
Gavin Henry wrote: Randal L. Schwartz said: Remember "new coke", and how long we had that. (If you're old enough to remember that fiasco.) Again, thanks for this. My morale is now completely topped up, so I am going to shell out for Programming Perl, although I do have the CD Bookshelf 3.0 (better

Creating a word document

2004-09-29 Thread paul beckett (JIC)
I've been trying to find a perl module that can create microsoft word documents and failed. Does anyone know of one? Cheers, Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: current directory

2004-09-29 Thread Errin Larsen
Hi Urs, You should look at Cwd: perldoc Cwd That capital "C" in "Cwd" is relevant. --Errin On Wed, 29 Sep 2004 15:24:06 +0200, Urs Wagner <[EMAIL PROTECTED]> wrote: > Hello > > How can I find out the current directory? I call chdir, afterwards I > should switch back to the old one. > > Th

Re: current directory

2004-09-29 Thread John W. Krahn
Urs Wagner wrote: Hello Hello, How can I find out the current directory? I call chdir, afterwards I should switch back to the old one. perldoc Cwd John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Need help with script

2004-09-29 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I have a file with the following format Object1 "Description1" Object2 "Description" Object3 "Description" I would like the output in the following format object1<...tab>Description1 object2<...tab>Description2 object3<...tab>Description3 Thanks -- To unsubscribe, e-mail: [EMAIL

How to access first key of "Hash of Hash"

2004-09-29 Thread Edward Wijaya
Hi, I have this HoH: my %HoH = ( firstkey => { A => 'blabla', B => 'dadada', C => 'tititi',} ); generated with $HoH{$fkey}{$alpha}=$text; how can I access the value of the first key, so that it gives: "firstkey" I tried this with no avail: print "$HoH{$fkey}\

Re: Using variables to store statements/formulae in perl

2004-09-29 Thread Wiggins d Anconia
> Hello Perl Beginners, > > I'm writing a program in perl that collects data about calls into a > telephone system and presents some statistics based on it. There could > come a time in the future where different data needs to be used and > different statistics need to be reported on so I'm tryin

Re: fork/exec/pipe

2004-09-29 Thread Wiggins d Anconia
> Hi > > I am trying to control to start an octave process where I can write > to it read the output back into perl. > > For example I would like to : > > 1 - Start octave > 2 - Write a=1 b=2. Read output into perl > 3 - Write a+b. Read output into perl and so on. > > Could someone please help

Re: Need help with script

2004-09-29 Thread Wiggins d Anconia
Please use a more descriptive subject line > I have a file with the following format > > Object1 > "Description1" > > Object2 > "Description" > > Object3 > "Description" > > I would like the output in the following format > object1<...tab>Description1 > object2<...tab>Description2

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Wiggins d Anconia
> Hi, > > I have this HoH: > my %HoH = ( > firstkey => { A => 'blabla', > B => 'dadada', > C => 'tititi',} > ); > > generated with > > $HoH{$fkey}{$alpha}=$text; > > how can I access the value > of the first key, so that it gives: "firstkey" > This i

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
John W. Krahn said: > Gavin Henry wrote: >> Randal L. Schwartz said: >>> >>>Remember "new coke", and how long we had that. (If you're old enough >>>to remember that fiasco.) >> >> Again, thanks for this. My morale is now completely topped up, so I am >> going to shell out for Programming Perl, alth

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 14:37, Edward Wijaya wrote: > Hi, Hi. > I have this HoH: > my %HoH = ( > firstkey => { A => 'blabla', > B => 'dadada', > C => 'tititi',} > ); > > generated with > > $HoH{$fkey}{$alpha}=$text; > > how can I access the value > of

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread JupiterHost.Net
My what long lines you have :) It may not be commercial grade but, who of us writes commerical applications all the time. I do mostly, private corporate backends mostly among other things :) I use it for the quick tasks and simple scripts also of course. (the projects never end the same as durabi

Re: Need help with script

2004-09-29 Thread Ramprasad A Padmanabhan
On Wed, 2004-09-29 at 18:55, PerlDiscuss - Perl Newsgroups and mailing lists wrote: > I have a file with the following format > > Object1 > "Description1" > > Object2 > "Description" > > Object3 > "Description" > > I would like the output in the following format > object1<...tab>Description

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Edward Wijaya
On 29 Sep 2004 14:58:00 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: If I understood this correctly, you want to do this: So sorry for being not clear. I will extend just a bit. Suppose I have: my %HoH = ( firstkey => { A => 'blabla', B => 'dadada',

Re: Problem iterating over diamond (while)

2004-09-29 Thread Peter Scott
Nitpick - the "diamond operator" is <>. would be use of the "readline operator". -- Peter Scott http://www.perldebugged.com/ *** NEW *** http://www.perlmedic.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Edward Wijaya
On 29 Sep 2004 15:20:39 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: for (keys %HoH) { print "$_\n"; } It seems so. Thanks a lot. I thought 'keys' are only for simple hash. Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
JupiterHost.Net said: > My what long lines you have :) > >> It may not be commercial grade but, who of us writes commerical >> applications all the time. > > I do mostly, private corporate backends mostly among other things :) > I use it for the quick tasks and simple scripts also of course. (the >

Re: Problem iterating over diamond (while)

2004-09-29 Thread Edward Wijaya
On 29 Sep 2004 14:06:33 -, Peter Scott <[EMAIL PROTECTED]> wrote: Nitpick - the "diamond operator" is <>. would be use of the "readline operator". Thanks for making it precise Peter. Glad that I learnt that. Forgive me for my limited Perl vocabulary. Regards, Edward WIJAYA SINGAPORE -- To uns

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Flemming Greve Skovengaard
Edward Wijaya wrote: On 29 Sep 2004 14:58:00 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: If I understood this correctly, you want to do this: So sorry for being not clear. I will extend just a bit. Suppose I have: my %HoH = ( firstkey => { A => 'blabla', B => 'dada

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Wiggins d Anconia
> My what long lines you have :) > > > It may not be commercial grade but, who of us writes commerical applications all the time. > > I do mostly, private corporate backends mostly among other things :) > I use it for the quick tasks and simple scripts also of course. (the > projects never end

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 15:18, Edward Wijaya wrote: > On 29 Sep 2004 14:58:00 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > If I understood this correctly, you want to do this: > > > > So sorry for being not clear. > I will extend just a bit. > > Suppose I have: > > my %HoH = ( >

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Errin Larsen
On Wed, 29 Sep 2004 22:18:49 +0800, Edward Wijaya <[EMAIL PROTECTED]> wrote: > On 29 Sep 2004 14:58:00 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > If I understood this correctly, you want to do this: > > > > So sorry for being not clear. > I will extend just a bit. > > Suppose I

Re: how to open a file with 666 permission

2004-09-29 Thread Gunnar Hjalmarsson
Bob Showalter wrote: You need to set umask to 0 before creating the file. But don't do that. It's inadvisable to mess with the umask in a program, IMO. Why would that be inadvisable? If the user wants to create files as 666, let him set the umask before running your program. If the program, for som

RE: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread NYIMI Jose \(BMB\)
> -Original Message- > From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 29, 2004 4:38 PM > To: JupiterHost.Net; [EMAIL PROTECTED] > Subject: Re: Becoming Disenheartened - Everyone talks about > Python and says Perl is old news. > > > > My what long lines

RE: how to open a file with 666 permission

2004-09-29 Thread Bob Showalter
Gunnar Hjalmarsson wrote: > Bob Showalter wrote: > > You need to set umask to 0 before creating the file. > > > > But don't do that. It's inadvisable to mess with the umask in a > > program, IMO. > > Why would that be inadvisable? The spirit of umask is to allow the user/sysadmin to control the

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread JupiterHost.Net
Wiggins d Anconia wrote: I like this thread, lots of opinions + not too many flames = productive learning U ignorant piece of uh sorry hehe good one :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

POSIX module

2004-09-29 Thread Errin Larsen
Hi Perlers, I've seen a lot of tutorial or example code dealing with the POSIX module that does something like this: use POSIX ':sys_wait_h'; What does the ':' mean/do in the above line? --Errin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 15:32, Edward Wijaya wrote: > On 29 Sep 2004 15:20:39 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > > > > > for (keys %HoH) { > > print "$_\n"; > > } > > > > It seems so. Thanks a lot. Glad to be of help :-) > I thought 'keys' are only for simple hash.

Help with ARP scan/reverse DNS script

2004-09-29 Thread Jason Noble
this script is supposed to take an input like 10.0.1.0/24 and output something like this HOSTNAME MACADDRESS node-1 00:30:48:28:E9:7E node-2 00:30:48:29:12:1A but it is only returning very few if any results. anyone have any ideas, or maybe a better way to do this? #!/usr/bin/perl use strict; u

RE: POSIX module

2004-09-29 Thread Bob Showalter
Errin Larsen wrote: > Hi Perlers, > > I've seen a lot of tutorial or example code dealing with the POSIX > module that does something like this: > > use POSIX ':sys_wait_h'; > > What does the ':' mean/do in the above line? It's called a "tag" and is typically used to import a "basket" of symb

Converting special characters?

2004-09-29 Thread KEVIN ZEMBOWER
I've been given the job of writing a CGI script to receive the data from a form and append it to a text file. Later, the text file will be analyzed using MS Access. My problem is escaping characters which are often used as delimiters in text-based importing formats, such as ' or " or \t or \n. A

RE: POSIX module

2004-09-29 Thread Jim
> Hi Perlers, > > I've seen a lot of tutorial or example code dealing with the > POSIX module that does something like this: > > use POSIX ':sys_wait_h'; > > What does the ':' mean/do in the above line? > Besides googling for it, try reading: perldoc perlipc perldoc perldoc -f waitpid perl

RE: How to access first key of "Hash of Hash"

2004-09-29 Thread Bob Showalter
Edward Wijaya wrote: > I thought 'keys' are only for simple hash. All hashes are simple hashes, if you think about it. Each entry is a string key and a scalar value. There is no other kind of hash. Now that scalar value can be a *reference* to something else, and you get a bit of syntactic sugar

Re: POSIX module

2004-09-29 Thread Errin Larsen
On Wed, 29 Sep 2004 11:32:58 -0400, Jim <[EMAIL PROTECTED]> wrote: > > > > > Hi Perlers, > > > > I've seen a lot of tutorial or example code dealing with the > > POSIX module that does something like this: > > > > use POSIX ':sys_wait_h'; > > > > What does the ':' mean/do in the above line? >

Create hash from MySQL field headers

2004-09-29 Thread Steve Bertrand
Hi all, I've been developing a module for our accounting system and am trying to create a hash with the names equal to the fieldnames of the database table. It seems as though 'ListFields' is not functioning, and am wondering if there is another way. I simply want to SELECT a single line from th

RE: POSIX module

2004-09-29 Thread Bob Showalter
Errin Larsen wrote: > When I use the following in my code, it runs and > works fine: > > use POSIX 'setsid'; > use POSIX 'errno_h'; > use POSIX ':sys_wait_h'; > > However, when I try to combine those into one line: > > use POSIX qw/setsid errno_h :sys_wait_h/; > > Then I get the follow

Re: Create hash from MySQL field headers

2004-09-29 Thread JupiterHost.Net
Steve Bertrand wrote: Hi all, Hello, I've been developing a module for our accounting system and am trying to create a hash with the names equal to the fieldnames of the database table. It seems as though 'ListFields' is not functioning, and am wondering if there is another way. I simply want to SE

Re: POSIX module

2004-09-29 Thread Errin Larsen
On Wed, 29 Sep 2004 12:27:03 -0400, Bob Showalter <[EMAIL PROTECTED]> wrote: > Errin Larsen wrote: > > When I use the following in my code, it runs and > > works fine: > > > > use POSIX 'setsid'; > > use POSIX 'errno_h'; > > use POSIX ':sys_wait_h'; > > > > However, when I try to combine thos

Re: Converting special characters?

2004-09-29 Thread Wiggins d Anconia
> I've been given the job of writing a CGI script to receive the data from a form and append it to a text file. Later, the text file will be analyzed using MS Access. My problem is escaping characters which are often used as delimiters in text-based importing formats, such as ' or " or \t or \n. An

Re: Create hash from MySQL field headers

2004-09-29 Thread Steve Bertrand
> Steve Bertrand wrote: > >> Hi all, > > Hello, > >> I've been developing a module for our accounting system and am >> trying >> to create a hash with the names equal to the fieldnames of the >> database table. >> >> It seems as though 'ListFields' is not functioning, and am wondering >> if there i

RE: how to open a file with 666 permission

2004-09-29 Thread Chris Devers
On Wed, 29 Sep 2004 [EMAIL PROTECTED] wrote: > Thanks for the support .the following is the code I have written. > Working fine. Still not right though -- it was suggested to you that you use the $! variable in your die statement so that you get the error message, hence: do_stuff( $arg) or di

Re: Converting special characters?

2004-09-29 Thread KEVIN ZEMBOWER
>>> Wiggins d Anconia <[EMAIL PROTECTED]> 09/29/04 12:08PM >>> If possible you should consider using a CSV formatting module, this will translate best into Access (which you should avoid completely if possible). Text::CSV or even DBI/D::CSV are excellent. These modules will allow you to setup you

Re: Create hash from MySQL field headers

2004-09-29 Thread JupiterHost.Net
perldoc DBI look for selectrow_hashref Mucho gracias... I'll look it up, but the name certainly implies that it is what I am after. Glad I could help :) HTH :) I'm certain it will. Thanks again! Steve Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: how to open a file with 666 permission

2004-09-29 Thread Chris Devers
On Wed, 29 Sep 2004, Bob Showalter wrote: > Gunnar Hjalmarsson wrote: > > > > If the program, for some reason, requires that a file it creates has > > certain permissions, isn't it better to have the program set those > > permissions? > > Why would the program itself require this? Perhaps the

RE: how to open a file with 666 permission

2004-09-29 Thread Bob Showalter
Chris Devers wrote: > On Wed, 29 Sep 2004, Bob Showalter wrote: > > > Gunnar Hjalmarsson wrote: > > > > > > If the program, for some reason, requires that a file it creates > > > has certain permissions, isn't it better to have the program set > > > those permissions? > > > > Why would the progr

RE: how to open a file with 666 permission

2004-09-29 Thread Chris Devers
On Wed, 29 Sep 2004, Bob Showalter wrote: > Chris Devers wrote: > > > Maybe the program is a code generator that produces other > > files which should be executable (I can't remember anyone doing this, > > but there's no reason why it couldn't be reasonably be done). > > Fine, use creation bits

subroutines and modules

2004-09-29 Thread DBSMITH
Perl'ers I am reading Object Oriented Perl pages 52 and 53 for setting up a module. It is telling me in order to use a routine from a different file you have to 1) choose a lib directory 2) export PERL5LIB=.../.../.../ use lib /usr/local/perl/my.pl 3) created nested subdirs for each compon

Re: Need help with script

2004-09-29 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: On Wed, 2004-09-29 at 18:55, PerlDiscuss - Perl Newsgroups and mailing lists wrote: I have a file with the following format Object1 "Description1" Object2 "Description" Object3 "Description" I would like the output in the following format object1<...tab>Descriptio

Re: Need help with script

2004-09-29 Thread JupiterHost.Net
I would like the output in the following format object1<...tab>Description1 object2<...tab>Description2 object3<...tab>Description3 perl -lne 'BEGIN{$/="\n\n";}s/\n/\t/;print' FILENAME perl -l -00pe's/\n/\t/' FILENAME That's pretty slick you guys, he's sure to get an A+ ;) If your tea

RFC on script

2004-09-29 Thread RichT
Hello knowledgeable perl type people im still very new to perl and, iv got my script "working", what is does in searches through a large data file finds the segments i need and outputs the data in a more use-full format. As i said id does work but im no to convinced the structure is

Re: connect through socks

2004-09-29 Thread William Melanson
On Sun, 26 Sep 2004, Ing. Branislav Gerzo wrote: > Hi perlers, > > anyone knows how to connect to a website and download it through socks > (ver 4,5) ? I tried IO::Socket::Socks and Net::SOCKS, but I can't get > them to work. I know it can be done via 'LWP::UserAgent'. Not sure via a socket thou

Re: how to open a file with 666 permission

2004-09-29 Thread Gunnar Hjalmarsson
Bob Showalter wrote: Chris Devers wrote: Maybe the program is a code generator that produces other files which should be executable (I can't remember anyone doing this, but there's no reason why it couldn't be reasonably be done). Fine, use creation bits of 0777. Are you saying that open FH, ">

Re: UNIX Process List (U)

2004-09-29 Thread Owen
On Wed, 29 Sep 2004 07:52:53 -0400 "Meidling, Keith, CTR, ISD" <[EMAIL PROTECTED]> wrote: > Is there a module to get a list of processes on a UNIX/Linux machine, or > would I just do a `ps` and save it to an array? There is a program in the Perl Cookbook called 'psgrep' which may meet your ne

Open a text file

2004-09-29 Thread Eduardo Vázquez Rodríguez
Hello everyone I have a question, how do I open a file in a specific line number, for example I want to open a text file exactly on line number 5, Thanks in advanced -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Open a text file

2004-09-29 Thread Chris Devers
On Wed, 29 Sep 2004, Eduardo Vázquez Rodríguez wrote: > I have a question, how do I open a file in a specific line number, for example > I want to open a text file exactly on line number 5, What have you tried so far? What problems did you have? Show us what you've tried and we can make suggest

(when) is the ; required?

2004-09-29 Thread John
I was just updating some old script and found a big switch full of one-liners. In one of the cases there is no ";". Why doesn't the interpreter flag that as a syntax error? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Open a text file

2004-09-29 Thread Eduardo Vázquez Rodríguez
Thanks Chris I try this and works $. = 0; do { $_ = } until $. == 5; WHILE { Do_whatever_you_like_begining_after_line_5(); :-) } Chris Devers wrote: On Wed, 29 Sep 2004, Eduardo Vázquez Rodríguez wrote: I have a question, how do I op

Re: (when) is the ; required?

2004-09-29 Thread Gunnar Hjalmarsson
John wrote: I was just updating some old script and found a big switch full of one-liners. In one of the cases there is no ";". Why doesn't the interpreter flag that as a syntax error? The ';' character separates statements within a block. Accordingly, it's not needed after the last statement.

Perl and Postgres

2004-09-29 Thread Eduardo Vázquez Rodríguez
Hello everybody out there using postgres and perl I am writing Perl scripts with the purpouse of parsing text and inserting the text parsed into a database, which I choose Postgresql. My scripts are many, exactly 7, if I ran each one of them sequencially, my processing speed is about 200 lines p

Re: (when) is the ; required?

2004-09-29 Thread Chris Devers
On Thu, 30 Sep 2004, Gunnar Hjalmarsson wrote: > The ';' character separates statements within a block. Accordingly, > it's not needed after the last statement. That said, it's a good habit to include it. If you ever come back to edit that file later, the original last statment might not always

Re: (when) is the ; required?

2004-09-29 Thread Gunnar Hjalmarsson
Chris Devers wrote: Gunnar Hjalmarsson wrote: The ';' character separates statements within a block. Accordingly, it's not needed after the last statement. That said, it's a good habit to include it. If you ever come back to edit that file later, the original last statment might not always be the l

RE: Creating a word document

2004-09-29 Thread Raymond Raj
hi use Win::OLE module some examples availbe at http://perlmonks.thepen.com/198045.html -Original Message- From: paul beckett (JIC) [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 6:58 PM To: [EMAIL PROTECTED] Subject: Creating a word document I've been trying to find a pe