Re: How to print HTML immediately, and more than once?

2003-06-01 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randal L. Schwartz) writes: >> "Martin" == Martin Lomas <[EMAIL PROTECTED]> writes: >Martin> I'm writing a simple file upload script. I have all the form >Martin> and file handling stuff done. I want the script to write an >Martin> HTML messag

Sending free SMS through perl

2003-06-01 Thread Aman Thind
Hi All How can I send a free SMS through perl ? I am fighting a losing battle with WWW-SMS-0.09. I created an account on gomobile.ch but everytime i try to send an sms using gomobile as the submodule I get an error msg saying my number is not compatible with gomobile gateway...however it took th

Perl Text to Wav

2003-06-01 Thread Jan van den Berg
Hi there, I was wondering if some of you might have come across a free module/ program with which it is possible to do to text to wav conversion. I've been looking at this for some time, but I don't seem to get anywhere. What I am asking is mostly regarded Text-to-Speech (TTS), I don't reall

Re: Perl Text to Wav

2003-06-01 Thread Tassilo von Parseval
On Sat, May 31, 2003 at 11:51:59AM -0400 Jan van den Berg wrote: > I was wondering if some of you might have come across a free module/ > program with which it is possible to do to text to wav conversion. > > I've been looking at this for some time, but I don't seem to get > anywhere. > > What I

Re: How to print HTML immediately, and more than once?

2003-06-01 Thread Randal L. Schwartz
> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: Peter> In article <[EMAIL PROTECTED]>, Peter> [EMAIL PROTECTED] (Randal L. Schwartz) writes: >>> "Martin" == Martin Lomas <[EMAIL PROTECTED]> writes: Martin> I'm writing a simple file upload script. I have all the form Martin> and file

RE: Perl Text to Wav

2003-06-01 Thread Jan van den Berg
You're right I should have clarified myself a little more This relates to Perl in a sense that I am writing a Perl program in which I want to incorporate these functions. I.e. the program produces some text, this text I want to synthesize to a wav and use it later. Regards, Jan van den Berg

Re: How to print HTML immediately, and more than once?

2003-06-01 Thread WC -Sx- Jones
PMFJI: Martin> I'm writing a simple file upload script. I have all the form Martin> and file handling stuff done. I want the script to write an Martin> HTML message to the user browser before the upload begins, you Martin> know, like "Upload in progress". Then when the upload Martin> completes, I

Re: How to print HTML immediately, and more than once?

2003-06-01 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randal L. Schwartz) writes: >No, please read the original question a bit more carefully. Martin >wants some sort of activity to occur as a result of the beginning and >ending of a POST containing a file-upload. Since the browser starts >the POST

Re: GetOpt Help

2003-06-01 Thread R. Joseph Newton
Kevin Pfeiffer wrote: > Hi Paul, > > sub get_class_types > > { > > my $self = shift; > > > > my $roots = []; > > my $unresolved = []; > > > > while (my ($class, $props) = each %{$self->{classes}}) > > { > > push @{$props->{parent} ? $unresolved : $roots}, $class; >

Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread Richard Heintze
Some help understanding this program would be greatly appreciated! I'm really struggling with this perl language! Thanks, siegfried my $x= {'d' => 'y', 'f' => 'g'}, $y = ['a', 'b', 'c', 'd']; # This works! Good! foreach my $i (@{$y}){ print "array i = $i\n" } # (1) Why does

count of words (fields) after "split"

2003-06-01 Thread Richard Müller
Hi, I'm a very newbie with perl. I have a text file and want to read it line by line and split it into words: my @fields = split / /, $_; - so far no problem. Now I have to count the words in the line. This I could not achieve. I#m sure it is very simple - but I did not find the suitable command --

RE: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Richard Heintze wrote: > Some help understanding this program would be greatly > appreciated! I'm really struggling with this perl > language! > Thanks, > siegfried > You should always use warnings and strict. In the first portion, you had a comma after the end of $x lin

Re: count of words (fields) after "split"

2003-06-01 Thread Beau E. Cox
- Original Message - From: "Richard Müller" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 8:04 AM Subject: count of words (fields) after "split" Hi, I'm a very newbie with perl. I have a text file and want to read it line by line and split it into words: my @f

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 12:51 PM, Richard Heintze wrote: my $x= {'d' => 'y', 'f' => 'g'}, $y = ['a', 'b', 'c', 'd']; I am surprised this works. I would write this as: my($x, $y) = ( { d => 'y', f => 'g' }, [ qw(a b c d) ] ); The => operator automatically quotes barewords in front of

RE: count of words (fields) after "split"

2003-06-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Richard Müller wrote: > Hi, > I'm a very newbie with perl. I have a text file and want to read it > line by line and split it into words: > my @fields = split / /, $_; > - so far no problem. > Now I have to count the words in the line. This I could not achieve. > I#m sure it is very simple - but I

Re: qr// -- huh?

2003-06-01 Thread R. Joseph Newton
Jeff Westman wrote: > Okay, this may sound pretty basic, but what is the qr// function used for? I > rarely see it used. I've consulted perldoc perlre, and it still makes no > sense. > > Could someone give a simple, practical example of this in use? > > Thanks! > > -Jeff The function generates

Re: problem opening file inside for-loop

2003-06-01 Thread R. Joseph Newton
"Johnson, Shaunn" wrote: > --thanks for the reply. > > --even still, if the file already exists, > --nothing is printed inside of the file. > --it's still empty and i'm not sure > --where it's breaking down. > > --i mean, i can see that it doesn't > --even print the first line (print statement), >

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread Richard Heintze
Thank you very much James and David! Wow! What prompt responses! I have some more questions! I tried "use strict;" and that worked. Are you encouraging me to use "use warn;" too? That does not work. > > # $i receives the proper values > > foreach my $i (keys %{$x}) { > > # (4) Why does not thi

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread John W. Krahn
Richard Heintze wrote: > > Some help understanding this program would be greatly > appreciated! I'm really struggling with this perl > language! perldoc perldata perldoc perlreftut perldoc perlref perldoc perldsc perldoc perllol > my $x= {'d' => 'y', 'f' => 'g'}, > $y = ['a', 'b', 'c', 'd']

Re: count of words (fields) after "split"

2003-06-01 Thread John W. Krahn
Richard müller wrote: > > Hi, Hello, > I'm a very newbie with perl. I have a text file and want to read it line > by line and split it into words: It depends on how you define "words". > my @fields = split / /, $_; > - so far no problem. Are you sure? Using "split / /, $_" does not do what

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread John W. Krahn
Richard Heintze wrote: > > I have some more questions! > > I tried "use strict;" and that worked. Are you > encouraging me to use "use warn;" too? That does not > work. use warnings; And/or: use diagnostics; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 01:47 PM, Richard Heintze wrote: I tried "use strict;" and that worked. Are you encouraging me to use "use warn;" too? That does not work. use warnings; It will alert you to potential problems in your code, while strict makes sure you obey the good programmer rules

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread Richard Heintze
Sorry James, you got a second copy. I meant to reply to the group. James, thank you, thank you! Can you explain this syntax then, that is used with foreach loops? foreach my $i (keys %{$x}) { ... } Why don't we use foreach my $i (keys $$x){... }? > > What is the name for this syntax: "(keys

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 02:45 PM, Richard Heintze wrote: Can you explain this syntax then, that is used with foreach loops? foreach my $i (keys %{$x}) { ... } Why don't we use foreach my $i (keys $$x){... }? What is the name for this syntax: "(keys %{$x})"? Oops, sorry, I meant to get to

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread Richard Heintze
James, I hope this is my last question. I appreciate your (and everyone else's that has contributed) generousity. I have a web site I inherited where a single page has 3000 lines of perl code. It does not use strict or warnings. The original authors only used global variables and never used any f

Re: (de)referencing and Net::Whois::IP

2003-06-01 Thread R. Joseph Newton
Robert Arnold wrote: > NOW, my question is this: If I can traverse the hash and look for a key > which is equal to "OrgName", why can't I simply print: $response{'OrgName'} ? > It just seems there should be a quicker, simpler way than having to > traverse the whole hash. Good question. Why not.

Re: (de)referencing and Net::Whois::IP

2003-06-01 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > Correction: > > Use the arrow operator. See syntax above. Or you could: > $$hashname{$key} Shaoud have been: $$hashref{$key} > > But I have come to see that as relatively ugly. If you get tused to the arrow > operator, it will start to speak to you. > > Joseph > >

Re: Wanted: Help with perl 5.6 syntax Arrays, Hashes and references

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 03:51 PM, Richard Heintze wrote: James, I hope this is my last question. I appreciate your (and everyone else's that has contributed) generousity. Not a problem. Hope I'm helping more than I'm confusing. Why does "@$y[$i]" work here, and "foreach $i (keys %$x)" wo

Wanted: Help with Function Arguments

2003-06-01 Thread Richard Heintze
Thanks James, I think I understand now! Here is another topic: What is happening to my second argument here? It is not being passed! use CGI qw(:standard); $q = new CGI; sub print_args { my ($a, $b, $c) = @_; print "a = $a b = $b c=$c\n"; } &print_args("abc", $q->param('next'), "xyz"); # Ho

Re: Wanted: Help with Function Arguments

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 05:01 PM, Richard Heintze wrote: Thanks James, I think I understand now! Glad to hear it. Here is another topic: My, my you are quite the problem child today, aren't you? ;) What is happening to my second argument here? It is not being passed! &print_args("abc", $

Re: Wanted: Help with Function Arguments

2003-06-01 Thread Richard Heintze
James, The problem occurs when $q->param('next') returns a null of sorts because there is no such parameter in the URL. Apparently, this does not get passed. When this is the case, all the subsequent function parameters are offset by one. Very strange... What a language... I'll try yo

Re: (de)referencing and Net::Whois::IP

2003-06-01 Thread Robert Arnold
Thanks to all that responded. Dereferencing the hash reference via: $response->{OrgName} ...does the job. I actually stumbled upon the answer in Perl Cookbook shortly after posting. The first couple pages of chapter 11 on references and records brought dawn to marblehead. Nonetheless I'm glad

Re: Wanted: Help with Function Arguments

2003-06-01 Thread James Edward Gray II
On Saturday, May 31, 2003, at 06:22 PM, Richard Heintze wrote: The problem occurs when $q->param('next') returns a null of sorts because there is no such parameter in the URL. Apparently, this does not get passed. This does sound like you're getting an empty list then. I'm not sure why that is.

Returning arrays from subroutines... how?

2003-06-01 Thread Ken Tozier
I'm sure this is an easy one but after Googling for hours, I still don't get it. Given the following subroutine, how do I return the result array? Nothing I try works. sub GetMarmots { @result = (); $result{'steppe marmot '} = 4; $result{'himalayan marmot'} = 3; $

Re: Returning arrays from subroutines... how?

2003-06-01 Thread jeff loetel
Ken, your mixing your @ with your % Try this: #!/usr/bin/perl &GetMarmots; sub GetMarmots { %result = (); $result{'steppe marmot'} = 4; $result{'himalayan marmot'} = 3; $result{'mongolian marmot'} = 1; $result{'woodchuck'} = 6; return %result; } foreach (keys %result) {

Re: Returning arrays from subroutines... how?

2003-06-01 Thread Beau E. Cox
- Original Message - From: "Ken Tozier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 5:24 PM Subject: Returning arrays from subroutines... how? > I'm sure this is an easy one but after Googling for hours, I still > don't get it. Given the following subroutin

RE: Wanted: Help with Function Arguments

2003-06-01 Thread Charles K. Clarkson
Richard Heintze <[EMAIL PROTECTED]> wrote: : What is happening to my second argument here? : It is not being passed! : : use CGI qw(:standard); : $q = new CGI; I know this is only a test, but "qw(:standard)" imports a whole lot of subs into your script that are not needed with the object- o

RE: Returning arrays from subroutines... how?

2003-06-01 Thread Charles K. Clarkson
jeff loetel <[EMAIL PROTECTED]> wrote: : Try this: : : #!/usr/bin/perl : : &GetMarmots; : : sub GetMarmots { : %result = (); : $result{'steppe marmot'} = 4; : $result{'himalayan marmot'} = 3; : $result{'mongolian marmot'} = 1; : $result{'woodchuck'} = 6; : return %result

Re: MySQL and perl using quotes

2003-06-01 Thread R. Joseph Newton
anthony wrote: > ... > $name = $dbh->("$name"); Anthony, please pay attention to the advice you have already been given. People do take valuable time to answer your posts, and I know that you have been reminded that there is no benefit to be derived from quoting variables as you have in the func

Re: check size of upload file

2003-06-01 Thread R. Joseph Newton
Dan Muey wrote: > > Hi, > > > java is not good, because you can easily modify the source and I don't like that. > Who said anythign about java? Good point, especially since his comment also relate to Javascript [plain text] but not Java [byte code]. Neither one, when accessed through the web, is

Re: Problem running the socket programming

2003-06-01 Thread R. Joseph Newton
anil adenan wrote: > I dont understand. Where or how do we create this link ( ln -s > /opt/perl/bin/perl /usr/bin/perl)? No. Read again: > The perl installation will create this link for you, BTW. > > > Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: cgi object not returning file content

2003-06-01 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > This is really strange. I have a method that works and returns all the > values in a file for the cgi object. But on the second call to the script it opens > the file and returns none of the cgi parameters. > > the $cgi->param( ) returns POSTDATA > and the keywords( )

Re: DBI and Unique Keys

2003-06-01 Thread R. Joseph Newton
Mark Martin wrote: > Hi, > I have an Oracle table with a Unique Key which is generated by a trigger : > > CREATE TRIGGER MYTRIGGER > before insert on MYTABLE > for each row > begin > select MYSEQUENCE.nextval into :new.MYCOLUMNAME from dual; > end; > And this works fine on normal insert > > When I

sendmail syntax error

2003-06-01 Thread Leaw, Chern Jian
HI, I have the attached script which reads the input text file of the form: # cat rpcinfo.txt program vers proto port service response 104 tcp 111 portmapperprogram 10 version 4 ready and waiting 103 tcp 111 portmapperprogram 10 ver

using a CONSTANT as a pathname

2003-06-01 Thread Kevin Pfeiffer
More problems trying to use constants... I have: use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; But I can't see how to make this work: open DATA, "> CFG" or die "Couldn't open ", CFG, " for writing: $!\n"; With quote marks it creates a new file in the pwd called "CFG". (Maybe it's time to g

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > More problems trying to use constants... > > I have: > > use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; > > > But I can't see how to make this work: > > open DATA, "> CFG" or die "Couldn't open ", CFG, " for writing: $!\n"; >

Re: using a CONSTANT as a pathname

2003-06-01 Thread Kevin Pfeiffer
Hi Tassilo, In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > >> More problems trying to use constants... >> >> I have: >> >> use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; >> >> >> But I can't see how to make this

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 01:13:31PM +0200 Kevin Pfeiffer wrote: > Hi Tassilo, Hi there, > In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > > if your Perl is recent enough (>= 5.6.0). Or you use the > > interpolate-anything trick: > > > > open DATA, ">@{[ CFG ]}" or die ...; > >

Re: using a CONSTANT as a pathname

2003-06-01 Thread Rob Dixon
Tassilo Von Parseval wrote: > On Sun, Jun 01, 2003 at 01:13:31PM +0200 Kevin Pfeiffer wrote: > > > > I almost asked about this earlier - if a script can also write to > > itself. I wrote something to test it, but haven't had time to > > look up the seek functions, etc. I suppose this only makes sen

Re: using a CONSTANT as a pathname

2003-06-01 Thread WC -Sx- Jones
On Sunday, June 1, 2003, at 05:22 AM, Kevin Pfeiffer wrote: use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; Well, you could convert it back to a variable prior to use: #!perl -w use strict; use diagnostics; use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; my $whichfile = CFG; open OFILE, ">$

Re: How to print HTML immediately, and more than once?

2003-06-01 Thread Martin Lomas
[multi-posted to beginners & beginners-cgi] Hi, Re: my query - >I'm writing a simple file-upload Perl script. I have all the form and file handling >stuff done. >I want the script to write an HTML message to the user's browser before the upload >begins, you know, like "Upload in progress". Then