Re: How to avoid accidental re-sending of POST data

2004-12-02 Thread Lawrence Statton
I'm no CGI expert, but my best guess is that you are not going to be able to stop the user from resending the data [snip out a technique to assist in ignoring repeat data] This deserves to be drilled into every beginning CGI programmers brain: You cannot PREVENT the client from doing

How to avoid accidental re-sending of POST data

2004-12-02 Thread Ingo Weiss
Hi, this must be a common problem and I was wondering what commonly used strategies to solve it are: How can I avoid that a user re-sends a POST form when hitting the reload button on a result page? The browser typically warns you when you want to do that but I was wondering whether there is an

RE: How to avoid accidental re-sending of POST data

2004-12-02 Thread Bob Showalter
Ingo Weiss wrote: Hi, this must be a common problem and I was wondering what commonly used strategies to solve it are: How can I avoid that a user re-sends a POST form when hitting the reload button on a result page? You can't. If the transaction is not repeatable, you need to have some

Re: Passing hashes as parameters to construct objects

2004-12-02 Thread Octavian Rasnita
Hi, You can create a new function as follows: package X; sub new { my $init = shift; my $class = ref($init) || $init; my $self = {}; #or if you want to pre-initialize some values, you can do: #my $self = {option1 = 'value1', option2 = 'value2}; return bless($self, $class); } Teddy -

Re: Sufficient effort

2004-12-02 Thread Gunnar Hjalmarsson
Casey West wrote: And I should point out that I agree. However, that doesn't excuse bad behavior in response. Furthermore, I expect more from a responder than a questioner. Okay, I've made up my mind. I don't have the required patience with the lazy dogs, so I don't fit here. Of course, you can

Getting the dir structure

2004-12-02 Thread Nilay Puri, Noida
Hi All, I have a file with thousands of line like : /abc/def/ijk/test.txt /pqr/lmn/test1.t I want to get the directory where the files test.txt and test1.txt are lying. I tried split but was not able to get desired solution. Can any one help. Thanks in advance. Thanks

Re: Getting the dir structure

2004-12-02 Thread Owen Cook
On Thu, 2 Dec 2004, Nilay Puri, Noida wrote: I have a file with thousands of line like : /abc/def/ijk/test.txt /pqr/lmn/test1.t I want to get the directory where the files test.txt and test1.txt are lying. Try something like this -

RE: Getting the dir structure

2004-12-02 Thread Mallik
u can look at the below code. use File::Basename; while(DATA){ my $line=$_; chomp; my $dir = dirname($line); print $dir\n; } -Original Message- From: Owen Cook [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 2:44 PM To: perl beginners

Re: Getting the dir structure

2004-12-02 Thread Mr M senthil kumar
SNIP I have a file with thousands of line like : /abc/def/ijk/test.txt /pqr/lmn/test1.t I want to get the directory where the files test.txt and test1.txt are lying. /SNIP Hi, You can try the following: #!/usr/bin/perl open (IN,input_file) || die Cannot open file: $!; open

Re: pdf 2 bmp

2004-12-02 Thread Lawrence Statton
--=_NextPart_000_0005_01C4D790.A1707220 Content-Type: text/plain; charset=iso-8859-7 Content-Transfer-Encoding: quoted-printable Has anyone know how to do that task? It think that is quite easy as far as pdf is a set of images. PDF is not a set of images ... PDF is actually a

Re: Checking if a scalar value is a number or not

2004-12-02 Thread Lawrence Statton
very true. noted. I always forget about the greedy factor Quick diction-alert; Greediness is something entirely different - your braino was mistaking * for + An example of greedy vs. non-greedy matching: #!/usr/bin/perl use strict; use warnings; my $phrase = 'Anna would like a banana';

Re: Making hash from two arrays

2004-12-02 Thread Lawrence Statton
Dear Sean, Hash Slice (only reminded of this the other day). Example code: use strict; use warnings; my @first = 'A' .. 'Z'; my @second = 'a' .. 'z'; my %hash; @[EMAIL PROTECTED] = @second; use Data::Dumper; print Dumper(\%hash); __END__ Not a particularly beginner way

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-02 Thread Lawrence Statton
Casey West wrote: It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the soap box, saying: Casey West wrote: The original question was places squarely within reasonable query boundaries. What do you refer to as the original question? To me it's this:

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-02 Thread Lawrence Statton
comprehensive example answer snipped We seem to agree on advising him to read a Perl beginners book. As regards the rest of your example answer, there may or may not be volunteer programmers available who are ready to provide such comprehensive answers to people who have obviously not

Re: Sufficient effort

2004-12-02 Thread Felix Li
What's wrong with demonstrating to your would be teacher that you are worthy of being taught? Either I'll do it for you to prevent you from learning anything or you make an effort. Having programmed for over thirty years, I side with Gunnar. Felix Li - Original Message - From: Gunnar

Connection using https

2004-12-02 Thread Tham, Philip
From my mozilla I opened a secured page at https://domain and got the following output No. TimeSourceDestination Protocol Info 1 0.00141.204.200.232 135.214.40.162TCP 39018 8080 [SYN] Seq=1259141925 Ack=0 Win=5840 Len=0 2

Re: ftp script

2004-12-02 Thread Lawrence Statton
--0-1181151836-1101950943=:60409 Content-Type: text/plain; charset=us-ascii I'm very new to perl, can any share an example ftp script? I need to ftp from one server directorynbsp;to another server to a directory first, read the following: perldoc Net::FTP #!/usr/bin/perl use

META: Unreliable delivery

2004-12-02 Thread Lawrence Statton
Has anyone else experienced terrible performance posting to beginners? Or have I been marked as a rabble-rouser? : I have sent several missives to the group, and despite the messages being delivered to develooper.com [sic], I don't see them for several hours later. -- -- -- -- -- -- -- -- --

Re: Passing hashes as parameters to construct objects

2004-12-02 Thread Lawrence Statton
G'day... I've noticed a lot of modules can be initialised in the form: my $instance = Module-new( option = value1, option2 = value2 ) How is this implemented? Is the above simply passing a hash reference? Is it something like: [snippage snipped] TIA! Regards, Not a

Schedule backup using cron

2004-12-02 Thread ds10025
Hi Is they a simple perl script to do Schedule from one server to another via NFS, or scp? Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Learn 2 languages

2004-12-02 Thread Murphy, Ged (Bolton)
A little OT, but I'm trying to learn 2 languages at once, C++ and perl. Is this typically a good or bad idea? So far it appears to be going OK and I'm well into using perl modules and creating C++ classes. My worry is as the topics get more complex and I start to learn the ins and outs, will the

Re: ftp script

2004-12-02 Thread John W. Krahn
Lawrence Statton wrote: # # open a connection to some host (I need passive mode here # to get around my firewall, you may not, which case you # can leave it out ) # my $ftp = Net::FTP-new('your-host.com', Passive = 1) || die Cannot connect to host: $@; warnConnection made; That statement

Re: Schedule backup using cron

2004-12-02 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: Hi Hello, Is they a simple perl script to do Schedule from one server to another via NFS, or scp? Could you clarifiy what you mean? Do you want to copy a crontab from one server to the other so they'll have the same cron schedule? -- To unsubscribe, e-mail: [EMAIL

Re: How to do Perl testing?

2004-12-02 Thread JupiterHost.Net
Smita Mote wrote: hello all, Hello, can anyone can tell me how to do perl testing actually in actual environment.? Via the command line, perl -c script.pl will do a syntax check. There's also a perl -d script.pl will run it in debug mode The answer really depends on what you mean by testing and

Re: Making hash from two arrays

2004-12-02 Thread John W. Krahn
Lawrence Statton wrote: I was *JUST* lecturing my student on hash-slices Monday ... Part of that lecture Passing named paramters, implemented as a hash, is a popular style. Look at all of Perl/Tk, for example. For systems where you might pass dozens of parameters to a method (or

Where is it wrong with my code

2004-12-02 Thread Li, Aiguo (NIH/NCI)
Hello, all. I am trying to assign a P for any values greater than 1.0 and assign a A otherwise. However, I need to skip the header line and the first column. Something is wrong with my code and it does not skip the first column well. Please help me to detect the bug. Thanks, Aiguo

RE: Where is it wrong with my code

2004-12-02 Thread Li, Aiguo (NIH/NCI)
Never mind. It is working now. Thanks, Aiguo -Original Message- From: Li, Aiguo (NIH/NCI) Sent: Thursday, December 02, 2004 10:11 AM To: Perl Beginners Subject: Where is it wrong with my code Hello, all. I am trying to assign a P for any values greater than 1.0 and assign a A

Re: How to do Perl testing?

2004-12-02 Thread Wiggins d Anconia
hello all, can anyone can tell me how to do perl testing actually in actual environment.? -smita perldoc Test::Tutorial http://www.perldoc.com/perl5.8.4/lib/Test/Tutorial.html http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: How to install GD for bugzilla

2004-12-02 Thread Siegfried Heintze
Jon (and others): Thanks for your help thus far! I'm running Apache 2.0.46 on Win2003 Server. Since I get the error messages below when I try to run the sample program (also below) on Apache HTTPD to demonstrate GD, I am now trying to manually install GD. I have just reinstalled ActiveState

How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
Someone kindly gave me an example of using DBI for MSAccess. It ran initially. However, I have now, as part of my attempt to install bugzilla, deinstalled perl 5.6 and perl 5.8 (which was incorrectly installed on top of perl 5.6) and reinstalled perl 5.8+, DBI and DBD-Mysql and MySQL several times

Re: Checking if a scalar value is a number or not

2004-12-02 Thread Jay
On Wed, 1 Dec 2004 08:28:55 -0500, Bob Showalter [EMAIL PROTECTED] wrote: John wrote: Hello Is there any special function for that job? See the FAQ article: perldoc -q 'is a number' That all depends on what you mean by a number...the FAQ interestingly ignores hex values.

the case of -pe and -ne swtich in Perl one liner

2004-12-02 Thread Edward WIJAYA
Hi, I just realized (don't laugh) that perl -pe 'do_sth;' is equivalent to perl -ne 'do_sth; print;' I am just thinking why would we need '-ne' in the first place, since we would need to print the result anyway (at least in one-liner). Can anybody suggest the case where we *only* need '-ne' ? --

Re: How to run DBI for MSAccess?

2004-12-02 Thread Jenda Krynicky
From: Siegfried Heintze [EMAIL PROTECTED] Someone kindly gave me an example of using DBI for MSAccess. It ran initially. However, I have now, as part of my attempt to install bugzilla, deinstalled perl 5.6 and perl 5.8 (which was incorrectly installed on top of perl 5.6) and

Working with Environment Variables

2004-12-02 Thread Dave Kettmann
Hi List, I am trying to get an environment variable into another variable (for ease of use) and I am having trouble. It seems to only be with 2 certain variables as I can do the following: #!/usr/bin/perl use strict; use warnings; my $path1 = $ENV{'PATH'}; print $path1 __END__ And it will

removing line from a file

2004-12-02 Thread Chandu B S
hi experts I want to delete a line in a file depending on the content of line, if my file is like this ccc d eee ee perl hh Here i want to remove the 4th line because it contains word perl !! ( of course i like

Re: Learn 2 languages

2004-12-02 Thread Edward WIJAYA
On Thu, 2 Dec 2004 12:46:12 -, Murphy, Ged (Bolton) [EMAIL PROTECTED] wrote: A little OT, but I'm trying to learn 2 languages at once, C++ and perl. Is this typically a good or bad idea? I personally thinks this is rather a good idea. Since a lot of syntax are common among them (maybe

Re: removing line from a file

2004-12-02 Thread Edward WIJAYA
On Thu, 2 Dec 2004 21:45:28 +0530, Chandu B S [EMAIL PROTECTED] wrote: hi experts I am no experts, but I guess: but i don't want to use 2 file , can i do this within the original file Yeah just use FD only open FD , /home/file1 or die Can't open file1 file : $!; while(FD) { print FD

Re: the case of -pe and -ne swtich in Perl one liner

2004-12-02 Thread Jonathan Paton
Edward, -pe is simply a shortcut for the common case, and you don't always want to print. Simple example: perl -ne 'print if /foo/' I tend not to write many one liners, except for a short time when I was writing one liners for perl golf. [About 2-3 years back, [EMAIL PROTECTED] mailing list

Re: Making hash from two arrays

2004-12-02 Thread Lawrence Statton
John Krahn wrote: The way I've seen that done sometimes is like this: sub frobitz { my %opt = ( name = 'blueberry', color = 'blue', texture = 'medium', price = 30, @_ ); # ... do something useful } The trailing keys

Re: removing line from a file

2004-12-02 Thread Jonathan Paton
Hi, Edward: Your script doesn't work, as you are only opening the file in read mode. Read/write doesn't do want you want either. If you want a quick'n'easy one liner, then use -i: -i[extension] edit files in place (makes backup if extension supplied) Your one liner would look like: perl

RE: How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
How should I respond to ppm below? Has it installed ODBC? Thanks, Siegfried C:\Perl\binppm3.bat PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub

Re: removing line from a file

2004-12-02 Thread Edward WIJAYA
Hi, Edward: Your script doesn't work, as you are only opening the file in read mode. Read/write doesn't do want you want either. {Blushes} Thanks for the correction Jon. If you want a quick'n'easy one liner, then use -i: -i[extension] edit files in place (makes backup if extension

RE: Working with Environment Variables

2004-12-02 Thread Moon, John
-Original Message- From: Dave Kettmann [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 11:14 AM To: Perl List (E-mail) Subject: Working with Environment Variables Hi List, I am trying to get an environment variable into another variable (for ease of use) and I am having

Re: removing line from a file

2004-12-02 Thread Jonathan Paton
PS: The Perl Cookbook (May 1999 edition) describes all three of the techniques properly in recipe 7.8, 7.9 and 7.10. I recommend the cookbook if you don't already have it. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Working with Environment Variables

2004-12-02 Thread JupiterHost.Net
Hello Dave, #!/usr/bin/perl use strict; use warnings; my $from1 = $ENV{'SIP_HF_FROM'}; print $from1; __END__ I get: Use of uninitialized value in print at test.pl line 8. When I type set at the command line, I do see the variable SIP_HF_FROM ... ... SHLVL=1 SIP_HF_FROM=sip:+16364424593

$ID = $newcook{'usrID'}-value;

2004-12-02 Thread A Taylor
Hello again, I have a problem with cookies; I can retreive cookies i have set, but if I try to retreive a cookie that hasnt yet been set i get the following error: Can't call method value on an undefined value at viewcart.pl line 55. I am trying to get my cookie using: $ID =

Re: $ID = $newcook{'usrID'}-value;

2004-12-02 Thread JupiterHost.Net
A Taylor wrote: Hello again, I have a problem with cookies; I can retreive cookies i have set, but if I try to retreive a cookie that hasnt yet been set i get the following error: Can't call method value on an undefined value at viewcart.pl line 55. I am trying to get my cookie using: $ID =

RE: How to run DBI for MSAccess?

2004-12-02 Thread Jenda Krynicky
From: Siegfried Heintze [EMAIL PROTECTED] How should I respond to ppm below? Has it installed ODBC? Thanks, Siegfried C:\Perl\binppm3.bat PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision

Re: $ID = $newcook{'usrID'}-value;

2004-12-02 Thread Jenda Krynicky
From: A Taylor [EMAIL PROTECTED] Hello again, I have a problem with cookies; I can retreive cookies i have set, but if I try to retreive a cookie that hasnt yet been set i get the following error: Can't call method value on an undefined value at viewcart.pl line 55. I am trying to get

RE: How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
J, I could have sworn I had a clean install last night. As per your advice, I installed V5.8 AGAIN (this is the third or fourth time) and now ppm does not give me that prompt when I install DBD-ODBC. Strange. It just installs and the sample program works. Now if I could only figure out how to

Re: How to install GD for bugzilla

2004-12-02 Thread Jonathan Paton
Dear Siegfried, Your test script isn't needed at this point, since we are doing module installation. I forgot to mention you need development tools (like nmake) before you can install GD. GD is written in C, therefore it needs to be compiled first. There is a precompiled version, grab from:

RE: Working with Environment Variables

2004-12-02 Thread Dave Kettmann
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 10:56 AM To: Perl List (E-mail) Subject: Re: Working with Environment Variables Hello Dave, #!/usr/bin/perl use strict; use warnings; my $from1 =

Building Network Redundancy into a Perl Client

2004-12-02 Thread Joshua Berry
I am trying to implement redundancy in a client application that I am writing so that I can have a primary server and a backup server. The client is tailing a logfile and sends results to a server for processing, at the end of the tail loop it sends data to a function that tries to establish a

Re: File Upload Using CGI

2004-12-02 Thread Manas Kulkarni
OK Guys I tried using the upload method of CGI. Here is what I did: my $upload = CGI::Upload-new; *Do I need to associate the upload variable with the CGI object in some way which I am creating in the cgi script to accept the other parameters from the html form ? script contd $file_name =

regex seg fault on long string

2004-12-02 Thread Jeremy Kister
I am dealing with a problem that I have compressed down to the following code: foreach my $number (0 .. 6129){ $msgs .= $number,; } unless($msgs =~ /^(\d+,?)+$/){ die syntax error; } What's happening is that when i try to apply my regex to my string -- with the comma seperator -- , I get

Re: the case of -pe and -ne swtich in Perl one liner

2004-12-02 Thread Jeff Eggen
Edward WIJAYA [EMAIL PROTECTED] 02/12/2004 10:02:05 am Can anybody suggest the case where we *only* need '-ne' ? I use the -ne quite a bit. Off the top of my head, here's a cheesy version of (unix) grep's -n option to print line numbers: perl -ne 'print $. $_ if m/some pattern/' my_file.txt

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Jeremy, Congratulations, you've found a bug in perl. Check the delta files (perldoc perl585delta etc) to see if there is a mention of something similar. If not, file the bug report using the perlbug tool. [EMAIL PROTECTED] jonathan]$ perl foreach my $number (0 .. 100) { $msgs .=

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
Is there a more compatible way to check my overly-long string? How about: die syntax error\n if $msgs =~ /[^\d,]/; Cheers, Dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Jeremy, Couldn't leave this one alone :) I now have a minimised test case: $msgs = '1' x 10; $msgs =~ /(1_?)*/; I believe the issue is related to an incorrect optimisation of the regex. Not much mentioned in the version delta files, so I wonder if 5.8.5 has the bug but didn't manifest

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
On Thu, 2 Dec 2004 17:19:00 -0500, Dave Gray [EMAIL PROTECTED] wrote: Is there a more compatible way to check my overly-long string? How about: die syntax error\n if $msgs =~ /[^\d,]/; Oh, I missed a requirement... after the above code: while ($msgs =~ /(\d+)/g) { die syntax error\n if

RE: Spam:Re: File Upload Using CGI

2004-12-02 Thread Michael Kraus
G'day... $file_name = $upload-file_name('sequences'); $file_type = $uplaod-file_type('sequences'); $file_handle = $upload-file_handle('sequences'); I haven't checked your script that thoroughly, or compared it to how I have done it - /but/ I have noticed that you've misspelt upload as

Re: regex seg fault on long string

2004-12-02 Thread Paul Johnson
On Thu, Dec 02, 2004 at 10:33:12PM +, Jonathan Paton wrote: Couldn't leave this one alone :) I now have a minimised test case: $msgs = '1' x 10; $msgs =~ /(1_?)*/; I believe the issue is related to an incorrect optimisation of the regex. Why do you think that? I suspect that

How to ppm GD? (was RE: How to install GD for bugzilla)

2004-12-02 Thread Siegfried Heintze
When you (assuming you have a windows machine) use ppm, does it find GD? I'm out of ideas has to how to make ppm work. It finds other modules, just not GD. I've tried specifying a http URL but that does not help! Thanks, Siegfried -Original Message- From: Jonathan Paton [mailto:[EMAIL

using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
Howdy folks, Here's something I was wondering (and wondering why its never come up sooner for me ;p) if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? package Foobar; sub baz { return 1 if shift; # do what here to set $! = You are not true;

Re: regex seg fault on long string

2004-12-02 Thread Jonathan Paton
Dear Paul, I believe the issue is related to an incorrect optimisation of the regex. Why do you think that? Changed my mind... :) The (even shorter) regex: /(1?)*/ Compiles as: 1: CURLYX[0] {0,32767}(12) 3: OPEN1(5) 5: CURLY {0,1}(9) 7: EXACT 1(0) 9:

Re: How to ppm GD? (was RE: How to install GD for bugzilla)

2004-12-02 Thread Jonathan Paton
Dear Siegfried, http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Repository Look at the bottom of the page: The GD module currently isn't available in the ActiveState PPM repository. This is because it is very difficult to build and is not suitable for ActiveState's automated build

Re: using $! for die()ing with Package function

2004-12-02 Thread Jonathan Paton
if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? Return undef or 0, just like you are doing. Both your calls to baz have an argument, so 1 is returned both times. I prefer undef for false. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL

RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Michael Kraus
G'day... Return undef or 0, just like you are doing. Both your calls to baz have an argument, so 1 is returned both times. I prefer undef for false. Ahh... But how do you set $! in the enclosing scope? Thanks... Regards, Michael S. E. Kraus Software Developer Wild Technology Pty Ltd

Re: Sufficient effort

2004-12-02 Thread Chris Devers
On Thu, 2 Dec 2004, Gunnar Hjalmarsson wrote: Okay, I've made up my mind. I don't have the required patience with the lazy dogs, so I don't fit here. Of course, you can always follow Jenda's advice and ignore them. And I will. I'll ignore this list from now on. Good luck! And beware of

Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
Jonathan Paton wrote: if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? Return undef or 0, just like you are doing. Both your calls to baz have an argument, so 1 is returned both times. I prefer undef for false. Thanks Jonathan for the input,

Re: Sufficient effort

2004-12-02 Thread Felix Li
On Thu, 2 Dec 2004, Gunnar Hjalmarsson wrote: Okay, I've made up my mind. I don't have the required patience with the lazy dogs, so I don't fit here. Of course, you can always follow Jenda's advice and ignore them. And I will. I'll ignore this list from now on. Good luck! And

Re: using $! for die()ing with Package function

2004-12-02 Thread Paul Johnson
On Thu, Dec 02, 2004 at 05:59:49PM -0600, JupiterHost.Net wrote: if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? You can't. Or at least not in the sense you want. $! is linked to the current value of errno, which will be set in the

Re: using $! for die()ing with Package function

2004-12-02 Thread Jonathan Paton
perldoc Carp; If that doesn't do what you want, then: perldoc -f eval else just set $@ and return undef. This is a bad solution I think. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
JupiterHost.Net wrote: Jonathan Paton wrote: if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? Return undef or 0, just like you are doing. Both your calls to baz have an argument, so 1 is returned both times. I prefer undef for false.

RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Ron Goral
-Original Message- From: Michael Kraus [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 6:43 PM To: [EMAIL PROTECTED]; JupiterHost.Net; [EMAIL PROTECTED] Subject: RE: Spam:Re: using $! for die()ing with Package function G'day... Return undef or 0, just like you are

Re: Sufficient effort

2004-12-02 Thread JupiterHost.Net
Is the list better off without him? NO, we are NOT! I don't think so, but here we are... -- Chris Devers Felix Li I'll third that guys! Gunnar, if you're still listening: Come back! The thing is, maybe it was a bit harsh and not always justified and we could all make imporvements *but*

Re: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
I don't think you can't set $! since it is a system var. Perhaps you could do something like: my $err_text; die $err_text if !Foo(); sub Foo_baz { return 1 if shift; $err_text = Your error message. return 0; } Thanks Ron, yeah if I want to I'll have to

Re: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
I think the misunderstanding is: $! is not a general purpose error message, it is a magical wrapper around errno() (read the section in perlvar) You *COULD* set $! to some numeric value selected from errno.h if there was one close enough to your message. But a user of your library getting

Recall: perl and https

2004-12-02 Thread Tham, Philip
Tham, Philip would like to recall the message, perl and https.

Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
Paul Johnson wrote: On Thu, Dec 02, 2004 at 05:59:49PM -0600, JupiterHost.Net wrote: if I make a module, say Foobar.pm how do you make it so if a function returns false you can die $!; ? You can't. Or at least not in the sense you want. $! is linked to the current value of errno, which will

Re: Recall: perl and https

2004-12-02 Thread JupiterHost.Net
Tham, Philip wrote: Tham, Philip would like to recall the message, perl and https. I'd love to help Tham, Philip recall it but I'm not sure what that means... remember it? find it in the archives? stop it from being posted? retract a statement in it? bring it off the market to aovid hurting

RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Ron Goral
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 7:06 PM To: [EMAIL PROTECTED] Subject: Re: Spam:Re: using $! for die()ing with Package function I don't think you can't set $! since it is a system var. Perhaps you could do

perl and https

2004-12-02 Thread Tham, Philip
From my mozilla I opened a secured page at https://domain and got the following output No. TimeSourceDestination Protocol Info 1 0.00141.204.200.232 135.214.40.162TCP 39018 8080 [SYN] Seq=1259141925 Ack=0 Win=5840 Len=0 2

Re: regex seg fault on long string

2004-12-02 Thread Paul Johnson
On Fri, Dec 03, 2004 at 12:16:57AM +, Jonathan Paton wrote: I suspect that you are just blowing the stack. Agreed now. Mind you, changing the program stack space is not likely to help. Are you sure? Did you try it? I did ;-) I don't think perl will use the

RE: using $! for die()ing with Package function

2004-12-02 Thread Ron Goral
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 7:15 PM To: [EMAIL PROTECTED] Subject: Re: using $! for die()ing with Package function Paul Johnson wrote: On Thu, Dec 02, 2004 at 05:59:49PM -0600, JupiterHost.Net wrote:

Re: Where is it wrong with my code

2004-12-02 Thread John W. Krahn
Li, Aiguo (NIH/NCI) wrote: Hello, all. Hello, I am trying to assign a P for any values greater than 1.0 and assign a A otherwise. $ perl -le' for ( -5.0, 0.0, 0., 1.0, 1.0001, 5.0 ) { print $_ , qw( A P )[ $_ 1 ] } ' -5 A 0 A 0. A 1 A 1.0001 P 5 P John -- use Perl; program

Re: Sufficient effort

2004-12-02 Thread sentinel
JupiterHost.Net wrote: Is the list better off without him? Definitely not however as I mentioned recently, simply ignoring those who aren't trying is the game plan. After a couple of weak attempts they usually leave. I rather liked Wiggins responses to those who don't try. Point them to

Re: Sufficient effort

2004-12-02 Thread Dan Jones
On Thu, 2004-12-02 at 09:38 +0100, Gunnar Hjalmarsson wrote: Casey West wrote: And I should point out that I agree. However, that doesn't excuse bad behavior in response. Furthermore, I expect more from a responder than a questioner. Okay, I've made up my mind. I don't have the required

Re: removing line from a file

2004-12-02 Thread John W. Krahn
Chandu B S wrote: hi experts Hello, I want to delete a line in a file depending on the content of line, if my file is like this ccc d eee ee perl hh Here i want to remove the 4th line because it contains word perl !! (

Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
I think as long as a failed open() or mkdir() (IE a system function that does $! sets it already) then that is all I need for this project: sub baz { mkdir '/dir/I/cant/make' or return; } will do what i need: baz or die $!; Actually mkdir returns true or false - sub baz{return mkdir

problem with strings

2004-12-02 Thread arjun.mallik
Hi Frnds, I have a problem with string passed as an argument to a perl script. I am giving the string \C:\\PROGRA~1\\INTERN~1\\IEXPLORE.EXE\ as an argument to the cmdtemplate option. and it been taken as C:PROGRA~1INTERN~1IEXPLORE.EXE after parsing it. what happend to the back slash.?? In

Why are Date::Time wierd and chart wierd?

2004-12-02 Thread Siegfried Heintze
Why does not ppm Date::Time work? I also tried perl -MCPAN -e 'install Date::Time' and that does not work either! I finally went to http://search.cpan.org/~gbarr/ and followed the directions in the readme. This seemed to work! Also, I had problems chart as per the checksetup.pl file in

Re: Sufficient effort

2004-12-02 Thread Tagore Smith
Trying out a new email client so I hope the attributions are right- if not, I apologize in advance. Been a while since I posted to the list... sentinel wrote: finitely not however as I mentioned recently, simply ignoring those who aren't trying is the game plan. After a couple of weak