Re: Exported Vars

2002-08-26 Thread Janek Schleicher
Connie Chan wrote at Tue, 27 Aug 2002 00:40:26 +0200: > package A; > use strict; > require Exporter; > our @ISA = qw (Exporter); # What this actually for ?! > our @EXPORT = qw (%hash); > our %hash ; > > ... > My question is, will perl re- assign the hash whenever > a 'use package A' declared ?

Re: perl interpreter

2002-08-26 Thread Paul Johnson
On Tue, Aug 27, 2002 at 12:14:17AM -0700, Mark Goland wrote: > Hi guys, > > I was just wondering is there a perl interpreter that will fit on one floppy > disk ?? The perl binary itself will, but you'll probably need various modules to make it useful. -- Paul Johnson - [EMAIL PROTECTED] http:

Re: Best way to save nested data structure.

2002-08-26 Thread Sudarshan Raghavan
On Mon, 26 Aug 2002, Rowan Reid wrote: > > > I'm learning as best I can using every book orielly makes. I am trying > to saved a complex data structure (hash). I'm trying to use Berkly > DBFile and tie. I am unable to store the file ie retrieve info once I > have exited the program. Once I ti

perl interpreter

2002-08-26 Thread Mark Goland
Hi guys, I was just wondering is there a perl interpreter that will fit on one floppy disk ?? mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Getopt::Long option prefix

2002-08-26 Thread Karl Kaufman
Hi David, >From what I've seen, Getopt::Long default behavior is to accept either '--opt|-opt'. (Tested on Solaris 2.6 w/ Perl 5.005_03) test.pl #!/usr/local/bin/perl use strict; use diagnostics; use Getopt::Long; my %pagerdest = (); Getopt::Long::Configure('default'); GetOptions(

Re: Exported Vars

2002-08-26 Thread drieux
On Monday, August 26, 2002, at 03:40 , Connie Chan wrote: > package A; > use strict; > require Exporter; > our @ISA = qw (Exporter); # What this actually for ?! One way to think of this as a way of stopping the questions about 'isa' - cf perldoc UNIVERSAL In this case it is an Exporter

Re: Having problems with AppConfig::Getopt module

2002-08-26 Thread david
Karl Kaufman wrote: >> For example: >> >> # test.pl -pagerdest [EMAIL PROTECTED] is the above another typo? should it be: test.pl --pagerdest [EMAIL PROTECTED] you seem to have only one '-' in front of pagerdest? Getopt::Long uses '--' not '-' david -- To unsubscribe, e-mail: [EMAIL PROT

Re: Having problems with AppConfig::Getopt module

2002-08-26 Thread Karl Kaufman
David, You caught my typo in my email -- the braces should have been parens. Unfortunately, that was just a typed-in example, and the original problem remains: AppConfig::Getopt cannot handle hashes passed on the command-line. Regs, Karl K. - Original Message - From: david To: [EMAIL P

Re: Exported Vars

2002-08-26 Thread david
Connie Chan wrote: > In package A, I did sth like this : > > package A; > use strict; > require Exporter; > our @ISA = qw (Exporter); # What this actually for ?! Exporter provides an easy way for you to make your module's variables and functions available for another package to use. the: our

Re: MIME::Lite 'Datestamp' problem -- truncating timezone? (UT instead of UTC)

2002-08-26 Thread Kevin Meltzer
UT (Universal Time) is a valid TZ. It is the same as UTC and GMT. So, treat it as if it is GMT when parsing. Smart mail clients don't always use the abbreviation, and use the offset (the -0500 bit). So, sending as UT is perfectly valid, although not always the best way to do it. You can set the

Best way to save nested data structure.

2002-08-26 Thread Rowan Reid
I'm learning as best I can using every book orielly makes. I am trying to saved a complex data structure (hash). I'm trying to use Berkly DBFile and tie. I am unable to store the file ie retrieve info once I have exited the program. Once I tie a hash toe the file access the contents should be

Re: Regexp

2002-08-26 Thread david
John W. Krahn wrote: > > Time to learn how to copy and paste in X, I think... :-) > Thanks but i *think* i know how to copy and paste in X :o but then why am i still struggling copying from KNote to vim... since this is off topic a bit, let's kill it now. otherwise, the list master might not

Exported Vars

2002-08-26 Thread Connie Chan
In package A, I did sth like this : package A; use strict; require Exporter; our @ISA = qw (Exporter); # What this actually for ?! our @EXPORT = qw (%hash); our %hash ; # code code code code and code . # Do sth to assign values for %hash anyway 1; Then , in the main script, I will use A,

Re: Regexp

2002-08-26 Thread John W. Krahn
Robin Norwood wrote: > > david <[EMAIL PROTECTED]> writes: > > > Felix Geerinckx wrote: > > > > > > Now you're talking. > > > But just for the fun of it, run the benchmark again with the OP's original > > > (much longer) string ... ;-) > > > > > > > i will do that a bit later. :-) busy doing som

Re: Having problems with AppConfig::Getopt module

2002-08-26 Thread david
i have never used AppConfig::Getopt before... Karl Kaufman wrote: > For example: > > # test.pl -pagerdest [EMAIL PROTECTED] > > Should result in: > > %pagerdest = { > 'karl' => '[EMAIL PROTECTED]' > }; but are you sure you mean that? it means it should assign a hash reference to

MIME::Lite 'Datestamp' problem -- truncating timezone? (UT instead of UTC)

2002-08-26 Thread Karl Kaufman
Hello, I'm trying to determine whether there's a problem with the MIME::Lite module. I've sent an email to the module's author, but haven't heard back. Is there a "bugs" mailing list somewhere that I can post the following info to, in order to get verification and facilitate a fix. (It's my opi

Having problems with AppConfig::Getopt module

2002-08-26 Thread Karl Kaufman
Hello, I'm trying to use the 'AppConfig::Getopt' module to parse my command-line arguments, assigning the passed values to a hash. It's not working. And I need help. For example: # test.pl -pagerdest [EMAIL PROTECTED] Should result in: %pagerdest = { 'karl' => '[EMAIL PROTECTED]'

Re: Regexp

2002-08-26 Thread David Zhuo
thanks for providing the stat. it's very nice. unfortunately, i use vi exclusively and don't like to touch Emacs at all :-) david On Mon, 2002-08-26 at 14:18, Robin Norwood wrote: > david <[EMAIL PROTECTED]> writes: > > > Robin Norwood wrote: > > > From david's headers: > > > > > > User-Agent

Re: Regexp

2002-08-26 Thread david
Felix Geerinckx wrote: > > Now you're talking. > But just for the fun of it, run the benchmark again with the OP's original > (much longer) string ... ;-) > testing result for a longer string(i use the one from the OP).i add a few new lines to make it more readable: Benchmark: timing 99 ite

Re: Regexp

2002-08-26 Thread Robin Norwood
david <[EMAIL PROTECTED]> writes: > Robin Norwood wrote: > > From david's headers: > > > > User-Agent: KNode/0.7.1 > > > > Time to change news readers, I think... :-) > > > > -RN > > > > just curious. what news reader you guys are using? [rnorwood@robin perl-beginners]$ perl -le 'my %r;whil

Re: Regexp

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 20:46:49 GMT, David wrote: > Robin Norwood wrote: >> From david's headers: >> >> User-Agent: KNode/0.7.1 > > just curious. what news reader you guys are using? > > david >From my headers: User-Agent: Xnews/5.02.24 (That's on win32. If you're on Linux, you may want to gi

Re: Regexp

2002-08-26 Thread david
Robin Norwood wrote: > From david's headers: > > User-Agent: KNode/0.7.1 > > Time to change news readers, I think... :-) > > -RN > just curious. what news reader you guys are using? david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regexp

2002-08-26 Thread David Zhuo
yeah, i know. :-) as soon as i have time... david > >From david's headers: > > User-Agent: KNode/0.7.1 > > Time to change news readers, I think... :-) > > -RN > > -- > > Robin Norwood > Red Hat, Inc. > > "The Sage does nothing, yet nothing remains undone." > -Lao Tzu, Te Tao Ching -- T

Re: Regexp

2002-08-26 Thread Robin Norwood
david <[EMAIL PROTECTED]> writes: > Felix Geerinckx wrote: > > > > Now you're talking. > > But just for the fun of it, run the benchmark again with the OP's original > > (much longer) string ... ;-) > > > > i will do that a bit later. :-) busy doing something else... > yes, the reason why the st

Re: Regexp

2002-08-26 Thread david
Felix Geerinckx wrote: > > Now you're talking. > But just for the fun of it, run the benchmark again with the OP's original > (much longer) string ... ;-) > i will do that a bit later. :-) busy doing something else... yes, the reason why the string is much shorter is becasue i am lazy to type...

Re: Regexp

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 19:53:44 GMT, David wrote: > Felix Geerinckx wrote: > >> If you claim something is faster, prove it ;-) >> (But remember, the OP wanted the result in $_). >> > > i only suggest that it might be faster. :-) > i won't go into too much detail to try to prove that. i only ran t

Re: Regexp

2002-08-26 Thread david
Felix Geerinckx wrote: > on Mon, 26 Aug 2002 19:01:27 GMT, David wrote: > >> Felix Geerinckx wrote: > >>> s/.*\[uuid (.*)\]/$1/; >> >> this might be a bit faster: >> >> /(\S+).$/ > > If you claim something is faster, prove it ;-) > (But remember, the OP wanted the result in $_). > i only s

Re: perlcc

2002-08-26 Thread drieux
On Monday, August 26, 2002, at 12:05 , <[EMAIL PROTECTED]> wrote: [..] > Has anyone experimented with perlcc? > > If so, any pointers to how it works will be appreciated. as of 5.6.1 the advice remains that it can make byte-code - and if you are lucky - it can generate code that is mostly like c

Re: perlcc

2002-08-26 Thread Paul Johnson
On Mon, Aug 26, 2002 at 03:05:26PM -0400, [EMAIL PROTECTED] wrote: > Hello, > > Has anyone experimented with perlcc? > > If so, any pointers to how it works will be appreciated. Presumably you've looked at perldoc perlcc. If you are talking about compiling to an executable, you basically have

Re: Regexp

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 19:01:27 GMT, David wrote: > Felix Geerinckx wrote: >> s/.*\[uuid (.*)\]/$1/; > > this might be a bit faster: > > /(\S+).$/ If you claim something is faster, prove it ;-) (But remember, the OP wanted the result in $_). -- felix -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: Regexp

2002-08-26 Thread david
Felix Geerinckx wrote: > on Mon, 26 Aug 2002 12:12:08 GMT, David Samuelsson wrote: > >> $_ comes in this form: >> >> servername:D:\CC_Storage\Views\EUSDNKG_Madeleine_Tae68_view.vws [uuid >> 74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b] >> >> i want $_ to be just the uuid number that is: >> 74a6b3b

perlcc

2002-08-26 Thread William.Ampeh
Hello, Has anyone experimented with perlcc? If so, any pointers to how it works will be appreciated. __ William -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Forking question.

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 18:21:16 GMT, David wrote: > another thing: >> while ( $#server_list > -1 ) { > > this might never be true. It's true for as long as there are elements in @server_list. It's equivalent to the (imho more readable) while (@server_list) { # do stuff

Re: should i switch to 5.8.0?

2002-08-26 Thread Paul Johnson
On Mon, Aug 26, 2002 at 09:22:25AM -0400, David T-G wrote: > Hi, all -- > > I see that 5.8 is out... Any thoughts on how stable it is and when we > might be likely to see 5.8.1 (not that perl every has any errors, even in > the code that's written to run under perl ;-) I'm debating whether or

Re: Forking question.

2002-08-26 Thread david
David wrote: > another thing: >> while ( $#server_list > -1 ) { > > this might never be true. i cut and paste too much! please ignore that! david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Forking question.

2002-08-26 Thread david
you have: > my $child_limit = 1; > my $child_pids = 0; > $SIG{CHLD} = \&CHILD_COUNT($child_limit); the $child_limit thingy is ignored by Perl. this means when Perl calls your CHIL_COUNT subroutine, the value of the variable $child_limit is not passed in to your subroutine. and then in the CHIL

Net::AIM

2002-08-26 Thread coe smythe
I relatively recently stumbled upon perl bots for aim, and figured i might as well try to write my own. However, my knowledge of perl is minimal, and I was looking for anyone with some familiarity to the module. In specific, right now I'm trying to get my bot to look at an incoming message, see

Re: AW: use Variable as a hashname?

2002-08-26 Thread david
since you said you have a list of routeres in @allmyrouters, i am assuming that they are stored in an array. if that the case, you can try: my @allmyrouters = ({'ip'=>'1.1.1.1', 'interface'=>'interface1', 'admin'=>'admin1'}, {'ip'=>'

Re: Regexp

2002-08-26 Thread Robin Norwood
"David Samuelsson (PAC)" <[EMAIL PROTECTED]> writes: > more regexps.. > > $_ comes in this form: > > servername:D:\CC_Storage\Views\EUSDNKG_Madeleine_Tae68_view.vws [uuid >74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b] > > i want $_ to be just the uuid number that is: >74a6b3b0.d1cd11d4.896e.00:

Re: Regexp

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 12:12:08 GMT, David Samuelsson wrote: > $_ comes in this form: > > servername:D:\CC_Storage\Views\EUSDNKG_Madeleine_Tae68_view.vws [uuid > 74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b] > > i want $_ to be just the uuid number that is: > 74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b

RE: Regexp

2002-08-26 Thread David . Wagner
Something along the line of: my $uuid ; if ( ! /\[uuid\s+([^\]]+)/ ) { # if no hit then do something # warn or die depending on what you expect } $uuid = $1; If you want $_ then you can do $_ = $uuid; Wags ;) -Original Messag

Weekly posting statistics - 34/2002

2002-08-26 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 34 of 2002. >From Monday 2002-08-19 to Sunday 2002-08-25 there were 466 articles posted (22566 lines) by 122 authors, giving an average 3.82 articles per author, and an average article length of 48 lpa. The average number of articles per day w

Regexp

2002-08-26 Thread David Samuelsson (PAC)
more regexps.. $_ comes in this form: servername:D:\CC_Storage\Views\EUSDNKG_Madeleine_Tae68_view.vws [uuid 74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b] i want $_ to be just the uuid number that is: 74a6b3b0.d1cd11d4.896e.00:b0:d0:83:b4:9b how do i get that the easiest way? all $_ are the same

perl version skew not a Safe problem? Re: Safe.pm

2002-08-26 Thread drieux
On Monday, August 26, 2002, at 02:51 , Avi Nehori wrote: [..] > when executing the main.pl > i get the error message: > > Can't load module Data::Dumper, dynamic loading not available in this > perl. > (You may need to build a new perl executable which either supports > dynamic loading or ha

RE: use Variable as a hashname?

2002-08-26 Thread Timothy Johnson
Here's one way to go about it. It sounds to me like an array of hashes will work just fine for you. Let's say you have an array: my @routers = (); You can do a push @routers,"stimpy"; to add a scalar to the end, but you can also add an entire hash indirectly by using hash references:

Re: What perl module converts unix time to regular time and date

2002-08-26 Thread drieux
On Monday, August 26, 2002, at 05:43 , FLAHERTY, JIM-CONT wrote: > What perl module converts unix time to regular time and date ? > > Thanks > Jim perldoc -f localtime vladimir: 76:] perl -e 'my @stuff=localtime ; print "@stuff\n";' 17 52 8 26 7 102 1 237 1 vladimir: 77:]perl -e '$thin

Re: Read file from second line

2002-08-26 Thread Q
Thank you Tanton, Felix; - Original Message - From: "Felix Geerinckx" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 26, 2002 5:32 PM Subject: Re: Read file from second line > on Mon, 26 Aug 2002 15:15:06 GMT, [EMAIL PROTECTED] (Q) wrote: > > > Apologies for such a

Re: Read file from second line

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 15:15:06 GMT, [EMAIL PROTECTED] (Q) wrote: > Apologies for such a 'lame' question but i read the FAQ on > http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq5-full.html > > How do i read on from the second line of a text file? You start reading from the first line but throw

Re: Read file from second line

2002-08-26 Thread Tanton Gibbs
>How do i read on from the second line of a text file? Just read in the first line and ignore it open FILE, "file.txt" or die "Could not open file.txt: $!\n"; my $first_line = ; # now FILE is at the second line. while( ) { # do your processing } Tanton -- To unsubscribe, e-mail: [EMAIL

Read file from second line

2002-08-26 Thread Q
Apologies for such a 'lame' question but i read the FAQ on http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq5-full.html How do i read on from the second line of a text file? thanks in advance ICQ : 165709889

Re: AW: use Variable as a hashname?

2002-08-26 Thread Dharmendra Rai
u r right felix. that was a typing error. nothing else. sorry for that - Get a bigger mailbox -- choose a size that fits your needs. http://uk.docs.yahoo.com/mail_storage.html

Re: Forking question.

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 14:15:02 GMT, [EMAIL PROTECTED] (Chad Kellerman) wrote: > I have been trying to work on a script that does forking. > But the script dies in the fork. Here is what I have: > [...] > my $child_limit = 1; > my $child_pids = 0; > $SIG{CHLD} = \&CHILD_COUNT($child_limit); Yo

RE: can't find eof on ebcdic file

2002-08-26 Thread Sean Rowe
I really appreciate this guys. Thanks! Sean -Original Message- From: Steve Grazzini [mailto:[EMAIL PROTECTED]]On Behalf Of Steve Grazzini Sent: Friday, August 23, 2002 6:55 PM To: [EMAIL PROTECTED] Subject: Re: can't find eof on ebcdic file John W. Krahn <[EMAIL PROTECTED]> wrote: > S

Forking question.

2002-08-26 Thread Chad Kellerman
Good morning, afternoon, night, I have been trying to work on a script that does forking. But the script dies in the fork. Here is what I have: I push some information about a server into an array. use POSIX "sys_wait_h"; my $child_limit = 1; my $child_pids = 0; $SIG{CHLD} = \&CHILD_

RE: looping issue

2002-08-26 Thread Winchester, Derek S (Derek)
Thanks Rob for your reply. I included the log to clarify. The way I want to script to run is that: 1) when $vr =2 the $vci and $vpi and the ip address should increment once. Then when $vr=3 then they should increment once again. In the log the vr waits till the ip address finishes incrementing and

should i switch to 5.8.0?

2002-08-26 Thread David T-G
Hi, all -- I see that 5.8 is out... Any thoughts on how stable it is and when we might be likely to see 5.8.1 (not that perl every has any errors, even in the code that's written to run under perl ;-) I'm debating whether or not to upgrade now... TIA & HAND :-D -- David T-G

Re: AW: use Variable as a hashname?

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 12:49:17 GMT, [EMAIL PROTECTED] (Dharmendra rai) wrote: > use foreach keys (%ur_hash_table) What is your point with this single line message? Do you realize that # WRONG foreach keys (%ur_hash_table) { # ... } is a syntax error? Did you test it? Perhaps

Re: What perl module converts unix time to regular time and date

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 12:43:17 GMT, [EMAIL PROTECTED] (Jim-Cont Flaherty) wrote: > What perl module converts unix time to regular time and date ? If you mean with 'unix time' seconds since epoch, and with 'regular time' year, month, day, hour, min and sec, you don't need a module. See

Re: AW: use Variable as a hashname?

2002-08-26 Thread Dharmendra Rai
use foreach keys (%ur_hash_table) - Get a bigger mailbox -- choose a size that fits your needs. http://uk.docs.yahoo.com/mail_storage.html

What perl module converts unix time to regular time and date

2002-08-26 Thread FLAHERTY, JIM-CONT
What perl module converts unix time to regular time and date ? Thanks Jim

Re: use Variable as a hashname?

2002-08-26 Thread Dharmendra Rai
hi , %my_hash=("f', 1, "s", 2, "t", 3); ### Take its reference $my_ref=\%my_hash; print $$my_ref{"f"}, "\n"; ### Here u r printing the value associated with key "f" of the hash-table using the ref #of that hash-table and refs r always scalar - Get

Re: AW: use Variable as a hashname?

2002-08-26 Thread Felix Geerinckx
on Mon, 26 Aug 2002 11:47:00 GMT, [EMAIL PROTECTED] (Angerstein) wrote: [blank lines trimmed] > It a little bit misunderstandable... > let´s say i got 100 hashes named after each of my routers. > a list auf my routeres is in @allmyrouters. > My hashes contains fileds: ip, interfaces, admin. So

Re: use Variable as a hashname?

2002-08-26 Thread doug
Here's one way: my %router = (); $router{"size"} = "big"; my $varname = "router"; eval < Hello, > can I / how can I use a variable as a hash name? > > $$myVar{key}? > > Thanxs! > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >

Re: use Variable as a hashname?

2002-08-26 Thread Dharmendra Rai
Connie, the query was abt ref of a hash . - Get a bigger mailbox -- choose a size that fits your needs. http://uk.docs.yahoo.com/mail_storage.html

Re: AW: use Variable as a hashname?

2002-08-26 Thread Dharmendra Rai
use foreach keys(%ur_hash) { do something; } - Get a bigger mailbox -- choose a size that fits your needs. http://uk.docs.yahoo.com/mail_storage.html

Re: use Variable as a hashname?

2002-08-26 Thread Connie Chan
$x = 'key'; %Y = (); $Y{$x} = 10; print $Y{key}; # You got 10; Rgds, Connie - Original Message - From: "Angerstein" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 26, 2002 7:33 PM Subject: use Variable as a hashname? > Hello, > can I / how can I use a variable

AW: use Variable as a hashname?

2002-08-26 Thread Angerstein
It a little bit misunderstandable... let´s say i got 100 hashes named after each of my routers. a list auf my routeres is in @allmyrouters. My hashes contains fileds: ip, interfaces, admin. I want to access each hashes field admin in a loop. How do i do that? > -Ursprüngliche Nachricht--

use Variable as a hashname?

2002-08-26 Thread Angerstein
Hello, can I / how can I use a variable as a hash name? $$myVar{key}? Thanxs! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Safe.pm

2002-08-26 Thread Avi Nehori
Hi, In general I'm trying to do something like that: 1. create a safe compartment . 2. inherit certain variables/methods and objects to the new compartment. 3. apply few limitations to the compartment. 4. execute code under the new compartment via safe rdo() method which can execute perl co