Re: Metacharacter problem in regexp

2004-03-03 Thread WC -Sx- Jones
Petri Rautakoski wrote: $text =~ s|for example \(this\)|$toBeReplaced|; works fine, but how can I backslash the metacharacters in a scalar? Lookup "quotemeta" qr//; -Bill- __Sx__ http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e-mail: [E

Re: Metacharacter problem in regexp

2004-03-03 Thread Randy W. Sims
On 03/04/04 02:19, Petri Rautakoski wrote: Hi! I'm making a text replace and my text to search includes a metacharacter (. The text to be searched has been stored in a scalar for example $search. The text where the search will be made has been stored for example in a scalar $text. Here is what I

Metacharacter problem in regexp

2004-03-03 Thread Petri Rautakoski
Hi! I'm making a text replace and my text to search includes a metacharacter (. The text to be searched has been stored in a scalar for example $search. The text where the search will be made has been stored for example in a scalar $text. Here is what I'm doing: $search = "for example (this)";

RE: Returning value from system()

2004-03-03 Thread David le Blanc
> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] > Sent: Thursday, 4 March 2004 4:54 PM > To: [EMAIL PROTECTED] > Subject: Re: Returning value from system() > > [EMAIL PROTECTED] wrote: > > Hi all, > > I executed the same version of the perl script(code > is given below) > > which use the s

Re: Returning value from system()

2004-03-03 Thread WC -Sx- Jones
[EMAIL PROTECTED] wrote: Hi all, I executed the same version of the perl script(code is given below) which use the system() function both in linux and solaris and got exit values($?) as 65280 in solaris and -1 in linux.Any idea of why i am getting two different values in different OS. Thanks

Returning value from system()

2004-03-03 Thread [EMAIL PROTECTED]
Hi all, I executed the same version of the perl script(code is given below) which use the system() function both in linux and solaris and got exit values($?) as 65280 in solaris and -1 in linux.Any idea of why i am getting two different values in different OS. Thanks & regards, s.viswanathan

RE: Any way for Perl to write RTF within email as the body of an email without attachments

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
R. Joseph Newton wrote: > "Wagner, David --- Senior Programmer Analyst --- WGO" wrote: > >> >> I have b >> een trying what you suggest, but am not getting the rich text. Here >> is the spot of code: >> >> my $sender = new Mail::Sender {smtp => 'xxx.xxx.xxx.xxx.xxx', >>

Re: Automatically write in uppercase

2004-03-03 Thread R. Joseph Newton
Taylor James wrote: > > Incidentally MS Word does this. If you try to type a sentence, say: > > pLEASE DON'T TURN OFF MY CAPS LOCK KEY, i WANT IT LIKE THIS. > > with the caps lock key on, it automatically turns off the caps lock key and > converts it to: > > Please don't...etc. > > It's really ann

Re: Any way for Perl to write RTF within email as the body of an email without attachments

2004-03-03 Thread R. Joseph Newton
"Wagner, David --- Senior Programmer Analyst --- WGO" wrote: > > I have b > een trying what you suggest, but am not getting the rich text. Here is the spot of > code: > > my $sender = new Mail::Sender {smtp => 'xxx.xxx.xxx.xxx.xxx', >from => '[EMAIL PROTECTED]', >

Re: Why did it print a happy face?

2004-03-03 Thread R. Joseph Newton
Joel wrote: > Well, I got interested and changed this code to mess around with unicode > characters. The problem is it still doesnt print what it's supposed to, and > it makes the PC speaker on my computer beep. The simbols were a variety of > musical ones, a happy face, lightning bolt, etc. None

RE: iterating through hash of hash references

2004-03-03 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : It looks like not all of the fields have something in : them. Perl is taking blanks for undefined for some : reason. : : > :$tabledesc = {}; : > :$sth = $dbh->prepare("DESCRIBE $_"); : > :$sth->execute; : > :while($ref = $sth->fetchrow

RE: Forking

2004-03-03 Thread Bob Showalter
wolf blaum wrote: > On Wednesday 03 March 2004 21:57, Bob Showalter generously enriched > virtual reallity by making up this one: > > Hi, > > > > - "1 while wait() > 0" > > > > That just reaps the exit statuses to prevent zombies; the children > > have already exited (otherwise the loop wouldn't

Re: Forking

2004-03-03 Thread wolf blaum
On Wednesday 03 March 2004 21:57, Bob Showalter generously enriched virtual reallity by making up this one: Hi, > > - "1 while wait() > 0" > > That just reaps the exit statuses to prevent zombies; the children have > already exited (otherwise the loop wouldn't have exited.) You might want > the

Re: perl hex editor

2004-03-03 Thread John W. Krahn
Joel wrote: > > I'm trying to write a program in perl that will take a binary file, convert > it to hex, then save it to a text file. So far I'm not having any luck. The > best I've been able to do is copy the file and open it in a text editor. > Here is my code: > > #!/usr/bin/perl > > use warn

RE: iterating through hash of hash references

2004-03-03 Thread Guay Jean-Sébastien
Hello, > It looks like not all of the fields have something in them. Perl is taking blanks for > undefined for some reason. An empty field in a database is not a "blank", as you say, but a NULL. Meaning it's not just blank, but effectively inexistant - there is no value, not even the empty strin

Re: iterating through hash of hash references

2004-03-03 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : Now I've got another issue. : How can I dynamically assign new keys to a hash without : getting warnings when using 'use warnings'? I get the warning : about an undefined value on the line with the '->'. You can either te

RE: Forking

2004-03-03 Thread Bob Showalter
Price, Jason wrote: > Bob, > > Thanks for the input - it's quite helpful. However, I don't fully > understand some of the code - maybe you could help clear it up for > me. The parts I'm unclear on are: > Wolf's aready explained most everything. I'll throw in a bit more... > - the usage of "pi

Re: Forking

2004-03-03 Thread wolf blaum
On Wednesday 03 March 2004 20:47, Price, Jason generously enriched virtual reallity by making up this one: Hi > Thanks for the input - it's quite helpful. and nice:-) > However, I don't fully > understand some of the code - maybe you could help clear it up for me. The > parts I'm unclear o

RE: Any way for Perl to write RTF within email as the body of an email without attachments

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have b een trying what you suggest, but am not getting the rich text. Here is the spot of code: my $sender = new Mail::Sender {smtp => 'xxx.xxx.xxx.xxx.xxx', from => '[EMAIL PROTECTED]', to => $MyTo,

Re: Exit

2004-03-03 Thread Michael C. Davis
Thanks for all the insights, Rob. You've helped a *ton* of people. Good luck for the future. At 06:17 PM 3/3/04 -, Rob Dixon wrote: >I hope, and think, that I've helped several people to >be more eloquent in Perl. > >The language fascinates me in the way that nearly all >who can speak can us

RE: Forking

2004-03-03 Thread Price, Jason
Bob, Thanks for the input - it's quite helpful. However, I don't fully understand some of the code - maybe you could help clear it up for me. The parts I'm unclear on are: - the usage of "pipe READER, WRITER", and then the subsequent references to READER and WRITER. - the usage of $| - "1 while

RE: Forking

2004-03-03 Thread Bob Showalter
Price, Jason wrote: > Not sure if this is the right list for this - if it's not, please > direct me to the proper list. You've come to the right place. > > Anyway, I'm trying to get my hands around forking, and was hoping you > all could help me out. Basically, I'm trying to find a way to fire

Re: Exit

2004-03-03 Thread Kenton Brede
On Wed, Mar 03, 2004 at 06:17:36PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: > I hope, and think, that I've helped several people to > be more eloquent in Perl. > > The language fascinates me in the way that nearly all > who can speak can use it: thanks to Larry, who knew > before we did what a

perl hex editor

2004-03-03 Thread Joel
I'm trying to write a program in perl that will take a binary file, convert it to hex, then save it to a text file. So far I'm not having any luck. The best I've been able to do is copy the file and open it in a text editor. Here is my code: #!/usr/bin/perl use warnings; use strict; print "Enter

Re: Why did it print a happy face?

2004-03-03 Thread Joel
Keyboard symbols, greek letters, and weird things that look sort of like roads. I don't know about the driver or how I would find out. Joel - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 03, 2004 1:02 PM Subject: Re: Why did it

RE: Exit

2004-03-03 Thread Kipp, James
> I hope, and think, that I've helped several people to > be more eloquent in Perl. Absolutely ! > > I remain available through my email address, but I have > other, rather sad things to do. Thank you all for your > intelligent questions and elaborations. > I, for one, am a better perl progra

Exit

2004-03-03 Thread Rob Dixon
I hope, and think, that I've helped several people to be more eloquent in Perl. The language fascinates me in the way that nearly all who can speak can use it: thanks to Larry, who knew before we did what a programming language should have been. I remain available through my email address, but I

Forking

2004-03-03 Thread Price, Jason
Not sure if this is the right list for this - if it's not, please direct me to the proper list. Anyway, I'm trying to get my hands around forking, and was hoping you all could help me out. Basically, I'm trying to find a way to fire off a remote script on numerous boxes in parallel, returning the

Re: Why did it print a happy face?

2004-03-03 Thread Rob Dixon
Joel wrote: > > From: "Rob Dixon" <[EMAIL PROTECTED]> > > > Tell us what platform you're on. It sounds a lot like DEC (Compaq) to me. > > I'm running windows XP actually. I'm surprised! My XP does differently. Do you have an ANSI driver installed for the command prompt? Try something like this:

Re: PERL concatenating directory names

2004-03-03 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: By the way, > I'm having a problem when redirecting output from a system call to a text > file. A good example would be: > > command.com /c dir /O /a-d /s > dir.txt > > When I run this directly from the command line I will get the full path > structure in the output fi

Re: OO Programming

2004-03-03 Thread Morbus Iff
>WilliamGunther> IMHO, Object Oriented Perl is >the best book you can get on the subject. > >RandalLSchwartz> And for a tutorial approach ala Learning >Perl, check out Learning Perl Objects References and Modules. I'll second both of those suggestions. OOP does have an early chapter on references,

Re: OO Programming

2004-03-03 Thread Randal L. Schwartz
> "WilliamGunther" == WilliamGunther <[EMAIL PROTECTED]> writes: WilliamGunther> IMHO, Object Oriented Perl is the best book you can get on the subject. And for a tutorial approach ala Learning Perl, check out Learning Perl Objects References and Modules. -- Randal L. Schwartz - Stonehenge

Re: *_checks before /etc/aliases?

2004-03-03 Thread WC -Sx- Jones
WC -Sx- Jones wrote: Are recipient check done BEFORE Eep! Wrong list. Sorry; -Bill- __Sx__ http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to capture pid

2004-03-03 Thread Harry Putnam
zentara <[EMAIL PROTECTED]> writes: > On Tue, 02 Mar 2004 18:07:58 -0600, [EMAIL PROTECTED] (Harry Putnam) > wrote: >> >>For some reason the pid printed does not match the output of ps: >> >>actual sample script" >> >>Note the script outputs 15173 and ps shows 30335 >> >>Do you have an idea what i

Re: listing prime numbers in a range (Beginning Perl exercise)

2004-03-03 Thread James Edward Gray II
On Mar 2, 2004, at 9:10 PM, Stuart White wrote: Stuart, can we please see the whole script? Stuart, I reworked the for loops to do what I believe you intended and made a few other general cleanups. See if this gets you going: #!/usr/bin/perl # primeNumbers.pl use warnings; use strict; print "E

PERL concatenating directory names

2004-03-03 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm having a problem when redirecting output from a system call to a text file. A good example would be: command.com /c dir /O /a-d /s > dir.txt When I run this directly from the command line I will get the full path structure in the output file. When I call this from a perl script in the form:

RE: Automatically write in uppercase

2004-03-03 Thread Taylor James
James Edward Gray II wrote: > On Feb 29, 2004, at 6:30 AM, John wrote: > > > That's a nice method but i would prefer to activate the CAPS-LOCK > > and user write in capitals in my text entry widget > > I would prefer you didn't. ;) > > The keyboard takes commands from me, not the computer. If

*_checks before /etc/aliases?

2004-03-03 Thread WC -Sx- Jones
Are recipient check done BEFORE /etc/aliases is looked at? I want to siply discard/shred messages for certain unknown local users - no bounces no notifications - just shred/delete them. /^\@/ REJECT Invalid address format. /[EMAIL PROTECTED]@/REJECT This server disallows weird add

RE: links in POD

2004-03-03 Thread Bob Showalter
Freimuth,Robert wrote: > Hi all, > > I'm trying to use POD to document my application. I have about 5 > different doc files, and I'd like to create links between them when > they are translated from POD to HTML. For example, in doc file 1 I'd > like to say '...using the foo function, as describe

RE: iterating through hash of hash references

2004-03-03 Thread NYIMI Jose (BMB)
%$tabledesc->{$_} is confused ... Try writing it like : %{ $tabledesc->{$_} } HTH, José. -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 2:50 PM To: beginners Subject: iterating through hash of hash references I have a script which

Re: trouble with writing to file

2004-03-03 Thread Jan Eden
incognito wrote: >Thank you for your attention, Bob. > >>What is your actual regex? At a minimum, you'll need /g modifier. >>You may need /m and/or /s as well. > >May be I didn't explained my prob exactly. I don't have a problem >with the regex (and yes, I have the /m /g and /s). Related to the >

Re: Why did it print a happy face?

2004-03-03 Thread Joel
Well, I got interested and changed this code to mess around with unicode characters. The problem is it still doesnt print what it's supposed to, and it makes the PC speaker on my computer beep. The simbols were a variety of musical ones, a happy face, lightning bolt, etc. None of them were card sym

Re: remove '\' with new-line

2004-03-03 Thread Jeff Westman
david <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > > I need a one-liner to convert all occurances read from a Unix > pipe > > of > > > > 'backslash' + 'literal new line (hex 0a)' > > > > to become just > > > > 'literal new line (hex 0a)' > > > > That is, remove the '\' only when i

RE: iterating through hash of hash references

2004-03-03 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrote: : Now I've got another issue. : How can I dynamically assign new keys to a hash without : getting warnings when using 'use warnings'? I get the warning : about an undefined value on the line with the '->'. You can either temporarily turn those warni

Re: problems parsing web form information into a perl script

2004-03-03 Thread WC -Sx- Jones
Mark Martin wrote: Hi, I've got a web form that allows a user to browse to an excel file on their computer and input it and the year as parameters to run a perl script FORM : How do you know that the filename will be less than 16 characters? SCRIPT: use CGI; use Spreadsheet::ParseExcel; $

Re: Why did it print a happy face?

2004-03-03 Thread Joel
I'm running windows XP actually. Joel - Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 1:35 PM Subject: Re: Why did it print a happy face? > Joel wrote: > > > > Thanks for explaining the while loop, but what I was wonderin

Re: WWW::Mechanize and authentication

2004-03-03 Thread WC -Sx- Jones
David O'Dell wrote: I've been using WWW::Mechanize to test our websites which involves filling out the fields in the page and submitting them. The problem I'm having is that we have a new site that has a pop-up window for authentication. I'm sure there is a way to authenticate through this window

Re: iterating through hash of hash references

2004-03-03 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrtoe: :foreach (keys %$tabledesc) { : foreach (keys %$tabledesc->{$_}) { Shouldn't that be: foreach ( keys %{ $tabledesc->{$_} } ) { :print "$_ = $tabledesc->{$_}, "; : } : print "\n"; :} BTW, i

RE: iterating through hash of hash references

2004-03-03 Thread Charles K. Clarkson
Andrew Gaffney <[EMAIL PROTECTED]> wrtoe: :foreach (keys %$tabledesc) { : foreach (keys %$tabledesc->{$_}) { Shouldn't that be: foreach ( keys %{ $tabledesc->{$_} } ) { :print "$_ = $tabledesc->{$_}, "; : } : print "\n"; :} BTW, it's confusing to use ne

Re: interacting with table layouts using DBI

2004-03-03 Thread Andrew Gaffney
Ed Pigg wrote: On Mar 2, 2004, at 5:53 PM, Andrew Gaffney wrote: Is there an easy way with DBI (or anything other modules) to retrieve and modify the layout of database tables in a MySQL DB? You might want to look at Class::DBI on CPAN. That is the general idea. I was thinking about something t

Re: interacting with table layouts using DBI

2004-03-03 Thread Ed Pigg
On Mar 2, 2004, at 5:53 PM, Andrew Gaffney wrote: Is there an easy way with DBI (or anything other modules) to retrieve and modify the layout of database tables in a MySQL DB? You might want to look at Class::DBI on CPAN. Ed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

iterating through hash of hash references

2004-03-03 Thread Andrew Gaffney
I have a script which creates a hash where all the values are hash references. I'm trying to iterate through the original hash and down into the anonymous hashes to make sure my code is doing what I think it's doing. My problem comes in at those nested foreach loops before the DB disconnect. I g

problems parsing web form information into a perl script

2004-03-03 Thread Mark Martin
Hi, I've got a web form that allows a user to browse to an excel file on their computer and input it and the year as parameters to run a perl script FORM : SCRIPT: use CGI; use Spreadsheet::ParseExcel; $q=new CGI; my $oExcel = new Spreadsheet::ParseExcel; my $user_ssheet=$q->param('file');

Re: Regex to find group of image files

2004-03-03 Thread Maruf Çetin
> > I thought I could solve the regex issue a different way, but failed. > > My $path = "Mazda.1.jpg "; > > ($file, $dir, $ext) = fileparse ($path, '\..*' ); > > #I'm trying to get Mazda.2.jpg and Mazda.3.jpg. > # $file contains Mazda, so why does this regex fail to deliver > Mazda.2.jpg > # a

Re: Passing array as First argument

2004-03-03 Thread WilliamGunther
In a message dated 3/3/2004 5:15:57 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >testsub(@abc, $x, $y); > >sub testsub(@$$) >{ >(@abc, $x, $y) = @_; >print "Array @abc\n"; >print "x $x\n"; >print "y $y\n"; >} sub testsub ([EMAIL PROTECTED]); @abc = (1, 2, 3); $x = 3; $y =

RE: Reformatting the Date

2004-03-03 Thread David le Blanc
> From: John [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 3 March 2004 8:55 PM > To: Perl Beginners > Subject: Reformatting the Date Hi John! > > I receive the date from the Oracle as DD/MM/YY and i want to > insert that date in a mysql date field. If you get a date in var '$odate', you need

Re: links in POD

2004-03-03 Thread Randy W. Sims
On 03/02/04 21:54, Freimuth,Robert wrote: Hi all, I'm trying to use POD to document my application. I have about 5 different doc files, and I'd like to create links between them when they are translated from POD to HTML. For example, in doc file 1 I'd like to say '...using the foo function, as d

Re: Appending an small array into a larger array in a foreach loop.

2004-03-03 Thread Randy W. Sims
On 03/02/04 16:40, Jim Canfield wrote: Greetings, I'm having trouble creating an 2 dimensional array that contains the values of other smaller arrays. For example: foreach (@files) { #...Get values @smallarray = ('$value1',$value2','$value3'); #Append @smallarray to @largearray pu

RE: Passing array as First argument

2004-03-03 Thread David le Blanc
> From: Mallik [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 3 March 2004 1:00 AM > To: Perl Beginners > Subject: Passing array as First argument > Importance: High > > Dear Friends, > > I need to pass 3 parameters to a subroutine, in which the > first parameter is an array and the last two param

RE: Appending an small array into a larger array in a foreach lo op.

2004-03-03 Thread Marcos . Rebelo
foreach (@files) { @smallarray = ('$value1',$value2','$value3'); push(@largearray, [EMAIL PROTECTED]); } or foreach (@files) { push(@largearray, ['$value1',$value2','$value3']); } -Original Message- From: Jim Canfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, Marc

RE: Passing array as First argument

2004-03-03 Thread Halkyard, Jim
Hi Malik, If you pass a reference to the array as the first argument as below you can keep the array separate from the other arguments you are passing. @abc = qw(1 2 3); $x = 4; $y = 5; testsub([EMAIL PROTECTED], $x, $y); sub testsub($$$) { ($abc, $x, $y) = @_; print "Array @$abc\n";

links in POD

2004-03-03 Thread Freimuth,Robert
Hi all, I'm trying to use POD to document my application. I have about 5 different doc files, and I'd like to create links between them when they are translated from POD to HTML. For example, in doc file 1 I'd like to say '...using the foo function, as described in ...', and have the link open d

Passing array as First argument

2004-03-03 Thread Mallik
Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); sub testsub(@$$) { (@abc, $x, $y) = @_; print "Array @abc\n"; print "x $x\n"; pri

Appending an small array into a larger array in a foreach loop.

2004-03-03 Thread Jim Canfield
Greetings, I'm having trouble creating an 2 dimensional array that contains the values of other smaller arrays. For example: foreach (@files) { #...Get values @smallarray = ('$value1',$value2','$value3'); #Append @smallarray to @largearray ??? Help ME!! ?? } The e

Passing array as First argument

2004-03-03 Thread Mallik
Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); sub testsub(@$$) { (@abc, $x, $y) = @_; print "Array @abc\n"; print "x $x\n"; pr

WWW::Mechanize and authentication

2004-03-03 Thread David O'Dell
I've been using WWW::Mechanize to test our websites which involves filling out the fields in the page and submitting them. The problem I'm having is that we have a new site that has a pop-up window for authentication. I'm sure there is a way to authenticate through this window but I can't find a

Reformatting the Date

2004-03-03 Thread John
I receive the date from the Oracle as DD/MM/YY and i want to insert that date in a mysql date field. I know that mysql date form is -MM-DD. Well, do you know if there is any date function to do the job? Thanks in advance.

Re: Reading File & grep according item 5 and sorting

2004-03-03 Thread R. Joseph Newton
Bjorn Van Blanckenberg wrote: > > #!/usr/bin/perl > > use strict; > use Getopt::Long; > > GetOptions(\my %opt, 'filepath=s'); > > my $filepath = (%opt->{'filepath'}); > > my @fields = (); > my @sorted = (); > my $lastbit = 1; > my @bits = (); > > open(INFILE,$filepath); > > chomp(@fields = ); > >

Re: listing prime numbers in a range (Beginning Perl exercise)

2004-03-03 Thread R. Joseph Newton
Stuart White wrote: > > >(2) Joseph > stuart>I thought this one was a joke. Twas. The again it wasn't. Like Uncle Walt I like to cntradict myself. I actually did mean what I said, both about my impression that you were letting yourself get caught up in codishness, and that the primary purpose