Daniel:
-I've sent this to the mod_perl list but there seems to be no response.
I got the module working in the current directory executing on the command
line. But I have a problem calling a module in my mod_perl dir using
apache on redhat 9. I have a mystuff.pm in the same directory as the
call
Lots of good stuff here. This oneliner is what makes perl cool but it's
like speaking in tongue -:)
> sub isValidChars { shift =~ /^[A-Za-z_]+$/ }
Thanks,
-rkl
> On Sep 29, [EMAIL PROTECTED] said:
>
>>Since, everyone is so lively today, I'm going to push my luck today with
>>this list. I need
On Sep 29, [EMAIL PROTECTED] said:
>Since, everyone is so lively today, I'm going to push my luck today with
>this list. I need a little help here with validating a string to have only
>characters that I want, A-z and _ (underscore).
You'll want to use a regular expression, or perhaps just the tr
man patch
On Monday, September 29, 2003, at 11:24 PM, Gupta, Sharad wrote:
Hi All,
Say i give one of my application to a customer. The customer runs it
and finds a bug in there.
I don't want to give a fixed application again to the customer and ask
him to go through the pain of installing i
Hi All,
Say i give one of my application to a customer. The customer runs it and finds a bug
in there.
I don't want to give a fixed application again to the customer and ask him to go
through the pain of installing it again.
Instead i create a patch and tell customer to install that patch.
Since, everyone is so lively today, I'm going to push my luck today with
this list. I need a little help here with validating a string to have only
characters that I want, A-z and _ (underscore).
So, this is what I'm stuck on:
#should fail because of space
$username="bob by";
if(&isValidChars($u
On Sep 29, Hanson, Rob said:
>I ran some benchmarks.
>
>The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and
>results below.
>
>Benchmark: timing 10 iterations of OneLine, OneLine2, TwoLines...
> OneLine: 41 wallclock secs (39.30 usr + 0.00 sys = 39.30 CPU) @ 2544.79/s
>
--On Monday, September 29, 2003 19:04 -0700 "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
test.pl
---
use mystuff;
print mystuff::trim($username);
mystuff.pm
--
# do i need any declaration line here
# is sub here or what?
# and where do i put this pm file?
sub trim
{ my $z = $_[0]
Can someone help with build a simple module with one function in it?
Can't seem to get anythign working.
I guess something like:
test.pl
---
use mystuff;
print mystuff::trim($username);
mystuff.pm
--
#do i need any declaration line here
#is sub here or what?
#and where do i put this
This is the correct reply.
That's some good stuff.
can you run a benchmark against these, contributed by others on this list,
as well?
$username =~ s/^\s*(.*?)\s*$/$1/;
s/^\s+//, s/\s+$// $username;
thanks,
-rkl
> I ran some benchmarks.
>
> The two-liner outperformed the one-liners by a 10 to
That's some good stuff.
can you run a benchmark against these, contributed by others on this list,
as well?
$username =~ s/^\s*(.*?)\s*$/$1/;
$username =~ s/^\s*(.*?)\s*$/$1/;
thanks,
-rkl
> I ran some benchmarks.
>
> The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and
> res
Bob Showalter wrote:
> for (1..$y) {
> print "$_\n" unless $_ % 1000;
Whoops! You can leave the line above out. I just stuck it in there so I
could see the progress through the loop.
> my $i = int(rand($x)) + 1;
> exists $h{$i} and redo;
> $h{$i}++;
> }
--
To unsubscri
this looks convenience
thanks,
-rkl
> [EMAIL PROTECTED] wrote:
>> Is there a func or a onliner for removing blanks from both ends?
>>
>> I'm using these:
>>
>> $username =~ s/^\s+//;
>> $username =~ s/\s+$//;
>>
>> There got to be one out there!
>
> Doing it in two steps is the way to go. Don't t
[EMAIL PROTECTED] wrote:
> Is there a func or a onliner for removing blanks from both ends?
>
> I'm using these:
>
> $username =~ s/^\s+//;
> $username =~ s/\s+$//;
>
> There got to be one out there!
Doing it in two steps is the way to go. Don't try to make one regex out of
it.
I usually write it
Douglas Holeman wrote:
> I have had a request to pull 100,000+ names from a mailing list of
> 600,000+. I was hoping to figure out a way to get perl to help me do
> this.
>
> I stumbled through this code but the problem is I just wanted to know
> how to delete a line from the first list so I can be
I ran some benchmarks.
The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and
results below.
Benchmark: timing 10 iterations of OneLine, OneLine2, TwoLines...
OneLine: 41 wallclock secs (39.30 usr + 0.00 sys = 39.30 CPU) @ 2544.79/s
OneLine2: 34 wallclock secs (32.58 us
Rob,
why not try one of r-desktops. I use TridiaVNC, which you can carry with
ssh.
Mark G
- Original Message -
From: "Rob Richardson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 29, 2003 3:33 PM
Subject: Re: Generic database access?
> Sam,
>
> There's a lot
On Monday, September 29, 2003, at 07:04 PM, [EMAIL PROTECTED] wrote:
Is there a func or a onliner for removing blanks from both ends?
I'm using these:
$username =~ s/^\s+//;
$username =~ s/\s+$//;
We could combine those:
$username =~ s/^\s*(.*?)\s*$/$1/;
Hope that helps.
James
--
To unsubsc
That is what you want to use.
You could do it in a single regex:
## NOT RECOMMENDED - SEE NOTE BELOW ##
$username =~ s/^\s+|\s+$//g;
The downside is that this is not efficient and actually takes Perl longer to
perform the operation. If you want to know why you need to know a little
about how Per
Is there a func or a onliner for removing blanks from both ends?
I'm using these:
$username =~ s/^\s+//;
$username =~ s/\s+$//;
There got to be one out there!
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Perlwannabe wrote:
>>
>> I originally tried to do this, but it won't work. The data doesn't
>> _always_ have a before address, sometimes (although seldom) it
>> has a . With grep I would miss the entire address. However,
>> if I were to just select everything and replace it with nothing, that
Steve Grazzini wrote:
>
> On Mon, Sep 29, 2003 at 11:04:46PM +0300, Ville Jungman wrote:
> > This is real example from what i was doing yesterday:
> > if($subs->anna_tilavuus($x+$lisax,$y+$lisay,$z) < 100){
> > $subs->paivita($x);
> > $udat{x}=$lisax;
> > $udat{y}=$lisay;
> > }e
I have had a request to pull 100,000+ names from a mailing list of
600,000+. I was hoping to figure out a way to get perl to help me do
this.
I stumbled through this code but the problem is I just wanted to know
how to delete a line from the first list so I can be sure I dont pull
the same 'rando
Dan Anderson <[EMAIL PROTECTED]> wrote:
> Is there a (BA)SH/CSH/TSH/KSH variable to the Perl path?
>
> I am creating a script that uses Perl I want to be able to share over
> several servers. Instead of having my users edit the file manually
> (because I assume they would do something dumb) I wan
On Sep 29, Kevin Pfeiffer said:
>I'm working on a nice frontend to the Unix::AliaseFile module for managing
>'aliases'. In the process I've extended a couple methods in the module and
>added a new one.
>
>There is a show_user method that returns all aliases of which a user is a
>member; there's al
Kevin wrote:
>
>
> I've updated the docs and wrote "...based on version
> xxx of Unix::AliasFile by Steve Snodgrass...", etc.
Mister Snodgrass is a character in The Pickwick Papers
invented by Charles Dickens. He is no "Foo" or "Bar".
Proud of the soil on which I stand :)
Rob Dixon
Leicester
ENG
On Mon, Sep 29, 2003 at 11:04:46PM +0300, Ville Jungman wrote:
> This is real example from what i was doing yesterday:
> if($subs->anna_tilavuus($x+$lisax,$y+$lisay,$z) < 100){
> $subs->paivita($x);
> $udat{x}=$lisax;
> $udat{y}=$lisay;
> }elsif($subs->anna_tilavuus($x,$y+$lisay,
Is there a (BA)SH/CSH/TSH/KSH variable to the Perl path?
I am creating a script that uses Perl I want to be able to share over
several servers. Instead of having my users edit the file manually
(because I assume they would do something dumb) I want to create a shell
script to edit the script for
From: "TN" <[EMAIL PROTECTED]>
1. You can pipe into and out of control constructs in the sh-ksh-bash
family, including for and while loops. This can be convenient and
elegant, but not absolutely necessary logically.
You thought possible IO-constructs with this but it isn't very clear to me
what i
On Sun, Sep 28, 2003 at 11:48:19PM -0700, Dan Fish wrote:
> sub myfunc{ my ($query) = @_;
> $foo=$query->param("foo");
> ...more...blah...blah...
> }
>
> Everything works fine as is, but I'm trying to take the function "myfunc"
> out and put it in a separate .pm file because I need to call it fro
Sam,
There's a lot of products named "Webmon". The ones I found on Google
didn't do what I want. Which one are you thinking of? Can you give me
a company name?
Thanks again!
Rob
__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://
Lists Perl Org wrote:
> Hi all,
>
> I'm quite new to Perl so please bear with me :)
>
> I've experience in Delphi so I thought I knew about objects... it
> seems I don't :(
>
> I want to have a class I won't instanciate (static members and
> variables), with global vars so I can access them and
Hi,
I am facing a problem in using the Mail::Bulkmail 3.09 module.
I am using the following method to specify the configuration files.
Mail::Bulkmail->conf_files('C:/Perl/lib/Bulkmail.cfg');
and I have converted the script to an '.exe ' file. While I run the .exe file
I get the error
"Can't ca
I am usiing GD::Graph::lines to draw a graph with multiple lines. How do I specify so
that lines can be of different width?
yi
-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
search google for "Webmon".
also check out phpadmin.
good luck
Sam Harris,
Systems Administrator
Franklin University
201 S. Grant Avenue
Columbus, Ohio 43215-5399
Work: (614)-744-8322
Toll free: 1-877-341-6300 ext. 8322
[EMAIL PROTECTED]
http://www.franklin.edu/
>>> [EMAIL PROTECTED] 09/29/03 0
Hi,
I'm working on a nice frontend to the Unix::AliaseFile module for managing
'aliases'. In the process I've extended a couple methods in the module and
added a new one.
There is a show_user method that returns all aliases of which a user is a
member; there's also a "Toggle on/off" that uses co
In article <[EMAIL PROTECTED]>, R. Joseph Newton wrote:
> Kevin Pfeiffer wrote:
>
>> I thought the easy way to do this is to first assign my entire 'en' data
>> structure to the 'de' structure and then add 'de' values as available.
>>
>> So I did this:
>>
>> $text{'main'}{'de'} = $text{'main'}{'
On Sep 29, [EMAIL PROTECTED] said:
>I got it to work after adding a new var in apache modperl environment.
>
>This works:
> $acct_no = $xgi->param("acct_no");
> print substr($acct_no, 0, 4, "x" x (length($acct_no)-4));
>
>This did NOT work:
> print substr($xgi->param("acct_no"), length($xgi->param
Fernando wrote:
>
> I'm quite new to Perl so please bear with me :)
We have no choice: this is, after all, perl.beginners!
> I've experience in Delphi so I thought I knew about objects... it
> seems I don't :(
Yes you do :) But you're confusing methodologies with implementations.
> I want to ha
> Big advice #2. Ebay. I buy all new books and expensive books through
> trusted sellers for about a 50-60% savings. Make sure you can pay media
> rate on the shipping. $4.00. I routinely buy books for $15-20 here.
I do the same thing, and would add the following sites:
http://www.alibris.co
phpMyAdmin is great for managing MySQL databases remotely using a web
browser interface. See http://www.phpmyadmin.net/
-tn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This problem looks familiar. What will kill the first snoop? The while
loop at the bottom assumes snoop is running and tries to run another
snoop on the same interface as the first. I don't think that can be
done even from the command line because the first snoop will lock
/dev/ge0 (in promiscuo
I don't know if you've been following the news but Verisign and some
others have funneled *.com and *.net to their web site for expired and
invalid domain names. You should correct for such things when looking
up the IP.
-Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Lists Perl Org wrote:
Hi all,
I'm quite new to Perl so please bear with me :)
I've experience in Delphi so I thought I knew about objects... it
seems I don't :(
I want to have a class I won't instanciate (static members and
variables), with global vars so I can access them and change them from
wi
On Mon, 2003-09-29 at 16:07, Juris wrote:
> Hi!
>
> Thanks, your solution is one way how solve this problem! I found other ...
>
Gr8 That is the spirit of perl. There is always a different , slightly
better way of doing things in perl.
Ram
Hello,
I have a perl script that is to stop and start at midnight, and write to a new log
file.
The problem is it runs once then does not run again??
Below is the script that I am tring to use??
bash-2.03#
#!/bin/perl -w
use warnings;
use strict;
my ( $sec, $min, $hour, $day, $mon, $year
Greetings!
Is there a Perl module --
"Don't be silly!", I hear you reply. "There's a Perl module for
everything!"
OK, let me rephrase that. I would like a program, probably but not
necessarily in Perl, that can run on a Perl-equipped Unix server that
will give me remote access through the Inte
For a project / learning exp. I am trying to create a windows client
that will let me interact with a Hylafax server. I don't know enough
about the special ftp protocol it uses so I am try to just parse the log
files to get similar functionality using tk.
Now how can attach to a share using login
Has anyone done this in Perl, is there an module that can help me? I am
aware of that I can use the Win32::Ole, but what I really want is an
more easier way of asking:
For $user
Return mailadress
This can be done in VB quite easy, but I want to try and stay "perlish"
here. Any one have an clue?
Hi!
It's easy!
There is one sample:
sub do_somethig {
my @[EMAIL PROTECTED];
if (! ($passed_params[0])) { print "Not passed parametrs" }
my @lines;
#Do something ...
return @lines;
}
On Thu, 25 Sep 2003 21:59:53 -0700, Rajesh Dorairajan
<[EMAIL PROTECTED]>
Hi all,
I'm quite new to Perl so please bear with me :)
I've experience in Delphi so I thought I knew about objects... it
seems I don't :(
I want to have a class I won't instanciate (static members and
variables), with global vars so I can access them and change them from
withing threads/forks.
Hi!
Thanks, your solution is one way how solve this problem! I found other ...
sub remove_ary_dupes{
my @[EMAIL PROTECTED];
#Define hash
undef %saw;
@[EMAIL PROTECTED] = ();
#Hash owerwrite automaticly duplicated values! ;)
my @out = sort keys %saw; # remove sort if undesired
return @out;
}
sub
[EMAIL PROTECTED] <[EMAIL PROTECTED]> asked:
> what is the proper way to pass a parameter for something like
> $cgi-param(username)?
>
> as far as i know it, this works for me:
>
> $cgi-param(username);
Don't do that. Using barewords as strings can
break your code if you later on introduce a
sub
I got it to work after adding a new var in apache modperl environment.
This works:
$acct_no = $xgi->param("acct_no");
print substr($acct_no, 0, 4, "x" x (length($acct_no)-4));
This did NOT work:
print substr($xgi->param("acct_no"), length($xgi->param("acct_no"))-4,4);
Any explanation would be
what is the proper way to pass a parameter for something like
$cgi-param(username)?
as far as i know it, this works for me:
$cgi-param(username);
$cgi->param("username");
$cgi->param('username');
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Dan Fish wrote:
I'm a bit new to this so please bear with me...
I've written a script that uses CGI.pm something like this:
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:all);
$query = new CGI;
blah...blah...
&myfunc($query);
blah...blah...
sub myfunc{ my ($query) = @_;
$foo=$query->par
Tn wrote:
> Hi,
>
> As far as I can tell you are doing it right according to the manpages.
> However, I noticed that in
> http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man3/Ne
> t::SSH::Perl.3pm that $ssh->login() requires a password that you aren't
> supplying:
>
> $ssh->logi
Wiggins D'Anconia wrote:
>> my %params = {
>> protocol => 2,
>> interactive => 1,
>> identity_files =>[EMAIL PROTECTED],
>> };
>
> Right here you are assigning a hash reference to a hash, which is
> essentially setting a key using the reference location with a value as
> undef. Then y
Hi all!
I believe learn.perl.org is very lacking:
1. Its design is ugly.
2. No links to many important online resources such as tutorials, books,
article collections, mailing lists, web forums, etc.
3. Concentration on commercial books.
4. No source code for the site is available and [EMAIL P
Tn wrote:
> Hi,
>
> As far as I can tell you are doing it right according to the manpages.
> However, I noticed that in
> http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man3/Ne
> t::SSH::Perl.3pm that $ssh->login() requires a password that you aren't
> supplying:
>
> $ssh->logi
Wiggins D'Anconia wrote:
>> my %params = {
>> protocol => 2,
>> interactive => 1,
>> identity_files => [EMAIL PROTECTED],
>> };
>
> Right here you are assigning a hash reference to a hash, which is
> essentially setting a key using the reference location with a value as
> undef. Then
61 matches
Mail list logo