RE: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread Manav Mathur
|-Original Message- |From: John Doe [mailto:[EMAIL PROTECTED] |Sent: Tuesday, May 03, 2005 1:50 AM |To: beginners@perl.org |Subject: Re: Translate standard date/time format to EPOCH seconds | | |Am Montag, 2. Mai 2005 19.52 schrieb Charles K. Clarkson: |> [EMAIL PROTECTED]

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread John Doe
Am Dienstag, 3. Mai 2005 03.30 schrieb [EMAIL PROTECTED]: > > * If the format of all your data lines is "consistent", you could use > > split > > > on \s+ to get the data fields instead of a tr/m cascade. > > > > * Then, if I understand you correctly, you wantto build a hash with % > > keys > > > a

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread DBSMITH
> * If the format of all your data lines is "consistent", you could use split > on \s+ to get the data fields instead of a tr/m cascade. > > * Then, if I understand you correctly, you wantto build a hash with % keys > and F... values. This could be done with code like > > push @{$lookup_hash{$pct_v

propagated error reporting

2005-05-02 Thread Peter Rabbitson
Hello everyone, I once again have a broad question about implementing a certain capability. Consider we have the following: main program -> uses modules A & B | | execute exported sub from A (A uses C & D) | | | execute exported sub from C

import data to Excel Template

2005-05-02 Thread Brian Volk
Hi All, I have been reading Spreadsheet::ParseExcel and I see how to get information from an Excel file but I don't see how to import data. I have an Excel template which uses macros and I want to import a tab delimited file. Can someone pls suggest which module\s to use... I will be

Passing variable to second file

2005-05-02 Thread John Bruin
I have a script that is divided into 2 files for manageability. Each is about 700 lines in length and the second file is called using the 'Require' method. Is there an easy way of passing a variable from the first file to the second? Or should I be looking at using @Export or something similar? T

Re: PDF::ReportWriter not writing headers on first page

2005-05-02 Thread Daniel Kasak
radhika wrote: >Hi, >Has anyone experienced this before? >I am using PDF::ReportWriter and have defined my field as such: > >my $fields = [ > >{ >name=> "Firm Name", >percent => 25, >font_size => 12, >align => "left", >}, > >a

Re: hash de-ref?

2005-05-02 Thread Chris Devers
On Mon, 2 May 2005, Paul Kraus wrote: > Can someone for the sake of discussion give an example of why you > would want to use a slice of a hash? Quoting from _Learning Perl_: In a way exactly analogous to an array slice, we can also slice some elements from a hash in a hash slice. Rememb

Re: hash de-ref?

2005-05-02 Thread Paul Kraus
> use strict; use warnings; > my %h=(qw/a aa b bb c cc d dd e ee f ff/); > print "interesting values: ", join ", ", @h{qw/ a d f/}; Wow very usefull thanks. Its amazing how we can get stuck using the same functions or methods to write code and ignore others simply because we have never had a "need"

Re: hash de-ref?

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 22.24 schrieb Paul Kraus: > > > if ((@{$info{$loggedin}}{cell}) and > > > (@{$info{$loggedin}}{line} eq 'dc')) > > > > The person who wrote that is using a hash slice. That would more > > correctly be written as: > > > > if ( $info{$loggedin}{cell} and $inf

PDF::ReportWriter not writing headers on first page

2005-05-02 Thread radhika
Hi, Has anyone experienced this before? I am using PDF::ReportWriter and have defined my field as such: my $fields = [ { name=> "Firm Name", percent => 25, font_size => 12, align => "left", }, and so on. The headers are dis

Re: hash de-ref?

2005-05-02 Thread Paul Kraus
> > if ((@{$info{$loggedin}}{cell}) and > > (@{$info{$loggedin}}{line} eq 'dc')) > The person who wrote that is using a hash slice. That would more correctly be > written as: > > if ( $info{$loggedin}{cell} and $info{$loggedin}{line} eq 'dc' ) Why would you want to use a slice o

Re: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 19.52 schrieb Charles K. Clarkson: > [EMAIL PROTECTED] wrote: > : Again, I cannot use a module in this situation due to limitations of > : the runtime environment. > > Well. you could find a module that does what you want. Then lift > out those

Re: hash de-ref?

2005-05-02 Thread John W. Krahn
Matthew Sacks wrote: I am reading somebody else's code, always a good learning process. The code is about a telephone contact list. The intent of this line of code is clear: 'does the logged in person have a cell phone, and does the cell phone have the attribute line=dc' There is one confusing ste

Re: hash de-ref?

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 21.27 schrieb Matthew Sacks: Hi Matthew, it seems indeed strange... > I am reading somebody else's code, always a good learning process. The code > is about a telephone contact list. The intent of this line of code is > clear: 'does the logged in person have a cell phone,

Re: What does "use vars '@ISA';@ISA = 'LWP::UserAgent';my $agent = __PACKAGE__->new;"

2005-05-02 Thread Chris Devers
On Mon, 2 May 2005, Siegfried Heintze wrote: > What the heck is going on here? I understand the "use" statements, but the > subsequent statements baffle me. It looks to me like the LWP::UserAgent module is being subclassed. The other way to do this would be to write a proper package declaration

Re: hash de-ref?

2005-05-02 Thread Paul Kraus
> a) $loggedin is scalar True > b) $loggedin is used as a hash key True > c) info is a hash True > d) since we retrieve on thing from the hash, there is a '$' in front of info Since you are refering to one element of the hash there is a $. > e) $info{$loggedin} is enclosed inside @{} True > f) @

What does "use vars '@ISA';@ISA = 'LWP::UserAgent';my $agent = __PACKAGE__->new;"

2005-05-02 Thread Siegfried Heintze
Can someone help me understand Lincoln Stein's code I found in his book on network programming with perl? This is the beginning of a screen scraper. I thought ISA was an array of ancestors used exclusively for defining descendant classes. I guess I'm wrong. What the heck is going on here? I un

hash de-ref?

2005-05-02 Thread Matthew Sacks
I am reading somebody else's code, always a good learning process. The code is about a telephone contact list. The intent of this line of code is clear: 'does the logged in person have a cell phone, and does the cell phone have the attribute line=dc' There is one confusing step in the syntax:

Re: Perl - Windows XP Pro - Perl Scripts Seem to hang until the enter key is pressed

2005-05-02 Thread Paul Kraus
On 5/2/05, Paul Kraus <[EMAIL PROTECTED]> wrote: > Most if not all of my perl scripts have a tendency to just hang. No > errors. Not locked up. Hitting the enter keys seems to bring them > back. > Attached is a little test script that is very basic but demonstrates > this. Perhaps it is something o

Perl - Windows XP Pro - Perl Scripts Seem to hang until the enter key is pressed

2005-05-02 Thread Paul Kraus
Most if not all of my perl scripts have a tendency to just hang. No errors. Not locked up. Hitting the enter keys seems to bring them back. Attached is a little test script that is very basic but demonstrates this. Perhaps it is something on my system but its a real pain in the but. I have other v

RE: expensive loops

2005-05-02 Thread Charles K. Clarkson
Chris Knipe wrote: : open (LOG, '<'.LogFile); Is this a typo? You're working on SQUIDLOG below. LogFile is not in quotes. That should raise an error. : for (;;) { : while () { : # Do stuff here : } : } : } : : : This is unfortunately

Re: expensive loops

2005-05-02 Thread Chris Knipe
Thanks, seems to be doing the trick :) Very nice module indeed... -- Chris. I love deadlines. I especially love the whooshing sound they make as they fly by..." - Douglas Adams, 'Hitchhiker's Guide to the Galaxy' - Original Message - From: "Joshua Colson" <[EMAIL PROTECTED]> To: "Chris K

RE: Translate standard date/time format to EPOCH seconds

2005-05-02 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : Again, I cannot use a module in this situation due to limitations of : the runtime environment. Well. you could find a module that does what you want. Then lift out those subs and put them in your script. HTH, Charles K. Clarkson -- M

Help with SOAP-Lite request in Perl

2005-05-02 Thread Grant
Hello, I'm trying to make a successful request to the Google AdWords API. My Perl skills are extremelly weak. Here's the error I'm getting: SOAP Fault: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. I'm

Re: expensive loops

2005-05-02 Thread Chris Knipe
Because I need to do it similarly to tail. using just the while, the loop will exit at the end of the file. I need it to wait at the end of the file untill new data is appended to the end of it. -- Chris. I love deadlines. I especially love the whooshing sound they make as they fly by..." - Dou

expensive loops

2005-05-02 Thread Chris Knipe
Hi, open (LOG, '<'.LogFile); for (;;) { while () { # Do stuff here } } } This is unfortunately very expensive on my CPU. Are there any better ways to go about this??? tail comes to mind, but I'd prefer to do this all in perl. -- Chris. I love deadlines. I especially love the whoo

Re: How to call ancestor's constructor?

2005-05-02 Thread Wiggins d'Anconia
Siegfried Heintze wrote: > I'm trying to write a screen scraper and I need to use inheritance > (according to a response to an earlier post). > > > > Here is the original piece of code: > > > > my $parser = HTML::Parser->new(api_version => 3); > > > > Now how do I change this so it i

Re: perl module to create pdf reports

2005-05-02 Thread radhika
> As far as free solutions, the Big Badass is PDF::API2. There are many > users, > a zillion modules, and a mailing list. There are several modules that > are > built on top of this, to relieve the difficulty of using it. I'm not so > sure they > make sense to use. > Mike, Thanks. I am looking in

Translate standard date/time format to EPOCH seconds

2005-05-02 Thread jason_normandin
Good morning All. I am looking for a way to translate date/timestamps in various formats to EPOCH seconds without using a module (cannot use a module in this situation other then the standard modules installed with Perl). I am going to create a subroutine and parse the date/timestamp passed int

Re: Password

2005-05-02 Thread José J. Cintrón
Change your line to ... perl -p -i -e "s/username\/password as SYSOPER/username\/# as SYSOPER/g" test1.dat Rentachintala, Jagan wrote: Hi, I am getting the following error. Do you have any idea? Can't do inplace edit without backup. Thanks Jagan Rentachintala | Consultant | Idea Integration |

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread John W. Krahn
John Doe wrote: Am Montag, 2. Mai 2005 03.49 schrieb [EMAIL PROTECTED]: John, the reg exp s <-+> (); ^ was changed to y/sg//;; y/-//d; s{\w+} (); to exclude the spaces and use y... thx why are thre operators y or tr more efficient since these operato

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: John, the reg exp s <-+> (); ^ was changed to y/sg//;; y/-//d; s{\w+} (); to exclude the spaces and use y... thx why are thre operators y or tr more efficient since these operators do not use pattern matching? Originally

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 09.44 schrieb John Doe: > Am Montag, 2. Mai 2005 03.49 schrieb [EMAIL PROTECTED]: > > John, > > > > the reg exp s <-+> (); > >^ > > was changed to > > > > y/sg//;; > > y/-//d; > > s{\w+} (); > > to exclude the spaces and u

Re: populating a hash with % used as the key and F string as the value

2005-05-02 Thread John Doe
Am Montag, 2. Mai 2005 03.49 schrieb [EMAIL PROTECTED]: > John, > > the reg exp s <-+> (); >^ > was changed to > > y/sg//;; > y/-//d; > s{\w+} (); > to exclude the spaces and use y... thx > why are thre operators y or tr more efficient since the