Re: import() functions from another module

2005-03-31 Thread JupiterHost.Net
Assuming that your import() does what you think it does--and I don't have time to test it, but as long as you're USEing it anyway, why not just write a wrapper instead of the pass-the-import nonsense--you Because then I have to add and manage a wrapper for each new function and keep up with the pa

Re: Database -> Excel

2005-03-31 Thread Lawrence Statton
> I see a whole passle of Excel modules on CPAN. I am querying an Oracle > database and I want to save that query into an Excel file. What module > would you suggest that I use? > > Robert > It is like three minutes of work using Spreadsheet::WriteExcel -- -- -- -- -- -- -- -- -- -- -- -- --

Database -> Excel

2005-03-31 Thread Robert
I see a whole passle of Excel modules on CPAN. I am querying an Oracle database and I want to save that query into an Excel file. What module would you suggest that I use? Robert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: New to CGI.pm

2005-03-31 Thread Jeff Borders
That's correct. I'm not using POST, GET, or COOKIE. I haven't thought about it being multi-user. It's really just for me and maybe a few others. Please understand, I'm a newbie. If there is a better way, and I'm sure there is, enlighten me. I'll try it if my skills permit. -jb On Thu, 2005-

Re: Attempting OO with Perl - New() method in subclass not working

2005-03-31 Thread Jeff 'japhy' Pinyan
On Mar 31, [EMAIL PROTECTED] said: When I try to assign values to the DBLogon object's attributes, I get the following error: "Can't access 'USERID' field in object of class DBLogon at testdblogon.pl line 7". What am I missing? The problem is that Logon's new() method is calling LogonDB's _init()

Re: quick regex question

2005-03-31 Thread John W. Krahn
Offer Kaye wrote: On Thu, 31 Mar 2005 13:43:14 -0800, John W. Krahn wrote: Ah, but there is an important difference - in all the cases I wrote, the characters following the '@' sign could not be a legal variable name, $ perl -le' @) = qw/ a b c d /; print for @) ' Educational thread, this :-) perld

Attempting OO with Perl - New() method in subclass not working

2005-03-31 Thread Brad.Carlson
I am trying to build an inheritable object, and I am using examples from the Perl Cookbook, 2nd edition, mostly Recipe 13.1, using the new and _init methods. I created a base class Logon and a subclass called DBLogon, in files Logon.pm and DBLogon.pm, respectively. All referenced files are copi

Re: quick regex question

2005-03-31 Thread Offer Kaye
On Thu, 31 Mar 2005 13:43:14 -0800, John W. Krahn wrote: > > Ah, but there is an important difference - in all the cases I wrote, > > the characters following the '@' sign could not be a legal variable > > name, > > $ perl -le' @) = qw/ a b c d /; print for @) ' Educational thread, this :-) > >

Re: apache log parsing

2005-03-31 Thread John W. Krahn
John wrote: hello Hello, I want to split the datetime of apache log i tried this code with no success @fields=split(/[/:]/, $datetime); ### DD/MM/:HH:MM:SS has anyone tried anything like that? my @fields = $datetime =~ /\d+/g; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EM

Re: quick regex question

2005-03-31 Thread John W. Krahn
Offer Kaye wrote: On Thu, 31 Mar 2005 12:16:21 -0800, John W. Krahn wrote: And yet in your examples you use @ in double quoted strings four times without escaping it (hint: m// and s/// interpolate like double quoted strings.) Ah, but there is an important difference - in all the cases I wrote, th

Re: quick regex question

2005-03-31 Thread Offer Kaye
On Thu, 31 Mar 2005 12:16:21 -0800, John W. Krahn wrote: > > Using the same regular expression twice is redundant. > 1 while $str =~ s/(?<=\@)(.+?)_/$1./; > Beautiful! But also a bit mind bending. I see code like this and I think - "too clever". It's not easy, I think, to understand at once what

Re: Simple encoding function

2005-03-31 Thread John W. Krahn
Ing. Branislav Gerzo wrote: John W. Krahn [JWK], on Thursday, March 31, 2005 at 01:56 (-0800) has on mind: JWK> Two different digits are converted to 0? JWK> The same digit is converted to two different values? qood questions; ok, I changed @chars to: my @chars = ( 0 .. 9 ); now here is list of res

Re: New to CGI.pm

2005-03-31 Thread toolscripts
Sorry if I'm not totally clear on this myself, but are you saying you are trying to use it without POST, GET or COOKIE usage? The solution might be to use a file named based on the user's ip. --t - Original Message - From: "Jeff Borders" <[EMAIL PROTECTED]> To: Sent: Thursday, March 31

Re: import() functions from another module

2005-03-31 Thread Joshua Colson
On Thu, 2005-03-31 at 12:41 -0600, JupiterHost.Net wrote: > Hello, > > I am working on a module that needs to import a function from > Digest::MD5. The reasoning on this is that its a subclass so it'd be > handy to be able to use() it and export functions from the parent module > without having

Re: My own die message

2005-03-31 Thread Chris Devers
On Thu, 31 Mar 2005, Randal L. Schwartz wrote: > > "Chris" == Chris Devers <[EMAIL PROTECTED]> writes: > > Chris> Fine then. > > Chris> eval { > Chris> risky_action(); > Chris> } > > You forgot a semicolon here, which will make Perl start to think you > mean this to be an "

New to CGI.pm

2005-03-31 Thread Jeff Borders
I've written a perl program to quiz myself using a simple text file as input. Input file: answer = question answer = question etc... When I try to convert this program to a cgi program to use from a web browser, it will not pass the parameters back to the program after drawing the page. I've tr

Re: quick regex question

2005-03-31 Thread Jeff 'japhy' Pinyan
On Mar 31, Ramprasad A Padmanabhan said: $str = "[EMAIL PROTECTED]"; Should become [EMAIL PROTECTED] I'd use index() and substr(): if ((my $p = index($str, '@')) > -1) { substr($str, $p) =~ tr/_/./ } -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734

Re: quick regex question

2005-03-31 Thread John W. Krahn
Offer Kaye wrote: Here are 2 other methods, just for the heck of it :-) # Method 1 my $str = '[EMAIL PROTECTED]'; my ($part1,$part2) = split /@/, $str; $part2 =~ s/_/./g; $str = $part1."@".$part2; print "$str\n"; # Method 2 my $str = '[EMAIL PROTECTED]'; while ($str =~ m/(?<=@).+?_/) { $str =~ s

Re: My own die message

2005-03-31 Thread Randal L. Schwartz
> "Chris" == Chris Devers <[EMAIL PROTECTED]> writes: Chris> On Thu, 31 Mar 2005, Ankur Gupta wrote: >> No I do not [want to] die so fast.. I want to do some processing based >> on the died message. Chris> Fine then. Chris> eval { Chris> risky_action(); Chris> } You forgot

Re: Changing euid & egid of a perl process at runtime

2005-03-31 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Hi, Hello, I want my script started as "root" to run as user "postfix". How do I change the uid & gid of the process unless ( $< ) { $> = getpwnam 'postfix'; $) = getgrnam 'postfix'; } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [E

Re: Redirect on the pushing button

2005-03-31 Thread Dave Gray
> You can do this in perl by sending a Location header back to the > browser before you send Content-type a la: > > #!/usr/bin/perl > use strict; > use warnings; > use CGI; > use CGI::Carp 'fatalsToBrowser'; > > my $cgi = new CGI; > my $form = $cgi->Vars; > > if ($form->{no}) { > print "Locati

Re: Redirect on the pushing button

2005-03-31 Thread Dave Gray
> I am create edit data form, and it ask visitor: "do you wish edit data?" > All is ok with Yes button, but I don't kniw what with No button :-) > I wish that clicking NO button recirect me on some URL.. You can do this in perl by sending a Location header back to the browser before you send Conte

Redirect on the pushing button

2005-03-31 Thread Maxipoint Rep Office
I am create edit data form, and it ask visitor: "do you wish edit data?" All is ok with Yes button, but I don't kniw what with No button :-) I wish that clicking NO button recirect me on some URL.. Any help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

import() functions from another module

2005-03-31 Thread JupiterHost.Net
Hello, I am working on a module that needs to import a function from Digest::MD5. The reasoning on this is that its a subclass so it'd be handy to be able to use() it and export functions from the parent module without having to add a sub foo { Parent::foo(@_) } line or similar (IE using GLOBs)

new line "\n" for print file

2005-03-31 Thread Brian Volk
Hello, Can someone explain how I can add "\n" to this line of code If that is really my problem.. :~) copy ($print_file, '//hp-exch/HP4100-IS'); The reason I ask is here's what I'm printing; (teminal veiw) --begin Green Solutions Industrial Cleaner is a non-toxic, heavy-duty produc

Re: apache log parsing

2005-03-31 Thread John Doe
Am Donnerstag, 31. März 2005 15.36 schrieb John: [...] Hi John > I found the a module Apache::Regexp can parse apache logs > but i am afraid it cannot output statistics just does what > i am trying to do subsrt the datetime, hosts, etc. There exist some apps to make statistics from apache logs,

Changing euid & egid of a perl process at runtime

2005-03-31 Thread Ramprasad A Padmanabhan
Hi, I want my script started as "root" to run as user "postfix". How do I change the uid & gid of the process Thanks Ram -- Netcore Solutions Pvt. Ltd. Website: http://www.netcore.co.in Spamtraps: http://cleanmail.netcore.co.in/direct

Re: quick regex question

2005-03-31 Thread Abhishek Dave
just another method $str = q/[EMAIL PROTECTED]/; if ($str=~ /(\S*)(\@)(\S*)/) { $s=$3; $s=~tr|_|.|; $str=$1.$2.$s; } abhi - Original Message - From: "Ramprasad A Padmanabhan" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "perl beginners" Sent: Thursday, March 31, 2005 3:13 PM Subj

Re[2]: apache log parsing

2005-03-31 Thread John
From: John Doe <[EMAIL PROTECTED]> To: beginners@perl.org Date: Thursday, March 31, 2005, 2:24:24 PM Subject: apache log parsing Thursday, March 31, 2005, 2:24:24 PM, you wrote: > Am Donnerstag, 31. März 2005 11.08 schrieb John: >> hello >> >> I want to split the datetime of apache log >>

RE: Question: Array of Hashes

2005-03-31 Thread Olivier, Wim W
Thanks Offer! It's working! Wim -Original Message- From: Offer Kaye [mailto:[EMAIL PROTECTED] Sent: 31 March 2005 02:55 PM To: Perl Beginners Subject: Re: Question: Array of Hashes On Thu, 31 Mar 2005 14:40:47 +0200, Olivier, Wim W wrote: > Hi all, > > I have the following code belo

Re: Question: Array of Hashes

2005-03-31 Thread Offer Kaye
On Thu, 31 Mar 2005 14:40:47 +0200, Olivier, Wim W wrote: > Hi all, > > I have the following code below which I need to modify a bit. > > The script currently lists the key/value pairs for all processes in the > system. > What I need to achieve is for it to only list the key/value pairs for > pro

Question: Array of Hashes

2005-03-31 Thread Olivier, Wim W
Hi all, I have the following code below which I need to modify a bit. The script currently lists the key/value pairs for all processes in the system. What I need to achieve is for it to only list the key/value pairs for processes of which the "Description" key is of a certain ASCII value, say "an

Re: apache log parsing

2005-03-31 Thread Offer Kaye
On Thu, 31 Mar 2005 13:24:24 +0200, John Doe wrote: > > [2] use another "delimiter" (don't know the english term at the moment) > "Delimiter" is the correct term. See "perldoc perlop", the beginning of the section titled "Quote and Quote-like Operators". -- Offer Kaye -- To unsubscribe, e-mail

Re: quick regex question

2005-03-31 Thread Offer Kaye
On Thu, 31 Mar 2005 02:08:22 -0800, John W. Krahn wrote: > > $ perl -le' > my $str = q/[EMAIL PROTECTED]/; > $str =~ s/([EMAIL PROTECTED])/($a = $1) =~ tr|_|.|; $a/e; > print $str; > ' > [EMAIL PROTECTED] > > $ perl -le' > my $str = q/[EMAIL PROTECTED]/; > substr( $str, index $str, q/@/ ) =~ tr/_

Re: apache log parsing

2005-03-31 Thread John Doe
Am Donnerstag, 31. März 2005 11.08 schrieb John: > hello > > I want to split the datetime of apache log > > i tried this code with no success > > @fields=split(/[/:]/, $datetime); ### DD/MM/:HH:MM:SS > > has anyone tried anything like that? Always use "use strict; use warnings" in your code -

Re: Simple encoding function

2005-03-31 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Thursday, March 31, 2005 at 01:56 (-0800) has on mind: JWK> Two different digits are converted to 0? JWK> The same digit is converted to two different values? qood questions; ok, I changed @chars to: my @chars = ( 0 .. 9 ); now here is list of results: 0 = 0 9 = 9 10

Re: quick regex question

2005-03-31 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: Hi, Hello, I want to run a substitution for all instances of "_" with "." after '@' in a string but "_" before "@" should not be touched. eg $str = "[EMAIL PROTECTED]"; Should become [EMAIL PROTECTED] $ perl -le' my $str = q/[EMAIL PROTECTED]/; $str =~ s/([EMAI

Re: Simple encoding function

2005-03-31 Thread John W. Krahn
Ing. Branislav Gerzo wrote: John W. Krahn [JWK], on Wednesday, March 30, 2005 at 12:56 (-0800) thoughtfully wrote the following: JWK> You could use the Math::BaseCalc module: JWK> http://search.cpan.org/~kwilliams/Math-BaseCalc-1.011/ thanks, it is nice module, really easy to use. And also thanks t

quick regex question

2005-03-31 Thread Ramprasad A Padmanabhan
Hi, I want to run a substitution for all instances of "_" with "." after '@' in a string but "_" before "@" should not be touched. eg $str = "[EMAIL PROTECTED]"; Should become [EMAIL PROTECTED] Any suggestions Thanks Ram -- Netco

apache log parsing

2005-03-31 Thread John
hello I want to split the datetime of apache log i tried this code with no success @fields=split(/[/:]/, $datetime); ### DD/MM/:HH:MM:SS has anyone tried anything like that? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: t/ framework

2005-03-31 Thread John W. Krahn
Manish Sapariya wrote: Hi there, Hello, I frequently come across this "module uses the t/ framework". What its all about? What functionality does it provide? perldoc ExtUtils::MakeMaker::Tutorial t/ Tests for your modules go here. Each test filename ends with a .t. So t/foo.t.

t/ framework

2005-03-31 Thread Manish Sapariya
Hi there, I frequently come across this "module uses the t/ framework". What its all about? What functionality does it provide? Thanks, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]