Re: Perl Parsing

2007-02-21 Thread JupiterHost.Net
Sumit Shah wrote: Hello All, Heloo, I have a string like: 'a = 1; b = 2; c = 3; d = 4' Whats the best way to parse it so that I can get a value for c, which is 3? I have used the hash approach. But, I was wondering if there is a faster way to do it in Perl. Why do you say hashes are sl

Re: sendmail

2007-02-21 Thread JupiterHost.Net
Jeff Pang wrote: I need to send mail to all users defined in one array. I tried foreach loop but what is happening is it is sending mail to only first user in the array. not sending mails to rest of the users. Is there any way to send a mail to all users in array in one shot. I am using send

Re: Sending mail

2007-02-04 Thread JupiterHost.Net
Bill Jones wrote: On 1/24/07, M. Lewis <[EMAIL PROTECTED]> wrote: I've used MIME::Lite for the mail tasks I've had up till now and it has worked very well. Now I need to send mail via a different port than port 25, say port 587. As far as I can tell, MIME::Lite does not have this capability.

Re: Mail Attachment

2007-01-16 Thread JupiterHost.Net
Lawrence Statton XE2/N1GAK wrote: First -- your porgram is nowhere NEAR complete ... I see nowhere that $to_address, $from_address, etc are populated. Read the posting guidelines and try again. That being said, there are some glaring deficiencies that can be pointed out even without the compl

Re: return 1

2006-12-08 Thread JupiterHost.Net
Derek B. Smith wrote: Why is return 1 coded at the end of many programs. For example: I know it means true but what does this do and why? thank you derek #!/usr/bin/perl #use strict; my $user_name = qq(dsmithxx); my $user_password = qq(); my $sql_server = qq(x); my ($dbh,$drh,$stmt);

Re: goto return ?

2006-12-05 Thread JupiterHost.Net
Thaks Jay, I'll soak it all up tomorrow first thing, I'm sleepy :) Good night all! Jay Savage wrote: On 12/3/06, Bill Jones <[EMAIL PROTECTED]> wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > The trick is I can't seem to goto() return in >

Re: goto return ?

2006-12-04 Thread JupiterHost.Net
Bill Jones wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... I guess I'm totally confused; I don't see how a goto can return back to the

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
Rob Coops wrote: Hang on I guess I understand what it is you are trying to do... You want: goto &CORE::return; to work like it reads. Now my question to you is how does this read to you because what I am reading in the perlsub about this stuff is the following. It reads this way: It "rea

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
So any ideas about how to get: goto &CORE::return; to work like it reads. The suggestions you were given do exactly what you ask for. Obviously, read 'goto &CORE::return()' differently from the rest of the list. So instead of complaining, why don't you explain how you read it, instead of sim

Re: goto return ?

2006-11-28 Thread JupiterHost.Net
Thanks to everyone for their feedback, I understand how to do basic logic and control flow, what I'm really looking for is how to get goto &CORE::return; to work like it reads. log_error_and_return($error, @return) if $whatever; Close you want return log_and_go_home($error, @return) i

Re: goto return ?

2006-11-27 Thread JupiterHost.Net
Just need to figure you how to get the functionality that: goto &CORE::return; feels like it should do assuming I knew how to reference return... nah Thanks for your examples, however if a change was needed you'd still have to change every instance instead of the single function. So I'd

Re: goto return ?

2006-11-27 Thread JupiterHost.Net
What about doing this? return if do_one_then_two($whatever); ... sub do_one_then_two { my $what = $_[0]; if ($what) { one(); two(); return 1; } return 0; } Thanks, I'm not looking for how to handle a condition necessarily. I want to be able to: log_e

Re: goto return ?

2006-11-24 Thread JupiterHost.Net
Tom Phoenix wrote: On 11/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: The trick is I can't seem to goto() return in do_some_stuff_and_return(), I'm sure since its so deep down... Are you saying that you want a subroutine that can make the subroutine that called *it*

goto return ?

2006-11-24 Thread JupiterHost.Net
Howdy list, I'm trying to figure this one out and am at the brick wall with trying /docs in a function I'd like to replace this kind of code: if($whatever) { ## do some stuff return @stuff; } # we got this far so keep on moving with do_some_stuff_and_return( @stuff ) if $whateve

HTTP::Daemon 401 login prompt

2006-11-09 Thread JupiterHost.Net
Howdy, I'm trying to get an HTTP::Daemon to make the browser prompt with a basic authentication login box. With the example at: http://search.cpan.org/perldoc?HTTP::Daemon I just change $c->send_error(RC_FORBIDDEN) to $c->send_error(RC_UNAUTHORIZED) and I get a nice 401 Unauthorized HTML

Re: Round to mult. of 5?

2006-11-08 Thread JupiterHost.Net
C.R. wrote: Does anyone have a routine that will round an integer to a multiple of 5? Didn't find anything on CPAN? Odd... A search for "Round" -> http://search.cpan.org/search?query=Round&mode=all Yeilded Math::Round, nearest() looks promising. For example: if number ends in 0 or 5, no rou

Re: Perl Inheritance(take-2)

2006-11-06 Thread JupiterHost.Net
Muttley Meen wrote: Hi! Hello, $a = Package1::new(); $a->Package2->Create(); # this should call IncErr too print "ERR1: $a->{err}\n"; # should print 1 doent't work as I expected. Is there something wrong with the way I `bless`-ed the class Package2 ? use strict, warnings, and most import

Re: transition to Perl developer

2006-09-20 Thread JupiterHost.Net
I'm not sure what Derek is looking for, either, but have a look at: * bestpractical.com/rt/ An open-source request/bug/job tracker, which is also used as part of the CPAN projcet: rt.cpan.org * www.cpanforum.com Open-source Perl project, linked from every page of CPAN, which has a good TOD

Re: transition to Perl developer

2006-09-19 Thread JupiterHost.Net
Derek B. Smith wrote: OK CPAN yes I know it is an open source project, but are there task assignments for specific tasks/projects as opposed to submitting a module? So you are looking for an open source project done in Perl that has a community todo list that you can contribute to or an ope

Re: transition to Perl developer

2006-09-19 Thread JupiterHost.Net
> Derek B. Smith wrote: Is there a Perl open source project currently underway wherein anyone can contribute by writing code for the projects completion such as Jbilling? Jbilling is an Derek, reread that. That question makes no sense, do you mean CPAN? Do you mean something that does what J

Re: temporarily change a function, sort of like doing a local $var;

2006-09-12 Thread JupiterHost.Net
What the statement does local *What::ever = \&my_sub; # with a named sub or local *What::ever = sub { }; # with a closure is to locally redefine the *What::ever{CODE} slot of the glob. Adriano, *you* are awesome! I've been fiddling with this sort of thing dancing around the right w

temporarily change a function, sort of like doing a local $var;

2006-09-12 Thread JupiterHost.Net
Howdy, I'm trying to change the behavior of a function (whose use of and call I have no control over) to avoid some nasty behavior in certain circumstances. Its easy enough to redefine it but after the hairy part is done I want to change it back. Similar to how you can: { local $var;

Re: Create HTML code with perl

2006-09-07 Thread JupiterHost.Net
Brian McKee wrote: On Monday 04 September 2006 00:34, Webmaster Adil wrote: Hi All I need print HTML codes with perl: If you want to HTMLify plain text, try Text::InHTML it even does syntax highlighting (if available) if the plain text is HTML, Perl, XML, and about 95 +/- other ones.

Re: smtp authentication

2006-08-26 Thread JupiterHost.Net
Alan Sanders wrote: Tom - Yes I use real values. Dr. Ruud - You're right... the extra line is useless and I have cleaned it up accordingly. Anyways I figured the script out. Here's the final output cleaned up a little bit. Thanks for your help. #!/usr/bin/perl -w use strict; use Net::SM

SVN::Ra::Reporter Useage

2006-08-22 Thread JupiterHost.Net
Howdy, Being a C/XS newbie (but perl oldie) I want to use some of the SVN::Ra goodies but can't seem to get over a certain hump, any input is appreciated! Assuming $sra is an SVN::Ra object and I have valid numeric $start_rev and $end_rev a) what do I pass to $sra->do_diff() (not sure what

Re: @EXPORT_OK and AUTOLOAD

2006-08-22 Thread JupiterHost.Net
JupiterHost.Net wrote: Say a module has 3 functions foo, bar, and baz and is able to autoload do_\w+. In @EXPORT_OK can you put soem commonly used AUTOLOADed methods and have them exported? our @EXPORT_OK = qw(foo bar baz do_this do_that); or is this not possible? I tried it this

@EXPORT_OK and AUTOLOAD

2006-08-21 Thread JupiterHost.Net
Say a module has 3 functions foo, bar, and baz and is able to autoload do_\w+. In @EXPORT_OK can you put soem commonly used AUTOLOADed methods and have them exported? our @EXPORT_OK = qw(foo bar baz do_this do_that); or is this not possible? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: filecopy

2006-08-21 Thread JupiterHost.Net
Smith, Derek wrote: Why doesn't a copy work on each array element yet a glob does? I'm assuming you eman copy() from File::Copy? because copy()'s source doesn't do that I imagine. Is there documentation for copy() that seems to indicate it does? Is there a way to tell Perl to copy each e

Re: math module and array manipulation

2006-08-15 Thread JupiterHost.Net
I have an array contains 12 numbers. I want to calculate the mean and standard deviation for very three numbers. I just wonder which math module is available to do the job. Wonder no longer :) Find out for sure: http://search.cpane.org/ I think you meant http://search.cpan.org. :) Inde

Re: math module and array manipulation

2006-08-14 Thread JupiterHost.Net
chen li wrote: Dear all, I have an array contains 12 numbers. I want to calculate the mean and standard deviation for very three numbers. I just wonder which math module is available to do the job. Wonder no longer :) Find out for sure: http://search.cpane.org/ -- To unsubscribe, e-mail:

Re: Is this behavior not right?

2006-08-01 Thread JupiterHost.Net
Joshua Colson wrote: On Tue, 2006-08-01 at 11:38 -0500, JupiterHost.Net wrote: perl -mstrict -wle '$gl="why am I not throwing errors?";print $gl;' That should be a capitalized 'M': perl -Mstrict -wle '$gl="why am I not throwing errors?";pr

Re: BASEDIR and BASENAME on Windows

2006-08-01 Thread JupiterHost.Net
BenBart wrote: Hi all, Can anyone please tell me how to get the BASENAME and BASEDIR of a file ... i.e. for example, if I have C:\Windows\Temp\Dir1\MyFile.TXT, I want to be able to get the BASENAME which is MyFile and the BASEDIR which is C:\Windows\Temp\Dir1 and assign them to variables .

Is this behavior not right?

2006-08-01 Thread JupiterHost.Net
I was surprised that strict and warnings didn;t hollor when I used a variable without my... $ perl -mstrict -wle '$gl="why am I not throwing errors?";print $gl;' why am I not throwing errors? $ What magic voodoo is going on here? I though you had to my $var w/ strict? -- To unsubscribe, e-mai

Re: need to return exit code

2006-07-31 Thread JupiterHost.Net
Gregory Machin wrote: Hi Hello, My perl script is called by a bash script, used in a compile / build env. But the bash script is not seeing my script's exit and is timming out and continuing ... How can I pass a standard exit code 0 = success 1 = fail to the operating system / calling scri

Re: Other ways to assign a filehandle to a variable?

2006-07-27 Thread JupiterHost.Net
Use lexical ones in the first place. open my $fh, '<', $filename or die "open $filename, stopped" ; And if you're gogint to die you might as well say why :) ... or die "open $filename failed: $!" ; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: its DONE !! CGI Script to pass a file to different servers - code is here

2006-07-26 Thread JupiterHost.Net
I BioKid wrote: I made it !!! Thanks to my buddy Arshad - Buddy you're a true-perl-buddy !!! Here comes an easy way, not exactly the way I want it - but I can do it this way too, After all :*There's more than one day to do it in perl*:We used WWW::Mechanize module: A scrap version of the cod

Re: PATH env variable and open()

2006-07-26 Thread JupiterHost.Net
Travis Thornhill wrote: Does anyone have any idea why setting $ENV{"PATH"} = "" would cause Are you running setuid or in taint mode by chance? the open() function to fail? The file I'm trying to open exists, and some debug open(...) or die "open failed becaause: $!"; printing shows

Re: iterate over newlines

2006-07-06 Thread JupiterHost.Net
Ryan Moszynski wrote: i really hope thats overkill for my problem. I have my program finshed, this is the last condition i have to deal with. Also, my supervisor would prefer me not to use any nonstandard modules. Why not, if it on CPAN its "standard". If its not bundled with the perl you

Re: perl + ncurses turtorial ?

2006-07-06 Thread JupiterHost.Net
Gregory Machin wrote: Hi Hello, I'm looking for an perl ncuses tutorial so I can write a remote admin app to work via ssh .. Not really a tutorial but Curses::UI is what you will want to use HTH -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Perl Binary to Perl Code

2006-06-30 Thread JupiterHost.Net
I BioKid wrote: Dear All, I have a dozen perl and perl-cgi program that converted in to binary files. Is there any code / prggram available to get the source code out of it ? The answer is still the same as last week when you asked this :) It depends how the binary was made and if that syst

Re: Perl Binary to Perl Code

2006-06-30 Thread JupiterHost.Net
I BioKid wrote: Dear All, I have a dozen perl and perl-cgi program that converted in to binary files. Is there any code / prggram available to get the source code out of it ? Why do you keep posting this email, is your client in a loop or something? -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: perlcc executable to perl code ?

2006-06-30 Thread JupiterHost.Net
I BioKid wrote: Dear All, One quick question: Is ther any way to get the source code out of a perlcc executable ? same as any other compiled C code. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Script Required to Check a range of IP's

2006-06-29 Thread JupiterHost.Net
#!/usr/bin/perl use strict; use warnings; Excellent! use Net::Ping; my $file_name=$ARGV[0]; What if its not given anything? my $line; You don't use this? my @host_array; open(FILE,"$file_name") || die "Not been Accessed" ; Why is $file_name in quotes? Why is the die string in dou

Re: Possible to get field names and types in a table without executing a query?

2006-06-27 Thread JupiterHost.Net
It doesn't matter what fetchall_hashref() returns. You get the list of columns from $sth->{NAME}. Cool. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CPAN::Shell install into customer dir

2006-06-26 Thread JupiterHost.Net
Anthony Ettinger wrote: Isn't it PERL_PREFIX? Perhaps, I'll give it a go once I figure out why its still using the global config and not the user's :) Thanks for the input Anthony! On 6/24/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: Howdy all :) I'

Re: CGI Script to pass a file to different servers

2006-06-26 Thread JupiterHost.Net
I BioKid wrote: Hi all, Her am not able to do socket programming :( Any other solutions ? Net::FTP RSYNC, SCP, etc etc, Not really sure what you're trying to do... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

CPAN::Shell install into customer dir

2006-06-24 Thread JupiterHost.Net
Howdy all :) I've a plugin installer that installs certain Perl modules: This is what it uses, CPAN::Shell->expand('Module', $module_name)->install(); which works fine as long as root is running it. What I'd like to do is install the modules as an unprivileged user into /home/$user/perl I

Re: converting between time and string

2006-06-22 Thread JupiterHost.Net
Hello, $refTime = "01:22:33,456"; #as in your example $refTime =~ /(\d+):(\d+):(\d+),(\d+)/; #capture the elements and assign $hours = $1; $minutes = $2; $secs = $3; $mili = $4; or much simpler: my($hours, $minutes, $secs, $mili) = $ref_time =~ m{(\d+)}g; Note that if it doesn't match then t

Re: encode(?) string for using it in subject line

2006-06-15 Thread JupiterHost.Net
Varga Pavol wrote: Hi, Hello, please how to encode (or something else) string to use it for subject for mails? Use Mail::Sender::Easy and set the encoding as you would a normal Mail::Sender object. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Locale::Maketext fail_with() method

2006-06-14 Thread JupiterHost.Net
Howdy all :) I'm trying to workup a nice Locale::Maketext fail_with() method, and having a bit of trouble with the last comment in the code below: $lh->fail_with(sub { my ($lh, $key, @args) = @_; # do db lookup and return that if it was not in the db (IE !undef) my $db_version = _

Re: Help Required on the Below Script

2006-06-14 Thread JupiterHost.Net
Hello, use strict; use warnings; Excellent use of those :) my $file_name=".txt"; open(FILE,"$file_name") || die "Not been Accessed"; Good that you checked for failure, why not also report the error ... Also, don't double quote strings that have nothing to be interpolated or are

Re: Yet another OO question

2006-06-10 Thread JupiterHost.Net
Paul Johnson wrote: Astute readers may recognise the rules I am attempting to use. Damian Conway's Perl best Practices, *everyone* should own this book :) Mr. Johnson just got a few more points in my book ;p -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: What are the problems with my CGI script

2006-06-06 Thread JupiterHost.Net
Anthony Ettinger wrote: my $name = param('name') || ''; if(defined $name) { # if its valid , HTMLescape it and print it # otherwise tell them they did bad :) } else { # ask them for theri name } definitely the better way to handle it, although you don't need the || unles

Re: What are the problems with my CGI script

2006-06-06 Thread JupiterHost.Net
Hello, Use of uninitialized value in concatenation (.) or string at cgi_7.pl line 31. This is your name Use of uninitialized value in concatenation (.) or string at cgi_7.pl line 35. Line 31 and 35 are using data that in uninitialized. For instance calling param() on a parameter that has not

Re: Sendmail mail from script

2006-06-05 Thread JupiterHost.Net
Мандип Сингх Бхабха wrote: How to use this module if there is russian language in subject field ? Body of message, can be send using html. use the # _text_info # _html_info keys for the message, use the Mail::Sender object's encoding methods for the subject, etc -- To unsubscribe, e-mail:

Re: Sendmail mail from script

2006-06-02 Thread JupiterHost.Net
Мандип Сингх Бхабха wrote: There are multiple ways to send mail from perl script. I think this code will help. Your life will be much much much simpler if you use Mail::Sender::Easy http://search.cpan.org/perldoc?Mail::Sender::Easy You can do or die it and do very complec things, and very

Re: faster search engine for fulltext search

2006-06-01 Thread JupiterHost.Net
If these queries work so slow, I am wondering how slow it will work when the database will have a million records. See fulltext docs at mysql.com, my point still was paginate and use LIMIT (or DB's equivalent) so your perl only has to process an array of a few records instaead of all. IE fo

Re: faster search engine for fulltext search

2006-06-01 Thread JupiterHost.Net
Perhaps doing your queries to return only some instead of all records will help, a great module for doing this is: http://search.cpan.org/perldoc?Data::Paginate I am using a limit clause and the sql query returns at most 20 records, but when very many records are found, the search is very slo

Re: faster search engine for fulltext search

2006-05-31 Thread JupiterHost.Net
Next, your op says "When very many records are found..." What is the purpose of your client program loading large recordsets? You should probably be paging the data somehow. Perhaps doing your queries to return only some instead of all records will help, a great module for doing this is: h

Re: Russian character support

2006-05-31 Thread JupiterHost.Net
SkyBlueshoes wrote: How can I get Russian/other language character support for my script? Is there a certain module? use the proper charset, utf8, etc and print them out :) What have you found with perldoc and search.cpan.org ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: monitoring file like tail -f in perl

2006-05-29 Thread JupiterHost.Net
Ken Foskey wrote: I want to monitor a daemon's logs that updates randomly through the day and night. Is there a way to open the log file and read the new records as they come in the same way as tail -f does? Sure, look on cpan for File::Tail::App and File::Tail -- To unsubscribe, e-mail: [E

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread JupiterHost.Net
Can you point it out to us after their 10th anniversary? Sure, be happy to :) Hmmm, I wonder. Could it be something from CPAN? No, a company has a "product" they made and use and it is saaaweeet, on theri 10th anniversay they'll release it for public use. Any more detaisl and the helicopt

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread JupiterHost.Net
Japerlh wrote: What are the most successful applications of Perl? A few that I consider "successful": cPanel - cpanel.net apple.com amazon.com The navy uses perl to "synchronize watches": http://tycho.usno.navy.mil/cgi-bin/timer.pl A few of our higher end communications clients use

Re: Counting & arrays

2006-05-22 Thread JupiterHost.Net
for my $action (keys %actionrule) { print "Action is: $action\n"; for my $rule (keys %{ $actionrule{$action} }) { print "\tRule is: $rule\n"; print "\t\tand its count is: $actionrule{$action}{$rule}\n"; } } THANK YOU!! This works beautifully! I was pulling my

Re: Counting & arrays

2006-05-22 Thread JupiterHost.Net
Michael Gargiullo wrote: It's been a while since I've used Perl and I need some help with a multidimensional array. AKA a HASH :) You want a hash not an array :) I have a file that I need to compile some stats on. I need to keep track of 'actions' and 'rules'. Yes, stats from a firewall.

Re: Howto check a parameter size in CGI.pm

2006-05-22 Thread JupiterHost.Net
Wijaya Edward wrote: Hi, Is there a way to determine the size of a parameter of a textarea or filefield in CGI.pm? For example, given this form. __BEGIN__ use CGI qw/:standard/; # snip textarea( -name=> 'some_name', -rows=> 10,

Re: Howto include string in system call

2006-05-20 Thread JupiterHost.Net
As I stated in the comment inside the code. Echoing witin the system I assume that means the variables have the proper values in spork.test, correct? _works_. But running perl script within system _doesn't work_. In what way, if its executed it worked but your script may not behave how

Re: Howto include string in system call

2006-05-19 Thread JupiterHost.Net
Wijaya Edward wrote: Dear Jupiter, Thanks so much for the reply. However... >you are not passing the variabels to it proeprly. (an oi, why is that written so incredibly hard to read ???) sorry about that. So you see it has nothgin to do with using system it has to so with calling

Re: Howto include string in system call

2006-05-19 Thread JupiterHost.Net
Saboo, Nandakishore wrote: Hi Edward, __BEGIN__ use Acme::Spork; my $req_id = spork( sub { system("perl compute_price.pl -eml \"$uemail\" -type $ct -unit $nu"); } ) or die qq {Could not fork for spork: $!}; __END__ Any idea? What's this Acme::Spork package about(i have no idea) a

Re: Howto include string in system call

2006-05-19 Thread JupiterHost.Net
And my actuall system call is this:: Ah that is what you failed to mention :) __BEGIN__ use Acme::Spork; my $req_id = spork( sub { system("perl compute_price.pl -eml \"$uemail\" -type $ct -unit $nu"); } ) or die qq {Could not fork for spork: $!}; __END__ Any idea? Yep, as per the do

Re: Howto include string in system call

2006-05-19 Thread JupiterHost.Net
Wijaya Edward wrote: Hi all, How do you pass a string inside an under system call. Just like you're doing below, unless I'm misunderstanding the question I tried to pass a string like this under EMAIL option: system("perl mycode.pl -email 'test_string' -type $sometype -unit $some_

Re: Looking for strategy advice for perl based cgi script

2006-05-18 Thread JupiterHost.Net
Wijaya Edward wrote: Dear expert, Hello, I have the intention to write a Perl based CGI script that does the following steps: 1. Take user input - including email - with a CGI script (mail_result.cgi). make sure they don't try to spoof the input and send mail to zillions of people :

Re: How to get the file's end-lines?

2006-05-10 Thread JupiterHost.Net
Tom Phoenix wrote: On 5/10/06, Practical Perl <[EMAIL PROTECTED]> wrote: I want to know,is there a pure perl way to do that without using the 'tail' unix command? Yes. http://search.cpan.org/perldoc?File::Tail::App Have you tried to implement it? How far have you gotten? -- To unsub

Re: Email going from plain text to be able to show text in color, bold, etc

2006-05-06 Thread JupiterHost.Net
Joshua Colson wrote: On Fri, 2006-05-05 at 15:25 -0700, Timothy Johnson wrote: HTML email is pretty easy to do, especially for simple formatting. There shouldn't be anyone out there that can't receive HTML email. If you really want to accommodate everyone, you could add both the HTML and te

Re: generate list in increments of 10's

2006-05-03 Thread JupiterHost.Net
Mike Blezien wrote: : is there a simple way to generate a list of numbers from : 0 - 1000 in increments of 10 IE: 0, 10, 20, 30, 40. ...etc yes, there sure is :) What have you tried so far that is not working? I have a nice working example I'd love to share but we need to see what you've alre

Re: has key/value pairs

2006-05-03 Thread JupiterHost.Net
Excellent... thank you. Before sending the email question, I was trying to use split to get rid of that and could not get it to work as I was using For () If (/pattern/) { split /\=/ ,$_ /; $vg{$_}++ } } Why didn't this work? a) its invalid code, there are ton of things that'd

Re: HTML to Text

2006-05-03 Thread JupiterHost.Net
And why not post an example of your catch to illustrate it for the benefit of the list? Because I was busy and I knew you would do it ;-) Hee hee, yeah true enough :) But if you know "this exact block of HTML", how about: my @strings = ( "string 1", "string 2", ... ); Because most likele

Re: HTML to Text

2006-05-03 Thread JupiterHost.Net
Paul Johnson wrote: On Tue, May 02, 2006 at 04:43:34PM -0500, JupiterHost.Net wrote: Basically, right now I just need the HTML to Text output, like I explained. "I want to grab strings between the p tags in this exact block of HTML" to which I would reply: my @strings =

Re: HTML to Text

2006-05-02 Thread JupiterHost.Net
Your specification is incomplete. It is simple, not incomplete. Actually it was ambiguous :) Se below to see what I mean (and probably what the post that said it was incomplete meant) What if it says: Data that I need Do you want in your response? Or stripped? Or that part of i

Re: Dynamically Created If Statment

2006-05-02 Thread JupiterHost.Net
Is there a better way to create dynamic if structures on the fly that i am not aware of? Sure, use code refs instead of eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: General Perl/Web questions

2006-04-28 Thread JupiterHost.Net
Steve Gross wrote: I've just finished developing a small web site that uses Perl, CGI, DBI and HTML-Template. Typically, an HTML page calls a Perl script that does a database fetch, parses the data and then puts it on another web page using a template. I've noticed that most of my web

Re: rm -rf in perl

2006-04-26 Thread JupiterHost.Net
Mr. Shawn H. Corey wrote: On Tue, 2006-25-04 at 16:41 -0500, JupiterHost.Net wrote: althought technically any rm -rf (ven the shell itself) has a race condition since it could clean out directory, move on and then, someone adds a file between cleaning out the directory and its removal

Re: sort {} to work with undef values when its expecting an object

2006-04-26 Thread JupiterHost.Net
Tom Phoenix wrote: On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: sort { $a->value() cmp $b->value() || $a->part('Name')->value() cmp $b->part('Name')->value() } grep { defined } @objects But some

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
Jay Savage wrote: On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: for my $obj( sort { $a->value() cmp $b->value() || $a->part('Name')->value() cmp $b->part('Name')->value() } grep { defined } @objects )

Re: sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
ped. I need all objects regardless of if their part call returns and object or undef :( Perhaps their is a logic I can do something like that, like 2 sort()s or a map() or ?? Thanks for the input! -Original Message----- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Tuesday, Apr

Re: rm -rf in perl

2006-04-25 Thread JupiterHost.Net
Brian McKee wrote: On 25/04/06, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote: Is there a definative way to recreate the gnu `rm -rf` in perl? You could use rmtree. perldoc File::Path Looks good, but then I saw this: NOTE: There are race conditions internal to the implementation of

sort {} to work with undef values when its expecting an object

2006-04-25 Thread JupiterHost.Net
Hello List, I have a sort() issue that is a bit odd and any input wouls be most appreciated :) The code: use strict; use warnings; ... for my $obj( sort { $a->value() cmp $b->value() || $a->part('Name')->value() cmp $b->part('Name')->value() } grep { defi

Re: Split function help

2006-04-25 Thread JupiterHost.Net
Mazhar wrote: Dear Irfan, i think for the code you can try the below, ($some_thing1,$some_thing2,$something_3)=split($test,".") You have the split arguments reversed :) Also, don't use double quotes when there is nothing to interpolate. And space them out so its easier to read :) An

Re: How to prevent duplicate cron jobs?

2006-04-21 Thread JupiterHost.Net
siegfried wrote: I have a cron job running perl and it is taking a very long time -- sometimes over 24 hours. How can I have cron schedule my job daily, or even hourly, and have the perl code exit if a previouse instance of the job is still running? perldoc Unix::PID # job.pl that gets cro

Re: Help...

2006-04-20 Thread JupiterHost.Net
hridyesh pant wrote: Hi, Hello, Is there a way to pass a Value from one perl Program(a.pl) to another Perl program(b.pl). Yes, there are many. Perhaps this will help you resubmit your query in a form that will get you more useable results: http://www.catb.org/~esr/faqs/smart-question

Re: Coding Styles

2006-04-20 Thread JupiterHost.Net
Typically, it's been my experience that the guy signing the paycheck, or the one in charge of the project, is the guy calling the shots. If he wants to utilize a coding technique that is neither secure nor understandable, then he will eventually reap the benefits of his narrow-mindedness. If you h

Re: Coding Styles

2006-04-20 Thread JupiterHost.Net
Brent Clark wrote: Hi all Howdy, I seem to be having a few run ins with the "Project Leader", in terms of my coding style. Im very much for modularizing my work - hence the OO concept. That is creating packages using return in my subroutine etc (Oh and using strict) But the ex Cobol Proj

Re: combine 2 "open for reading" filehandles

2006-04-19 Thread JupiterHost.Net
I didn't test this so don't assume it will work, but I think it should ;-) eof should return true if there is nothing left to read. So, instead of using <> which will block until there's something to read (or the fh is closed), you could periodically test eof on your file handles. Perhaps some

Re: combine 2 "open for reading" filehandles

2006-04-19 Thread JupiterHost.Net
John W. Krahn wrote: JupiterHost.Net wrote: Howdy list :) Hello, I'm having a bit of a time with combining 2 read filehandles. The FAQ has a good explanation about that: perldoc -q stderr That was informative, thanks! I ended up using IO::Select to process the open3 rea

Re: beginner help

2006-04-19 Thread JupiterHost.Net
M K Scott wrote: Well, it may not be the ideal solution but just for the record I got it to work. I used a scalar to contain the correect value: $pound = chr 156; Then used unshift to add it to the array. unshift @array, $pound; Seems to have done the trick which is all I wa

Re: dircopy Was: perl help

2006-04-18 Thread JupiterHost.Net
Bjørge Solli wrote: Please use more descriptive sibjects! I second that ;p And more info on where you're gettign reandom functions from :) [snip] But in variable $cp proper value is not coming .Either it should come as 0 or1 but it's coming as any junk value or no. Where in the documen

combine 2 "open for reading" filehandles

2006-04-17 Thread JupiterHost.Net
Howdy list :) I'm having a bit of a time with combining 2 read filehandles. Let me explain, use strict; use warnings; use IPC::Open3; my ($write_fh, $read_fh, $error_fh); open3($write_fh, $read_fh, $error_fh, ... while(<$read_fh>) { ... } while(<$error_fh>) { ... } works fine, great.. Wh

Re: Catching the output in file

2006-04-17 Thread JupiterHost.Net
Irfan J Sayed wrote: Hi, Hello, I am executing following command foreach $_ (@vob_list) { system "cleartool lock vob:$_"; } I want to catch the output of this system command in the file can anybody please tell me that how can i achieve that a) have the shell do it: cleartool lockk v

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
Jay Savage wrote: On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: Timothy Johnson wrote: Will the string always have the two quotes in the same place and only one per string? What about something like this? /.*?\{([^\}]*)\}(?=.*")/gi I tested it out and it appears t

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
Timothy Johnson wrote: Will the string always have the two quotes in the same place and only one per string? What about something like this? /.*?\{([^\}]*)\}(?=.*")/gi I tested it out and it appears to be perect! Thank Mr. Johnson :) I love when I learn a new tidbit! -- To unsubscribe, e-

  1   2   3   4   5   6   7   8   >