use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs';" or "refs" or something , and have it not cause an e

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
JupiterHost.Net wrote: Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs&#x

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
In this case, $func holds a "hard reference", not a "soft reference". The strict pragma only blocks the latter. Here's a simple example: sub howdy { print "Howdy!\n"; } my $func = \&howdy;# hard reference $func->();# fine, even with strictures $func = 'howdy';# soft referen

better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
$xid = param('xid') if param('xid') =~ m/^\d+$/ || ''; But I know that that is not right, what am I missing? I could do the ? : ; dance but I'm not sure 'my' would stay in the scope I need it in. TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PR

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
James Edward Gray II wrote: On Mar 20, 2004, at 3:10 PM, JupiterHost.Net wrote: Howdy, I'm looking to have a one liner version of this: Why? Do you win a cookie if you do it in one line? ;) Not so much a cookie as some sugar :) I win cookies at work for writing clear code, which

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
Paul Johnson wrote: On Sat, Mar 20, 2004 at 03:10:18PM -0600, JupiterHost.Net wrote: Howdy, I'm looking to have a one liner version of this: my $xid = ''; $xid = param('xid') if param('xid') =~ m/^\d+$/; Basically, if the param is numeric then assign it to

Re: better one liner for variable's value assignment

2004-03-20 Thread JupiterHost.Net
John W. Krahn wrote: "Jupiterhost.Net" wrote: Howdy, Hello, I'm looking to have a one liner version of this: my $xid = ''; $xid = param('xid') if param('xid') =~ m/^\d+$/; Basically, if the param is numeric then assign it to $xid, other wise &

Find User Apache is running as

2004-03-28 Thread JupiterHost.Net
Hello List! I was trying to figure out how to see the user the script/webserver is running as. (Like Apache is 'nobody' or the owner 'foomonkey' perhaps with SuExec enabled) I looked in %ENV and didn't see it in there. Any ideas? TIA Lee.M - JupiterHost.Net

Re: Find User Apache is running as

2004-03-28 Thread JupiterHost.Net
ake foo.pl tell which ps it belongs to. I suppose I can use the process Id in $$ in the parseing of ps output. I was hoping for a builtin variable or module that would tell me :) Any other ways besides parsing external program output? TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL

Re: Find User Apache is running as

2004-03-29 Thread JupiterHost.Net
Bob Showalter wrote: JupiterHost.Net wrote: Hello List! I was trying to figure out how to see the user the script/webserver is running as. (Like Apache is 'nobody' or the owner 'foomonkey' perhaps with SuExec enabled) I looked in %ENV and didn't see it in there. A

Re: Find User Apache is running as

2004-03-29 Thread JupiterHost.Net
WC -Sx- Jones wrote: JupiterHost.Net wrote: problem is foo.pl can be run simultaneously by 2 different users so I'm not sure how I'd be able to make foo.pl tell which ps it belongs to. Not a problem - each will have it's own address space and PID. The issue - and you haven&#

Re: determing number of records returned with DBI

2004-03-30 Thread JupiterHost.Net
$dbh->selectall_arrayref($query)}; print "Your search returned $#records results."; for(@records) { ... } HTH Lee.M - JupiterHost.Net > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: determing number of records returned with DBI

2004-03-30 Thread JupiterHost.Net
Smoot Carl-Mitchell wrote: On Tue, 30 Mar 2004 16:00:41 -0600 "JupiterHost.Net" <[EMAIL PROTECTED]> wrote: I'd rewrite the way you're doing it: my @records = @{$dbh->selectall_arrayref($query)}; print "Your search returned $#records results."; for(@r

Re: Strings with extended characters

2004-04-01 Thread JupiterHost.Net
ie "I hate extended characters"; } Of course \w+ is letters , numbers, and underscores only, you will need to add any other characters you want tot he regex but that should get you started eh? Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Using $_ in a function if no argument is passed

2004-04-02 Thread JupiterHost.Net
value of $_ sub myfunc { my $func_arg = shift || ; # you wouldn't just do '|| $_;' would you? ... TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: nested parens

2004-04-03 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: Is there a module out there that I can use to parse a text line and return the pieces that are enclosed in paren's? You don't need a module for that just use regex's: my @text_inside_parens = $string =~ m/\((.*)\)/g; HTH Lee.M - JupiterHost.Net

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread JupiterHost.Net
Thank you to all the responders! I love getting insights like this, Yes I will not use that method (see subject), just love lots of points of view to better my angle :) Thanks again ;p Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: nested parens

2004-04-04 Thread JupiterHost.Net
s a *little* better than `perldoc perlre` ;p) Thanks for taking the time to do that example. Lee.M - JupiterHost.Net HTH, Charles K. Clarkson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: nested parens

2004-04-04 Thread JupiterHost.Net
'((foo) bar)) (baz)', '(foo bar)',) { my @text_inside_parens = $string =~ m/\(([^(^).]*)\)/g; print Dumper [EMAIL PROTECTED]; } HTH Lee.M - JupiterHost.Net Thanks for taking the time to do that example. Lee.M - JupiterHost.Net HTH, Charles K. Clarkson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Questions about game design in perl

2004-04-06 Thread JupiterHost.Net
player? That's really up to your wants/needs. I'd use a MySQL db if I were doing it. Lee.M - JupiterHost.Net Thanks Lou -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: determining reference type

2004-04-07 Thread JupiterHost.Net
sub dohicky { for(@_) { if(ref($_) eq 'ARRAY') { # process as an array ref } elsif(ref($_) eq 'HASH') { # process as a hash ref } else { # process non HASH/ARRAY REF } } } HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

flock return value / bit wise or'd LOCK_NB

2004-04-07 Thread JupiterHost.Net
ng on the type of lock received? IE my $rc = flock(FH, LOCK_EX || LOCK_NB); if($rc == 4) { warn "rats! Exclusive lock not granted, oh well..."; } if(!$rc) { die "Could not get lock no how mr flock guy!"; } TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: An extremely newbie question about appending records in a file.

2004-04-07 Thread JupiterHost.Net
w yet. I bet one of the smarter folks can help you with the reasons why :) I'm starting out with one-liners and working my self up to an actual script here. :>) Cool! Perl rocks! Thanks, --Walt HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: flock return value / bit wise or'd LOCK_NB

2004-04-07 Thread JupiterHost.Net
Smoot Carl-Mitchell wrote: On Wed, 07 Apr 2004 13:51:03 -0500 "JupiterHost.Net" <[EMAIL PROTECTED]> wrote: perldoc -f flock says "If LOCK_NB is bitwise-or'ed with LOCK_SH or LOCK_EX then "flock" will return immediately rather than blocking waiting for t

Re: Problem with storing data in an array

2004-04-07 Thread JupiterHost.Net
by doing: for( @{ $dbh->selectall_arrayref($query) } ) { my ($a_column,$b_column) = @{ $_ }; } And all that without having to do the prepare, execute, getchrow_array dance or worry about array names and simplifying the process of processing the data :) HTH Lee.M - JupiterHost.Net an

Re: flock return value / bit wise or'd LOCK_NB

2004-04-07 Thread JupiterHost.Net
Smoot Carl-Mitchell wrote: On Wed, 07 Apr 2004 14:50:54 -0500 "JupiterHost.Net" <[EMAIL PROTECTED]> wrote: So flock(FH, LOCK_EX | LOCK_NB) then? Yes. So: my $rc = flock(FH, LOCK_EX | LOCK_NB); if($rc == 0) { warn "rats! Exclusive lock not granted, oh well...";

alias a function

2004-04-08 Thread JupiterHost.Net
} or do a typeglob: sub foo { return "Howdy $_[0]"; } *bar = \&foo; or another way ?? TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: alias a function

2004-04-08 Thread JupiterHost.Net
david wrote: Jupiterhost.Net wrote: Hello list, I was looking into the best way (and for what reasons) you'd create an "alais" function. For example: If you want foo() and bar() to be able to be used interchangeably would it be best to do: sub foo { return "Howd

Re: alias a function

2004-04-08 Thread JupiterHost.Net
goto() just kind of uses the current @_ if I remeber right, correct? Not just that. If all you wanted was to call foo with the current @_ youd write it like this: sub bar { &foo; } The goto &foo; does more. It replaces bar() by foo() in call stack. So if foo() calls caller() or croaks() it

Re: alias a function

2004-04-08 Thread JupiterHost.Net
that's one feature of goto &foo and another has to do with transfering the current call to another so caller is fooled to believe the function is actually called directly Excellent, thansk for the info David! I'll have to perldoc -f goto since I'm not realy familiar with it and its own issues

Install module for earlier version Perl

2004-04-12 Thread JupiterHost.Net
Hello, I have DBI for 5.8.1 but not 5.8.0 (don't ask me why not ;p) How can I install DBI and tell it to be installed in the 5.8.0 @INC instead of 5.8.1's @INC? perl -MCPAN -e '??? 5.8.0;install Bundle::DBI;' TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [

Re: Install module for earlier version Perl

2004-04-12 Thread JupiterHost.Net
JupiterHost.Net wrote: Hello, I have DBI for 5.8.1 but not 5.8.0 (don't ask me why not ;p) How can I install DBI and tell it to be installed in the 5.8.0 @INC instead of 5.8.1's @INC? perl -MCPAN -e '??? 5.8.0;install Bundle::DBI;' I'm an idiot : perl5.8.0 -MCPA

cleaning up references properly

2004-04-12 Thread JupiterHost.Net
t if it was never opened? How can I check that? # any others, } TIA Lee.M- JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: cleaning up references properly

2004-04-12 Thread JupiterHost.Net
t the "refernce count to zero" here in one line regardless of ref type } If that thing happens to be an object, the object is destructed. See perlobj for more about objects." http://danconia.org Thanks for the info :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: cleaning up references properly

2004-04-12 Thread JupiterHost.Net
Still not convinced you need any such idiom... I'm not either, but they are not, believe it or not, "multiple executions of a non-persistent script" they are multiple executions of a persistent script that remains persistent between executions. Its hard to image but take a look at this (and

Re: cleaning up references properly

2004-04-12 Thread JupiterHost.Net
Wiggins d Anconia wrote: Still not convinced you need any such idiom... I'm not either, but they are not, believe it or not, "multiple executions of a non-persistent script" they are multiple executions of a persistent script that remains persistent between executions. Its hard to image b

Re: cleaning up references properly

2004-04-13 Thread JupiterHost.Net
Very cool! Ok, well you think that might have helped to state in the first place, especially when posting to a beginners list? Sorry I didn't mean to offend anyone, I felt it was irrelevant to the question. (IE - How do I vacuum my car instead of How would I vacuum a blue car?) I simply was t

Re: cleaning up references properly

2004-04-13 Thread JupiterHost.Net
david wrote: Jupiterhost.Net wrote: Ok, well you think that might have helped to state in the first place, especially when posting to a beginners list? Sorry I didn't mean to offend anyone, I felt it was irrelevant to the question. (IE - How do I vacuum my car instead of How would I vac

Re: cleaning up references properly

2004-04-13 Thread JupiterHost.Net
Yes it is a bit confusing :) hence all the tension..., my fault I apologize The original idea was this: I have a few items, $foo, @bar, %baz, and FH (via open()) I could (and yes, probably should ;p ) do: undef $foo; undef @bar; undef %baz; close FH; What I'd like to do is accomplish tha

Re: getting array index inside for loop

2004-04-14 Thread JupiterHost.Net
for(@array) { print "Number $ix is $_\n"; $ix++; } HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: getting array index inside for loop

2004-04-14 Thread JupiterHost.Net
Andrew Gaffney wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I have code that uses a 'foreach(@array) {}' to loop : through an array. I now need to be able to get the : array index inside of that. I know I could switch to : a 'for($loopvar=0;$loopvar<@array;$lo

Re: Flag for script

2004-04-15 Thread JupiterHost.Net
n"; } else { print "What did you choose?\n"; } } else { print "you have not chosen the very special ability!\n"; } or: my $switch = $ARGV[0] || ''; now it is initialized :) and you can do what you did before just use $switch instead of $ARGV[0] HTH Lee.M -

Re: sendmail +perl

2004-04-16 Thread JupiterHost.Net
deny wrote: good afternoon i use sendmail to send mail with a script perl i receive this mail in /var/spool/clientmqueue but not in my mailbox mozilla here is the line in the script perl open(MAIL, "|/usr/sbin/sendmail [EMAIL PROTECTED]"); piping to a program is very unreliable. for instance -

simple eval $e; issue

2004-04-20 Thread JupiterHost.Net
ipt and not limit it to the package? After I check that the supplied module name is a valid looking module name: my $e = @_ ? qq(use $m qw(@_);) : qq(use $m;); eval $e; then I return true if !$@ false if not Like I said it works great id I call it inside the package.. print "-$e-\n";

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
t to chekc and see if a module and the items chosen for export are available and if so import them in to the calling name space and if not handle $@ however you want... Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
WC -Sx- Jones wrote: JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name *and* does the EXPORT symbols also *if* its cal

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
Wiggins d'Anconia wrote: JupiterHost.Net wrote: WC -Sx- Jones wrote: JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
uot; Works like a charm! Thanks for the input everyone I really appreciate it :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: graphic terminal in perl

2004-04-22 Thread JupiterHost.Net
e to start ? Try the Tk Modules or another one listed at http://search.cpan.org/modlist/User_Interfaces HTH :) Lee.M - JupiterHost.Net Thank you Regards, Nicolas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <ht

Re: untaint filename by replacing with underscores?

2004-04-22 Thread JupiterHost.Net
eone has a pipe or backtick? maybe s/\W/_/g; do what you want more thouroughly (and readably)? HTH Lee.M - JupiterHost.Net Thanks in advance, Damon -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: untaint filename by replacing with underscores?

2004-04-22 Thread JupiterHost.Net
my $safe = $attach_name; $safe =~ s/[^\w\s\-\.]/_/g; That won't help. If $attach_name is tainted, $safe will still be tainted. Oops, I wasn't;t even thinking -t, duh! :) I was looking at the regex and the " replace any unsafe characters with underscores" part, sorry :) Here's how to do it: #

Re: Perl vs PHP

2004-04-22 Thread JupiterHost.Net
d with the host (IE think cPanel) (and only after ruling out an existing Perl version ;p). Anything I am responsible for making sure is working well and doing its job I create in Perl... Just my .02 Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Perl vs PHP

2004-04-22 Thread JupiterHost.Net
g sure is working well and doing its job I create in Perl... Just my .02 Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Perl vs PHP

2004-04-22 Thread JupiterHost.Net
Wiggins d Anconia wrote: [EMAIL PROTECTED] wrote: Why would one prefer PHP over PERL, or vice, versa? I'm guessing PERL has more functionaltiy and is more robust. What are the technical arguments for one over the other? JP Perl IMHO is a SysAdmin language and PHP is and more or less always

Re: Yet more file upload questions

2004-04-23 Thread JupiterHost.Net
John Pretti wrote: All, Howdy, I appreciate all the help with file uploading. I have written a basic script similar to the file upload sample at perlmonks.com. I have noticed that it is written very loosely so I am trying to build in additional security. Some of the things I would like help un

run function inside script on internal schedule?

2004-04-23 Thread JupiterHost.Net
; # or your long running code here ... print "$now\n"; # Sat Apr 24 00:57:06 2004 print $job->error if !$job->status; $job->stop; sleep(3); print "$now\n"; # still Sat Apr 24 00:57:06 2004 because we stopped it Anything even remotely like what I'm describing or

Re: WWW::Mechanize question

2004-05-12 Thread JupiterHost.Net
that I haven't defined 'tag'? Thanks from a PERL newbie, Ben np :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Multi library

2004-05-12 Thread JupiterHost.Net
Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: WWW::Mechanize question / array values

2004-05-12 Thread JupiterHost.Net
e perldoc perlref HTH Lee.M - JupiterHost.Net Thanks, Ben -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Perl::Optomizer

2004-05-12 Thread JupiterHost.Net
d $stuff = "hello"; shoudl be: $stuff = 'hello'; etc $str = CGI::header() . "hello" . $v; woudl become $str = CGI::header(),"hello", $v; that sort of thing... TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
Ricardo SIGNES wrote: * "JupiterHost.Net" <[EMAIL PROTECTED]> [2004-05-13T11:35:58] Bob Showalter wrote: for instance: $newvariable = "$howdy"; should be: $newvariable = $howdy; That's not an appropriate optimization. Perl objects can overload stringificatio

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
Jeff 'japhy' Pinyan wrote: The lesson to learn is: Premature optimization is the root of all evil. Got ya ;p http://en.wikipedia.org/wiki/Optimization_(computer_science) Optimization (computer science From Wikipedia, the free encyclopedia. (Wikipedia does not have an article on this topi

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
Jean-Sébastien Guay wrote: http://en.wikipedia.org/wiki/Optimization_(computer_science) Optimization (computer science From Wikipedia, the free encyclopedia. (Wikipedia does not have an article on this topic yet. To start the article, click Edit this page.) ?? :( I was wanting to read it.

Re: File Monitoring

2004-05-10 Thread JupiterHost.Net
mp; Thanks! np, HTH Lee.M - JupiterHost.Net Cheers, Ben -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Best way to Send Hash to a Socket

2004-05-07 Thread JupiterHost.Net
zentara wrote: On Wed, 05 May 2004 11:38:33 -0500, [EMAIL PROTECTED] (Jupiterhost.Net) wrote: Hello list, To day I am trying to figure out the best way to send a hash to a socket and have the receiver be able to use it as a hash. The best way I've done so far is to Data::Dumper the hash

Re: Best way to Send Hash to a Socket

2004-05-07 Thread JupiterHost.Net
Wiggins d Anconia wrote: On Wed, 05 May 2004 11:38:33 -0500, [EMAIL PROTECTED] (Jupiterhost.Net) wrote: Hello list, To day I am trying to figure out the best way to send a hash to a socket and have the receiver be able to use it as a hash. The best way I've done so far is to Data::D

Re: run function inside script on internal schedule?

2004-04-25 Thread JupiterHost.Net
WC -Sx- Jones wrote: Why do Perl programmers want to re-invent the wheel? JupiterHost.Net wrote: Assume I have a script that will run for 10 seconds. Is it possible to have a function executed every 2 seconds? I know it sounds weird but how would one go about something like that? http

Re: run function inside script on internal schedule?

2004-04-26 Thread JupiterHost.Net
Thanks Wiggins and Scott for the info. I'll take a gander at the info you pointed out. I agree its probably over kill but I was curious about it simply for grins :) So I'll use your references and see what I can figure out... Thanks Lee.M - JupiterHost.Net -- To unsubscribe, e-ma

Re: #include like in C

2004-04-26 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 There are 4 ways to do what you want. The closest is probably 'do' perldoc -f do I would recommend the module approach as has already been suggested: perldoc -f use perldoc -f require So far, "do" is looking like the be

Re: #include like in C

2004-04-26 Thread JupiterHost.Net
$a = $main::ARGV[1]; $b = $main::ARGV[2]; $c = function($a,$b); .. So, having to use $main:: is really an ugly and dangerous solution, and hence why I really don't like the "use" or "require" solutions. "do" Why is using main:: dangerous? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: s/// Vs tr///

2004-04-28 Thread JupiterHost.Net
]/-/g 2100840/s8%5%-- HTH :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Sockets

2004-04-28 Thread JupiterHost.Net
back? Would I have to accept() and recv() right after I send()? How about accept() and recv() when I havn't entered anything where/how would that go? Any pointers would be most appreciated :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: How do i call a module !

2004-05-04 Thread JupiterHost.Net
What module is it perhaps we can help a bit more if we had more details :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: package problem...

2004-05-05 Thread JupiterHost.Net
to executre their own queries to get your sensitive data or delete your data... $sth = $dbh->prepare($chestie); $sth->execute; $mes = 1; $dbh->disconnect; } } else{ $mes = 2;

Re: [ Hash of Arrays]

2004-05-05 Thread JupiterHost.Net
e expecting... If you want it to be a hash ref you need my $ModelPath = { ... }; and if you want it to be a hash you'd need to use () instead of {} Just a little observation :) Lee.M - JupiterHost.Net But by doing so I am not getting the values for the respective keys. -- To unsubscribe, e

Best way to Send Hash to a Socket

2004-05-05 Thread JupiterHost.Net
way to do that. -IE hashtostring() and stringtohash()- I can't use refs of course because the server will receive the text HASH from the client and that wouldn't be too useful in the server. TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Quick Perl on Windows Newbie Questions

2004-05-05 Thread JupiterHost.Net
cript.pl" correct? If not how do you do that? TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Quick Perl on Windows Newbie Questions

2004-05-05 Thread JupiterHost.Net
Tim Johnson wrote: See answers below. Thanks Tim! -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 12:30 PM To: [EMAIL PROTECTED] Subject: Quick Perl on Windows Newbie Questions Hello ActiveState ActivePerl users (any on this list?) :) I

h2xs newbie

2004-05-16 Thread JupiterHost.Net
oo.pm ? TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: h2xs newbie

2004-05-16 Thread JupiterHost.Net
Jeff 'japhy' Pinyan wrote: On May 16, JupiterHost.Net said: So the first question is: To create the tar.gz file needed for upload to cpan I simply tar/gz ify the NewModule/ directory, correct? No. h2xs ... Foo::Bar cd Foo/Bar # make the module perl Makefile.PL make tardist

Re: Getting the href

2004-05-17 Thread JupiterHost.Net
/\/)?[\/\w\.\-]+)\"/ig; HTH Lee.M - JupiterHost.Net How do I pull just the 'here_kitty' part? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Getting the href

2004-05-17 Thread JupiterHost.Net
Wiggins d Anconia wrote: Jason Dusek wrote: Hi Everyone, Hello, What is good way to pull the href from a link in html? If I have links like: meow woof moo bark bahh meow bahh moo bark There's are modules that help you do it, but this may work for what you need: my @href = $html =~ m/href\=\"

Re: coding sampling techniques in perl

2004-05-18 Thread JupiterHost.Net
same? Any help in this regard is welcome. I'm not sure what the sampling stuff is, I'm assuming audio? Either way I'd check out search.cpan.org to look for audio modules. HTH :) Lee.M - JupiterHost.Net Thanks Regards Guruguhan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: h2xs newbie

2004-05-18 Thread JupiterHost.Net
Randy W. Sims wrote: JupiterHost.Net wrote: Jeff 'japhy' Pinyan wrote: On May 16, JupiterHost.Net said: So the first question is: To create the tar.gz file needed for upload to cpan I simply tar/gz ify the NewModule/ directory, correct? No. h2xs ... Foo::Bar cd Foo/Bar # make

Re: regexp

2004-05-19 Thread JupiterHost.Net
'sm:a', and I need to extract the information contained by '' and '' pair and the tags too, how should I proceed ? I recommend trying an XML parsing module from search.cpan.org HTH :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

pointer to another list?

2004-05-20 Thread JupiterHost.Net
Hello group! Anyone have any idea of a mailing list or more resources about embedding Perl in C like is discussed here: http://www-h.eng.cam.ac.uk/help/mjg17/perldoc/pod/perlembed.html) TIA Lee.M -JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: pointer to another list?

2004-05-21 Thread JupiterHost.Net
Jose Alves de Castro wrote: For a list of lists, you might want to try http://lists.perl.org/ First place I went and none of them seemd to be about it :) On Thu, 2004-05-20 at 18:58, JupiterHost.Net wrote: Hello group! Anyone have any idea of a mailing list or more resources about embedding Perl

Modify $0 in Perl embedded in C

2004-05-21 Thread JupiterHost.Net
-$0-\n);", TRUE); perl_destruct(my_perl); perl_free(my_perl); } So does anyone have any insigth as to why it flops and/or how to set $0 with another value in those examples? TIA Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Modify $0 in Perl embedded in C

2004-05-24 Thread JupiterHost.Net
Just a note: I also tried $main::0 as well as $0 (as in perl -e '$0 = "foo";print "$0\n";' perl -e '$main::0 = "foo";print "$0\n";') after I used caller() to make sure it was in main::. Any ideas? JupiterHost.Net wrote: Hello group! Ma

Re: Modify $0 in Perl embedded in C

2004-05-24 Thread JupiterHost.Net
Just a note: I also tried $main::0 as well as $0 (as in perl -e '$0 = "foo";print "$0\n";' perl -e '$main::0 = "foo";print "$0\n";') after I used caller() to make sure it was in main::. Any ideas? JupiterHost.Net wrote: Hello group! Ma

Re: multiple pages results

2004-05-24 Thread JupiterHost.Net
nt to check out Data::Page and/or Data::Pageset HTH:) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Modify $0 in Perl embedded in C

2004-05-25 Thread JupiterHost.Net
zentara wrote: On Fri, 21 May 2004 20:37:33 -0500, [EMAIL PROTECTED] (Jupiterhost.Net) wrote: Hello group! Maybe a bit much for a beginners list (I looked and looked and couldn't find any specific lists) but Perhaps a guru or two will know the answer :) Have you tried the perl.inline

Re: entering text within a file

2004-05-26 Thread JupiterHost.Net
g is 6 characters long, so why the 5? \d{5} says five digits isn't there a insert regular expression? HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: entering text within a file

2004-05-26 Thread JupiterHost.Net
e E string and write now it is replacing ? Try this: while(<>) { s/^E?\d{5}/eject\t0,0,0\t\n\1/; # the \1 is what you matched in the first half print; } thanks! np :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Re: entering text within a file

2004-05-26 Thread JupiterHost.Net
eject\t0,0,0\t$1\n/;print; }' I'm an idiot :) To set $1 (or $2 or $3 etc) you have to use parens... duh! Sorry its been a long day :) That should do it :) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://lear

Re: entering text within a file

2004-05-27 Thread JupiterHost.Net
@ejectapes); also (its one of my things ;p) I single quoted .bak since it doesn't need interpolated (if I'd not changed it to ann array I'd have also recommended not quoting $ejectapes either: ... = ('.bak', $ejectapes) Its a bit faster and cleaner looking :) just my .02

Re: entering text within a file

2004-05-27 Thread JupiterHost.Net
ejectapes = qw(/usr/local/bin/perld/exports /foobar/tapes /baz/wal/tapes); It would only loop throught the first one since that's the only one you're using :) HTH Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: Check on array return result

2004-06-01 Thread JupiterHost.Net
)ing ;p) Try this: for(@check_vip_ports) { print "\$_ is $_"; } # just use $_ instead of $token # or if you *really* want to use $token: for my $token(@check_vip_ports) { print "\$token is $token"; } You may want to perldoc -f pop perldoc perlop perldoc -f glob HTH :) Lee.M

Re: Perl Search

2004-06-05 Thread JupiterHost.Net
r way, and if you get stuck just post back here your code and the problem and you'll have it up and running in no time :) HTH Lee.M - JupiterHost.Net cheers barbara -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.per

Re: File::Find

2004-06-09 Thread JupiterHost.Net
it would only return a list of directories not a list of all the files HTH Lee.M - JupiterHost.Net Thanks, Melis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

  1   2   3   4   5   6   7   8   >