Re: doubt with hash

2005-01-13 Thread Tor Hildrum
On Fri, 14 Jan 2005 12:09:03 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi All > > I have a hash say. %browserType in which assume there are values... > > %browserType=( > "IE"=>2, > "NETSCAPE"=>3, > "FIREFOX"=>5 > ); > > I need to calculate one morething say percentage utilisation for e

Re: use warnings

2005-01-13 Thread Owen Cook
On Fri, 14 Jan 2005, Mark Cohen wrote: > > While the use strict is quite clear to me "Perl pragma to restrict unsafe > contructs" , > the use warnings "Perl pragma to control optional warnings" is not. > What programming risks could I get without the use warnings ? perldoc -q warnings Found in

use warnings

2005-01-13 Thread Mark Cohen
Hello, While the use strict is quite clear to me "Perl pragma to restrict unsafe contructs" , the use warnings "Perl pragma to control optional warnings" is not. What programming risks could I get without the use warnings ? Thanks Mark -- To unsubscribe, e-mail: [EMAIL

xml and perl help

2005-01-13 Thread johnny yu
hello. i am new with perl and working on a program to sort and manage my dvds instead of using windows program. i export the windows data using built in function to make it xml, how can i read this with perl so i can put in mysql? i try xml::simple but it doesn't work. can someone show me exa

doubt with hash

2005-01-13 Thread Anish Kumar K.
Hi All I have a hash say. %browserType in which assume there are values... %browserType=( "IE"=>2, "NETSCAPE"=>3, "FIREFOX"=>5 ); I need to calculate one morething say percentage utilisation for each browser.. ie..If IE is 2 = the percentage is calculated as (2/(2+3+5))*100 NETSCAPE=(3/(

Re: Perl Socket

2005-01-13 Thread Mark Goland
- Original Message - From: "Groleo Marius" <[EMAIL PROTECTED]> To: Sent: Thursday, January 13, 2005 4:46 AM Subject: Perl Socket > Hi list! Hello Marius, > > im try-ing this code, to get a multi line server response: > > use Socket; > socket(sock, AF_INET, SOCK_STREAM, getprotobyname('

Re: strict and warnings

2005-01-13 Thread Chris Devers
On Thu, 13 Jan 2005, Randy W. Sims wrote: > But, I don't really worry about it. I've never used anything like that > in my code. If there are speed problems, there are usually better > candidates for optimization. I have never had to remove, or even think > about removing, either pragma for spe

Re: strict and warnings

2005-01-13 Thread Randy W. Sims
JupiterHost.Net wrote: Chris Devers wrote: On Thu, 13 Jan 2005, Dave Kettmann wrote: [...] Some of the time I see them say that the [strict / warnings] pragmas are good for developing programs/scripts. The way it is worded some times it seems as if after the program is written and in 'producti

Re: encoding script

2005-01-13 Thread Chris Devers
On Thu, 13 Jan 2005, JupiterHost.Net wrote: > > > perl -mstrict -we 'for(`ls`) { chomp;print `grep foo $_`; }' > > By which you're basically saying the following non-Perl statement:: > > > Right we already covered that a day or so ago, the shell is not the > way to go: Oh? I love Perl, but

Re: strict and warnings

2005-01-13 Thread JupiterHost.Net
Chris Devers wrote: On Thu, 13 Jan 2005, Dave Kettmann wrote: [...] Some of the time I see them say that the [strict / warnings] pragmas are good for developing programs/scripts. The way it is worded some times it seems as if after the program is written and in 'production' to take these lines

Re: strict and warnings

2005-01-13 Thread Chris Devers
On Thu, 13 Jan 2005, Dave Kettmann wrote: > [...] Some of the time I see them say that the [strict / warnings] > pragmas are good for developing programs/scripts. The way it is worded > some times it seems as if after the program is written and in > 'production' to take these lines out of the c

Re: checking for errors

2005-01-13 Thread John W. Krahn
John W. Krahn wrote: Tim Wolak wrote: I have a script that is checking a service to see if its running and that its log file does not contain two error message to confirm that it has not died. However the subrutine is just saying its up when I have put the error message in the last line of the l

Re: strict and warnings

2005-01-13 Thread Randy W. Sims
Dave Kettmann wrote: Hello all, I have seen in quite a few posts to the list from the non-beginners, who I think all of us beginners appreciate them taking their time to help us true beginners, make some references to the strict and warnings pragmas. So I have a question about them. Some of the tim

Re: checking for errors

2005-01-13 Thread John W. Krahn
Tim Wolak wrote: Hello all, Hello, I have a script that is checking a service to see if its running and that its log file does not contain two error message to confirm that it has not died. However the subrutine is just saying its up when I have put the error message in the last line of the log

Re: strict and warnings

2005-01-13 Thread John W. Krahn
Dave Kettmann wrote: Hello all, Hello, I have seen in quite a few posts to the list from the non-beginners, who I think all of us beginners appreciate them taking their time to help us true beginners, make some references to the strict and warnings pragmas. So I have a question about them. Some of

Re: strict and warnings

2005-01-13 Thread JupiterHost.Net
Dave Kettmann wrote: Hello all, hello, I have seen in quite a few posts to the list from the non-beginners, who I think all of us beginners appreciate them taking their time to help us true beginners, make some references to the strict and warnings pragmas. So I have a question about them. Some of

Re: Image Creation: labels

2005-01-13 Thread Daniel Kasak
Randy W. Sims wrote: Too mailing-specific or use some of the PostScript::* modules to roll your own. Now *THAT* is what I was after. Postscript::Simple seems to do everything I want, and *very* easily. Thanks :) -- Daniel Kasak IT Developer NUS C

Re: Image Creation: labels

2005-01-13 Thread Daniel Kasak
zentara wrote: On Thu, 13 Jan 2005 14:20:34 +1100, [EMAIL PROTECTED] (Daniel Kasak) wrote: I'm hunting for a method of creating labels under Linux. I've already looked at everything on freshmeat.net that came up when I searched for 'labels'. None of them cut it. Requirements: - Coloured, rotat

strict and warnings

2005-01-13 Thread Dave Kettmann
Hello all, I have seen in quite a few posts to the list from the non-beginners, who I think all of us beginners appreciate them taking their time to help us true beginners, make some references to the strict and warnings pragmas. So I have a question about them. Some of the time I see them say

Re: Transforming a space-separated string to an array for words.

2005-01-13 Thread Bryan R Harris
> Robin <[EMAIL PROTECTED]> suggested: >> This will split up the string based on the pattern (in this >> case, a single space. You may want to change that to gain >> robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) > > I suggest /\s+/ instead. This splits on any whitespace,

RE: Crypt SSLeay

2005-01-13 Thread Tham, Philip
I found the problem. Just as you explained I just ran perl at the command line and it invoked the perl that was bundled with Solaris. On repeating the same with /usr/local/bin/perl which I built, it worked. Thanks for your help. Philip -Original Message- From: Wiggins d Anconia [mailto:[E

upload files using MySQL database

2005-01-13 Thread Maxipoint Rep Office
how upload files with Perl using MySQL database? i wish that file be uploaded to the one folder on the server and the path og image must be added into MySQL database column.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: checking for errors

2005-01-13 Thread Ing. Branislav Gerzo
Tim Wolak [TW], on Thursday, January 13, 2005 at 09:15 (-0600) wrote about: TW> if ($newlog =~ /^Read failed on socket/ || /^EFIXException::/) { for me it seems, this line is bad, when you rewrite it to: if ($newlog =~ /^(Read failed on socket|EFIXException::)/) { it works ? -- ...

Re: checking for errors

2005-01-13 Thread JupiterHost.Net
Tim Wolak wrote: Hello all, I have a script that is checking a service to see if its running and that its log file does not contain two error message to confirm that it has not died. However the subrutine is just saying its up when I have put the error message in the last line of the log to mak

checking for errors

2005-01-13 Thread Tim Wolak
Hello all, I have a script that is checking a service to see if its running and that its log file does not contain two error message to confirm that it has not died. However the subrutine is just saying its up when I have put the error message in the last line of the log to make sure it sees th

Re: Any call-response subscription packages available ?

2005-01-13 Thread Wiggins d Anconia
> WebDragon wrote: > > I'm curious to know if there are any generic call-response subscribe > > packages out there written in Perl (preferably object oriented in design) > > > > i.e. what I am looking for is, > > { > > o user subscribes via form on website, gives e-mail address and > > crea

Re: Break a loop in Netware's PERL

2005-01-13 Thread Jenda Krynicky
From: "GMane Python" <[EMAIL PROTECTED]> > > do > { >my $MySocket=new IO::Socket::INET->new(Proto=>"udp", >PeerPort=>43278, >PeerAddr=>'10.151.24.174' > ) or die "Can't make UDP socket: $@"; >$msg="PyHB"; > >print "Sending Heartbeat."; >$MySocket->send($ms

Re: Any call-response subscription packages available ?

2005-01-13 Thread Jenda Krynicky
From: "Scott R. Godin" <[EMAIL PROTECTED]> > WebDragon wrote: > > I'm curious to know if there are any generic call-response subscribe > > packages out there written in Perl (preferably object oriented in > > design) > > > > i.e. what I am looking for is, > > { > > o user subscribes via form

Re: Precedence confusion

2005-01-13 Thread Jan Eden
Hi John, John W. Krahn wrote on 13.01.2005: >Jan Eden wrote: >>It also does not show up if I enclose the ternary operator in >>brackets: >> >>my $server = shift || ($string =~ /(foo|bar)/ ? $1 : 'default'); >> >>While this solves my problem, I still do not get the reason for it. >>Could someone

RE: Crypt SSLeay

2005-01-13 Thread Wiggins d Anconia
Please bottom post > I faced two problems: > > 1. The build assumes that cc is the default compiler in the system. I > have gcc > 2. I created a link from gcc to cc to fixed the above. This time it is > rejecting some of the compile options like -KPIC and -x03 and -xdepend. > It seems these o

Re: Any call-response subscription packages available ?

2005-01-13 Thread Scott R. Godin
WebDragon wrote: I'm curious to know if there are any generic call-response subscribe packages out there written in Perl (preferably object oriented in design) i.e. what I am looking for is, { o user subscribes via form on website, gives e-mail address and creates a password o user is

Re: A Beginner's problem

2005-01-13 Thread John W. Krahn
Doug Essinger-Hileman wrote: I am just learning Perl, and am having a problem with something which seems like it should be so easy. Still . . . . I have read through a couple of books, including _Beginning Perl_ and _Picking Up Perl_, to no avail. I am trying to read a file, then assign some in

Re: encoding script

2005-01-13 Thread JupiterHost.Net
perl -mstrict -we 'for(`ls`) { chomp;print `grep foo $_`; }' By which you're basically saying the following non-Perl statement:: Right we already covered that a day or so ago, the shell is not the way to go: perl -mstrict -MFile::Slurp -we 'for(read_dir(".")) { print "Process $_ here\n"; }

Re: A Beginner's problem

2005-01-13 Thread JupiterHost.Net
Doug Essinger-Hileman wrote: I am just learning Perl, and am having a problem with something which seems like it should be so easy. Still . . . . I have read through a couple of books, including _Beginning Perl_ and _Picking Up Perl_, to no avail. I am trying to read a file, then assign some i

Re: Break a loop in Netware's PERL

2005-01-13 Thread GMane Python
But I;ve already got a sleep 5 in there. See? use IO::Socket::INET; #use Time::HiRes qw( time alarm sleep ); do { my $MySocket=new IO::Socket::INET->new(Proto=>"udp", PeerPort=>43278, PeerAddr=>'10.151.24.174' ) or die "Can't make UDP socket: $@"; $msg="PyHB"; pr

RE: A Beginner's problem

2005-01-13 Thread Bob Showalter
Doug Essinger-Hileman wrote: > I am just learning Perl, and am having a problem with something which > seems like it should be so easy. Still . . . . I have read through a > couple of books, including _Beginning Perl_ and _Picking Up Perl_, to > no avail. Welcome! > > I am trying to read a file,

Re: Precedence confusion

2005-01-13 Thread John W. Krahn
Jan Eden wrote: Hi, Hello, I wrote the following: #!/usr/bin/perl -wT use strict; my ($server) = sitemode("test"); print $server; sub sitemode { my $string = "foonky"; my $server = shift || $string =~ /(foo|bar)/ ? $1 : 'default'; return $server; } Now this throws an error. The error do

A Beginner's problem

2005-01-13 Thread Doug Essinger-Hileman
I am just learning Perl, and am having a problem with something which seems like it should be so easy. Still . . . . I have read through a couple of books, including _Beginning Perl_ and _Picking Up Perl_, to no avail. I am trying to read a file, then assign some information within a script. T

Re: Pattern matching variables

2005-01-13 Thread Tor Hildrum
On Wed, 12 Jan 2005 17:27:46 -0700, Dan Fish <[EMAIL PROTECTED]> wrote: > Are ALL pattern matching variables set back to undef once another m// or > s/// expression is encountered, even if it contains no parenthized > expressions? > > For example, I would have expected $1 & $2 to be valid in BOTH

Re: Pattern matching variables

2005-01-13 Thread John W. Krahn
Dan Fish wrote: Are ALL pattern matching variables set back to undef once another m// or s/// expression is encountered, even if it contains no parenthized expressions? perldoc perlre [snip] The numbered match variables ($1, $2, $3, etc.) and the related punctuation set ($+, $&, $`,

Precedence confusion

2005-01-13 Thread Jan Eden
Hi, I wrote the following: #!/usr/bin/perl -wT use strict; my ($server) = sitemode("test"); print $server; sub sitemode { my $string = "foonky"; my $server = shift || $string =~ /(foo|bar)/ ? $1 : 'default'; return $server; } Now this throws an error. The error does not occur when

RE: Transforming a space-separated string to an array for words.

2005-01-13 Thread Thomas Bätzler
Robin <[EMAIL PROTECTED]> suggested: > This will split up the string based on the pattern (in this > case, a single space. You may want to change that to gain > robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) I suggest /\s+/ instead. This splits on any whitespace, and it'l

Pattern matching variables

2005-01-13 Thread Dan Fish
Are ALL pattern matching variables set back to undef once another m// or s/// expression is encountered, even if it contains no parenthized expressions? For example, I would have expected $1 & $2 to be valid in BOTH print statements below... #!/usr/bin/perl -w # $string="ABC DEF GHI JKL MNO PQ

Perl Socket

2005-01-13 Thread Groleo Marius
Hi list! im try-ing this code, to get a multi line server response: use Socket; socket(sock, AF_INET, SOCK_STREAM, getprotobyname('tcp')) || die "error: $!\n"; $dest = sockaddr_in($_[0], inet_aton($_[1])); connect(sock, $dest) || die "error: $!\n"; select(sock); while ($response=) {

Output ordering for hash

2005-01-13 Thread Rohit RS
After parsing an XMl file i get the Data:Dumper output as $VAR1 = { 'xmlns:xsi' => http://www.w3.org/2001/XMLSchema-instance', 'EmployeeTemplate' => { 'Details' => { 'Age' => [ ' 26', ' 28'

Re: problem with extracting line

2005-01-13 Thread Randy W. Sims
Anish Kumar K. wrote: Hi I have text file in which I have the below mentioned lines This is a test start-first First Line testing end-first How are you Finally start-second Tested end-second I have a perl file which reads the above file and stores in the variable