RE: Few Questions

2002-07-08 Thread Nikola Janceski

See in-line reply below

> -Original Message-
> From: William Black [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 12:04 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Few Questions
> 
> 
> 
> Hi all,
> 
> I have a few short questions:
> 
> First, How do you make an array of hashes and access them 
> once you have 
> created them.

This is a little difficult for a beginner but I will give you the basic
basics:
you have an array @a
now you want to have @a[0] have a hash of values:
@a[0] = ( key1 => value1,
key2 => value2 );

to get key1's value: @a[0]{key1}
now another way to add to it.

foreach my $key ( qw(key1 key2) ){
@a[1]{$key} = 100;
}

print "@a[1]{key2}\n"; ## will print 100;
print "@a[0]{key2}\n"; ## will print value2;

get it?

> 
> Next,How would email someone from within a perl pgm.  I want 
> to email more 
> than one person at the same time.  The script is running on a 
> unix box, but 
> the people receiving the emails can be on a differentOS(i.e 
> windows NT, 
> ETC).

use any of the following modules:
Net::SMTP
Mail::Sender
MIME::Entity

and for the TO or CC just separate the various e-mail with a comma (,):
[EMAIL PROTECTED], [EMAIL PROTECTED]

or

Got Jack <[EMAIL PROTECTED]>, Bill GotNone <[EMAIL PROTECTED]>





> 
> Thanks,
> 
> William Black
> 
> 
> 
> _
> Join the world's largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Few Questions

2002-07-08 Thread Nikola Janceski

OOOPPSSS... I forgot the $
see below


> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 12:17 PM
> To: 'William Black'; [EMAIL PROTECTED]
> Subject: RE: Few Questions
> 
> 
> See in-line reply below
> 
> > -Original Message-
> > From: William Black [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 08, 2002 12:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Few Questions
> > 
> > 
> > 
> > Hi all,
> > 
> > I have a few short questions:
> > 
> > First, How do you make an array of hashes and access them 
> > once you have 
> > created them.
> 
> This is a little difficult for a beginner but I will give you 
> the basic
> basics:
> you have an array @a
> now you want to have @a[0] have a hash of values:
> @a[0] = ( key1 => value1,
>   key2 => value2 );
> 
> to get key1's value: @a[0]{key1}

should be $$a[0]{key1}

> now another way to add to it.
> 
> foreach my $key ( qw(key1 key2) ){
>   @a[1]{$key} = 100;
should be $$a[1]{$key}

>   }
> 
> print "@a[1]{key2}\n"; ## will print 100;
> print "@a[0]{key2}\n"; ## will print value2;

you get the idea of my mistakes.

> 
> get it?
> 
> > 
> > Next,How would email someone from within a perl pgm.  I want 
> > to email more 
> > than one person at the same time.  The script is running on a 
> > unix box, but 
> > the people receiving the emails can be on a differentOS(i.e 
> > windows NT, 
> > ETC).
> 
> use any of the following modules:
> Net::SMTP
> Mail::Sender
> MIME::Entity
> 
> and for the TO or CC just separate the various e-mail with a 
> comma (,):
> [EMAIL PROTECTED], [EMAIL PROTECTED]
> 
> or
> 
> Got Jack <[EMAIL PROTECTED]>, Bill GotNone <[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> > 
> > Thanks,
> > 
> > William Black
> > 
> > 
> > 
> > _
> > Join the world's largest e-mail service with MSN Hotmail. 
> > http://www.hotmail.com
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Probably impossible

2002-07-08 Thread Nikola Janceski

you never closed MAIL.

close MAIL;


> -Original Message-
> From: Yasen Petrov [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 2:29 PM
> To: [EMAIL PROTECTED]
> Subject: Probably impossible
> 
> 
> Hi all,
> my problem is that I want to send an e-mail every day, but 
> when I try to
> iterate, the unix perl wants to see all the iterations and 
> then execute them
> at once, while this isn't the same on windows. This means I 
> can't send an
> e-mail every day this way below:
> 
> #!usr/bin/perl
> use warnings;
> use CGI::Carp qw(fatalsToBrowser);
> 
> my $mailprogram = "/usr/lib/sendmail";
> my $rec = '[EMAIL PROTECTED]';
> my $i = 0;
> 
> 
> while ($i < 300)
> 
>  open (MAIL,"|$mailprogram -t");
>  print MAIL "To: $rec\n";
>  print MAIL "From: Yasen_Petrov\n";
>  print MAIL "Subject: Ads\n";
>  print MAIL "Some text\n";
>  sleep 60*60*24; # 24 hours
>  close MAIL;
>  $i++;
>  print "Content-type: text/html\n\n";
>  print "You have just send an e-mail to $rec\n";
> }
> 
> If anyone can help, I'll be very grateful. Thanks.
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Probably impossible

2002-07-08 Thread Nikola Janceski

DOH! Didn't see the close before. what exactly happens again?

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 2:29 PM
> To: 'Yasen Petrov'; [EMAIL PROTECTED]
> Subject: RE: Probably impossible
> 
> 
> you never closed MAIL.
> 
> close MAIL;
> 
> 
> > -Original Message-
> > From: Yasen Petrov [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 08, 2002 2:29 PM
> > To: [EMAIL PROTECTED]
> > Subject: Probably impossible
> > 
> > 
> > Hi all,
> > my problem is that I want to send an e-mail every day, but 
> > when I try to
> > iterate, the unix perl wants to see all the iterations and 
> > then execute them
> > at once, while this isn't the same on windows. This means I 
> > can't send an
> > e-mail every day this way below:
> > 
> > #!usr/bin/perl
> > use warnings;
> > use CGI::Carp qw(fatalsToBrowser);
> > 
> > my $mailprogram = "/usr/lib/sendmail";
> > my $rec = '[EMAIL PROTECTED]';
> > my $i = 0;
> > 
> > 
> > while ($i < 300)
> > 
> >  open (MAIL,"|$mailprogram -t");
> >  print MAIL "To: $rec\n";
> >  print MAIL "From: Yasen_Petrov\n";
> >  print MAIL "Subject: Ads\n";
> >  print MAIL "Some text\n";
> >  sleep 60*60*24; # 24 hours
> >  close MAIL;
> >  $i++;
> >  print "Content-type: text/html\n\n";
> >  print "You have just send an e-mail to $rec\n";
> > }
> > 
> > If anyone can help, I'll be very grateful. Thanks.
> > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Probably impossible

2002-07-08 Thread Nikola Janceski

Okay... I looked a little more indepth.

It seems that you are trying to get a CGI script to send you an e-mail.
Most webservers have a processor timeout set so that you won't have runaway
processes. Perhaps check the webserver's docs for more info on that.

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 08, 2002 2:32 PM
> To: Nikola Janceski; 'Yasen Petrov'; [EMAIL PROTECTED]
> Subject: RE: Probably impossible
> 
> 
> DOH! Didn't see the close before. what exactly happens again?
> 
> > -Original Message-
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 08, 2002 2:29 PM
> > To: 'Yasen Petrov'; [EMAIL PROTECTED]
> > Subject: RE: Probably impossible
> > 
> > 
> > you never closed MAIL.
> > 
> > close MAIL;
> > 
> > 
> > > -Original Message-
> > > From: Yasen Petrov [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, July 08, 2002 2:29 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Probably impossible
> > > 
> > > 
> > > Hi all,
> > > my problem is that I want to send an e-mail every day, but 
> > > when I try to
> > > iterate, the unix perl wants to see all the iterations and 
> > > then execute them
> > > at once, while this isn't the same on windows. This means I 
> > > can't send an
> > > e-mail every day this way below:
> > > 
> > > #!usr/bin/perl
> > > use warnings;
> > > use CGI::Carp qw(fatalsToBrowser);
> > > 
> > > my $mailprogram = "/usr/lib/sendmail";
> > > my $rec = '[EMAIL PROTECTED]';
> > > my $i = 0;
> > > 
> > > 
> > > while ($i < 300)
> > > 
> > >  open (MAIL,"|$mailprogram -t");
> > >  print MAIL "To: $rec\n";
> > >  print MAIL "From: Yasen_Petrov\n";
> > >  print MAIL "Subject: Ads\n";
> > >  print MAIL "Some text\n";
> > >  sleep 60*60*24; # 24 hours
> > >  close MAIL;
> > >  $i++;
> > >  print "Content-type: text/html\n\n";
> > >  print "You have just send an e-mail to $rec\n";
> > > }
> > > 
> > > If anyone can help, I'll be very grateful. Thanks.
> > > 
> > > 
> > > 
> > > -- 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> > --
> > --
> > 
> > The views and opinions expressed in this email message are 
> > the sender's
> > own, and do not necessarily represent the views and 
> opinions of Summit
> > Systems Inc.
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to print out a variable if theres a . in it?

2002-07-09 Thread Nikola Janceski

print "Yeeehaaa: $_[0] \n";

would be more correct than $SNR_LOG, else what's the point of the
subroutine?


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 9:32 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: how to print out a variable if theres a . in it?
> 
> 
> change the line 
> print "Yeeehaaa: $_ \n";
> to
> print "Yeeehaaa: $SNR_LOG \n";
> 
> and it will work fine.
> -Original Message-
> From: Theuerkorn Johannes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 8:10 AM
> To: '[EMAIL PROTECTED]'
> Subject: how to print out a variable if theres a . in it?
> 
> 
> Hello List,
> 
> I have a (probably) simple problem: 
> 
> I´am parsing trough a directory an want to print out every 
> filename that exists. (later I want to open those files)
> Problem is, i have filenames like 
> snr_log.csv,repact.csv,,foo.csv,bar.csv all with a period in 
> between...
> What I get is an error as follows up...
> 
> Any Suggestions?
> 
> ERROR:
> ##
> perl -w verzeichnis.pl
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> Use of uninitialized value in concatenation (.) at 
> verzeichnis.pl line 15.
> Yeeehaaa:
> ##
> 
> 
> this is verzeichnis.pl
> #
> 
> #/usr/bin/perl -w
> 
> use strict;
> 
> my $qis_root = "/home/user1/DiREx/test";
> my $SNR_LOG;
> chdir($qis_root)|| die "can´t change to $qis_root!";
> 
> while (defined($SNR_LOG = <*>)){
> #print "$dateien\n";
> parse_logs($SNR_LOG);
> }
> sub parse_logs{
> 
> print "Yeeehaaa: $_ \n";
> 
> }
> ##
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Regex exception

2002-07-09 Thread Nikola Janceski

why not use foreach() glob() and unlink() instead so it's all done in perl?

foreach $file (glob("e:/dir/*.ldb")){
next if $file =~ /exception pattern here/;
unlink($file) or die "Cannot unlink $file: $!\n";
}

> -Original Message-
> From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 9:35 AM
> To: '[EMAIL PROTECTED]'
> Subject: Regex exception
> 
> 
> HI all.
> 
> A simple question.
> 
> I need to use a system command to delete all files in a 
> directory except
> one.
> 
> Foobar.ldb
> Barfoo.ldb
> Raboof.ldb
> Keep.ldb
> 
> I want to delete all except the keep.ldb and there could be 
> various other
> files.
> 
> I am trying to use this command
> 
> Any help???
> 
> System("erase /f e:\\dir\\*.ldb");
> 
> Or
> (`erase /f "e:\\dir\\*.ldb"`)
> 
> How do I substitute for the * 
> 
> $file =~ (/keep/I);  
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Regex exception

2002-07-09 Thread Nikola Janceski

because you aren't in the dir... you would need

chdir($dir) or die "can't chdir to $dir: $!\n";
before all that to work. and that should be
unlink or die "$_: $!";

> -Original Message-
> From: Jaime Hourihane [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 9:58 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Regex exception
> 
> 
> or what about unless...
> 
> opendir(DIR, $dir) || die ..
> while() {
> unless ~= $pattern {
>unlink or remove here
> }
> 
> }
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Am I being stupid here... or?

2002-07-10 Thread Nikola Janceski

use eq to compare strings not ==
== is to compare numerical values only

perldoc perlop


> -Original Message-
> From: Chris Knipe [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: Am I being stupid here... or?
> 
> 
> Lo all,
> 
> Very stupid it must be, but I can't see what I'm doing wrong here... 
> 
> The following if statement, always returns true (prints "a"), 
> regardless
> of what the value of $SiteType is... 
> 
> #!/usr/bin/perl
> 
> $SiteType = "something";
> 
> if ($SiteType == "notsomething") {
>   print "a";
> }
> 
> Am I doing something really arbly stupid here, did I miss anything?
> 
> What I'd like to accomplish, is something in the lines of:
> 
> if ($SiteType == "PHP3") {
>   do some stuff
> } elsif ($SiteType == "PHP4") {
>   do different stuff
> } elsif ($SiteType == "ASP") {
>   do different stuff
> 
> } else {
>   do default stuff
> }
> 
> --
> me
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




change where use warnings go..

2002-07-10 Thread Nikola Janceski

I want to change where the warnings from use warnings goes.
I already screwed around with STDERR so don't give me those suggestions
(there are other things going to STDERR).
and the same for use strict if possible.

=) 

thanx if you have any ideas.

Nikola Janceski

Not until we dare to regard ourselves as a nation, not until we respect
ourselves, can we gain the esteem of others, or rather only then will it
come of its own accord.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: search and replace problem

2002-07-11 Thread Nikola Janceski

You are only opening the file for read.
If you want to change the file you have to write it somewhere.

=)

> -Original Message-
> From: Johnson, Shaunn [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 11, 2002 10:52 AM
> To: [EMAIL PROTECTED]
> Subject: search and replace problem
> 
> 
> Howdy:
> 
> I know this should be pretty simple, but I must
> be missing something in my code.  I want to do
> the following:
> 
> * get a list of files in a directory
> * open each file
> * search and replace the old pattern to a new pattern
> (should only be one occurrence)
> * close file
> * close dir
> * do next one until the end of list
> 
> But nothing is happening (that I can see).
> What am I doing wrong?
> 
> ### perl code ###
> #!/usr/bin/perl -w
> use diagnostics;
> 
> #
> # this is a script to look for and change the password
> # for the sql scripts that i have lying around for production
> # i'm at the point where i need to be a bit more lazy.
> #
> 
> # create a few variables
> 
> my $sqldir='/samba/sql_scpt';
> my $pattern="jun12";
> my $newpattern="jul12";
> 
> opendir (DIR, $sqldir) or die "can nae access B drive mounted 
> directory:
> $!";
> 
> # create and array and read in a list of files but NOT
> # root and current dir
> 
> my @list = grep {$_ ne 'temp' and $_ ne 'devel' and $_ ne '.' 
> and $_ ne
> '..'} readdir(DIR);
> 
> # create a loop to search for one instance of
> # my password and change it to something else
> # one day, i'll get smart and ask for a paramater, too
> 
> 
> for my $file(@list) {
> open  (FILE, $file ) or die "can nae open the file: $!";;
> while () {
> s!$pattern!newpattern!g ;
> } # end while loop
> } #end of for loop
> 
> close (FILE);
> close (DIR);
> __END__
> 
> ### end of perl code ###
> 
> 
> Suggestions?  Thanks!
> 
> -X
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Need timegm sample

2002-07-11 Thread Nikola Janceski

What no error messages? Just terminates? What about using -w or use
warnings?
are you printing something?

More info required.

> -Original Message-
> From: chris [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 9:17 PM
> To: [EMAIL PROTECTED]
> Subject: Need timegm sample
> 
> 
> use Time::Local; 
> my $TimeInSeconds; 
> #convert broken-down time to seconds in UTC 
> $TimeInSeconds = timegm($sec,$min,$hour,$mday,$mon,$year,$wday,$yday);
> #snip snip snip
> 
> When I use the following in perl 5.6.1, the script terminates
> immediately. What is wrong?
> 
> $TimeInSeconds = timegm(0,0,0,$mday,$mon,$year); 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: What is this string type? How to play with?

2002-07-11 Thread Nikola Janceski

[offtopic]
STOP THE CROSS POSTING MADNESS

you will notice that I removed perl-cgi from this reply. Please use this to
continue the thread.

Thank you

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 11, 2002 2:01 PM
> To: Connie Chan; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: What is this string type? How to play with?
> 
> 
> Oops, let me make one small revision to my code:
> 
> if (exists($form_vars{$name})) { # if this is the first of 
> this form input name.
> 
> should be
> 
> if (!exists($form_vars{$name})) { # if this is the first of 
> this form input name.
> 
> Sorry about that all.
> 
> Regards,
> David
> 
> 
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "Connie Chan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; 
> <[EMAIL PROTECTED]>
> Sent: Thursday, July 11, 2002 11:53 AM
> Subject: Re: What is this string type? How to play with?
> 
> 
> Connie,
> 
> > ; has no problem, why you would like to escape( \ )it ?
> I know that = and ; don't have a problem, I escape them 
> because I escape every special character,
> that way I don't have to worry about what I do and don't need 
> to escape.  I know, bad habit (old
> habits die hard).
> 
> > Besides, if you 'next' it if that $variable is not a 
> name=value pair,
> > so is that mean this var will throw away ?
> This is a safety net incase somebody types in the url with 
> something like this:
> http://www.domain.com/test.cgi?namea=valuea&nameb&namec=valuec
> You don't try to split on = when there's not an = in there.
> Trust me, I've put a lot of thought into this code over the 
> last 2 1/2 years.  I don't particularly
> care for CGI.pm either (but we wont go into that), I wrote my 
> own called Form.pm which I hope to get
> up on CPAN one of these days.  It handles both GET and POST 
> as well as command line parameters
> (Along with post [MIME], I also accept files).  It also works 
> on Linux and Windows.  Its also much
> faster than CGI.pm because its strait to the point, the only 
> thing its intended to do is retrieve
> data and give it in a useable format.
> 
> > Hmmm... what is this purpose ? $name is probably going to be a
> > var's name, how come it goes with a blank ? and with an assumption
> > that the $name is coming as a URI escaped string ?
> Well that's exactly what we are doing, unescaping a URI, we 
> just happen to split it into name and
> value before unescaping it (this is important incase somebody 
> has a %26 in their name or value).
> 
> > Just hard to imagine how come a request coming with same name.
> > Aren't we supposing the later come value with same name 
> will overwrite
> > the first one ?
> How about this instance:
> http://www.domain.com/test.cgi?name=joe&prefscheckbox=YesEmail
> Me&prefscheckbox=YesPhoneMe&prefscheck
> box=YesSnailMailMe
> This is a scenario when you want all of the multiple values 
> with the same name, so you need to put
> it into an array instead of a scalar.
> 
> I knew right from when you mentioned $ENV{'QUERY_STRING'} 
> That you were intending to write a form
> input parser.  Well if you are only going to use get, 
> consider the following:
> 
> 
> my @variables = split(/[\&\;]/, $ENV{'QUERY_STRING'});
> my %form_vars;
> foreach $variable (@variables) {
> next if ($variable !~ /\=/);
> my ($name, $value) = split(/\=/, $variable);
> $name =~ tr/+/ /;
> $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> if ($value ne ""){ # remove this if statement if you want 
> to keep pairs where the name has an
> empty value
> if (exists($form_vars{$name})) { # if this is the 
> first of this form input name.
> $form_vars{$name} = $value; # setting the 
> variable the hash with the name to the value
> } else { # for repeated times in with the same form input name
> $form_vars{$name} = [($form_vars{$name})] if 
> (ref($form_vars{$name} ne "ARRAY")); # make
> this an array if this its not one yet
> push(@{$form_vars{$name}}, $value); # adding the 
> next element to the list
> }
> }
> }
> 
> This essentially gives you a hash with name value pairs 
> for every single value names, and an
> array ref for every name that has multiple values.  
> Basically, it gives you anything that was sent
> (optionally even name empty value sets assuming you remove 
> the if statement around the assignment
> block).
> Eventually when I get it on CPAN, it will be a simple as
> use Form;
> my %input = Form();
> 
> Anyway, good luck,
> David
> 
> 
> 
> 
> - Original Message -
> From: "Connie Chan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; 
> <[EMAIL PROTECTED]>
> Sent: Thursday, July 11, 

RE: How to pipe perl script

2002-07-11 Thread Nikola Janceski

you are piping the wrong way.

cat data_file | perlscript.pl

=)

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 11, 2002 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: How to pipe perl script
> 
> 
> hello, my current project involves piping data to the perl script.
> 
> perlscript.pl | cat data_file
> 
> but unfortunately, the data_file is printed out by cat command
> 
> how would i pipe data to perl script so that only the program did the
> output?
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: deleting files

2002-07-15 Thread Nikola Janceski

foreach $file (glob("/path/to/files/*.dat"), glob("/path/to/files/*.p1")){
unlink($file) || die "cannot unlink file $file: $!";
}

> -Original Message-
> From: Michael Pastore [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 8:48 AM
> To: [EMAIL PROTECTED]
> Subject: deleting files
> 
> 
> Hello All,
> 
> Just a quick question on deleting files in Perl.
> 
> I am trying to delete some files in a directory, but I do not 
> know their
> names...just ending extension...
> 
> I have tried:
> 
> 
> One way:
> 
> unlink <*.dat>;
> unlink <*.p1>;
> 
> Another way:
> 
> unlink glob(".dat");
> unlink glob(".p1");
> 
> I have thought of popping out to the operating system as 
> well, and deleting
> files as well, but would rather stay in Perl.
> 
> Any help would be greatly appreciated..
> 
> Thank You,
> Mike
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: deleting files

2002-07-15 Thread Nikola Janceski

no offense, but using that method you won't know if all the files were
really removed.

> -Original Message-
> From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 8:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: deleting files
> 
> 
> Michael Pastore wrote at Mon, 15 Jul 2002 14:48:12 +0200:
> 
> > I am trying to delete some files in a directory, but I do 
> not know their names...just ending
> > extension...
> > 
> > I have tried:
> > One way:
> > 
> > unlink <*.dat>;
> > unlink <*.p1>;
> > 
> > Another way:
> > 
> > unlink glob(".dat");
> > unlink glob(".p1");
> > 
> 
> You got it nearly:
> 
> unlink for <*.dat>;
> 
> or
> 
> unlink for glob("*.dat");
> 
> 
> Greetings,
> Janek
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Newbie Stupid Question!

2002-07-15 Thread Nikola Janceski

use File::Copy; # add at the top of your script


## then change rename() to copy() and you should be good.

> -Original Message-
> From: Simopoulos [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 2:19 PM
> To: [EMAIL PROTECTED]
> Subject: Newbie Stupid Question!
> 
> 
> Hi All,
> I'm a newbie just starting out learning Perl.
> My problem is I have a bunch of files that are (.doc) files, 
> and I want to rename
> the files (.data).
> I also want move then to another directory, but I don't 
> really want to destroy or
> change the old ones (.doc).
> What I've done so far doesn't work the way I want it to.  It is:
> 
> #! /usr/bin/perl -w
> opendir(DOCUMENTS,".") || die "Can't open directory documents!";
> @filenames = readdir(DOCUMENTS);
> closedir(DOCUMENTS);
> foreach $filename(@filenames) {
>if ($filename =~ m/\.doc$/i) {
>rename($filename, "/home/marsie/data/$filename.dat") ||
>   die "Can't move files";
>} else {
>print "Not a .doc file!\n";
>}
> }
> 
> I would appreciate any help anyone can offer.
> Peace,
> Marsie
> 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Any difference in this?

2002-07-15 Thread Nikola Janceski

Is there any speed difference in this?

my @crap = map {
map{ s/\.\w+$//; $_ } (glob($_))
} qw(*.pl *.pgp);

and

my @crap = map{ s/\.\w+$//; $_ } map { glob($_) } qw(*.pl *.pgp);



Nikola Janceski

Reading maketh a full man, conference a ready man, and writing an exact man.
-- Francis Bacon




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Any difference in this?

2002-07-15 Thread Nikola Janceski

(better question) is there a better way to achieve the same result?

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 3:09 PM
> To: Beginners (E-mail)
> Subject: Any difference in this?
> 
> 
> Is there any speed difference in this?
> 
> my @crap = map {
>   map{ s/\.\w+$//; $_ } (glob($_))
>   } qw(*.pl *.pgp);
> 
> and
> 
> my @crap = map{ s/\.\w+$//; $_ } map { glob($_) } qw(*.pl *.pgp);
> 
> 
> 
> Nikola Janceski
> 
> Reading maketh a full man, conference a ready man, and 
> writing an exact man.
> -- Francis Bacon
> 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Any difference in this?

2002-07-15 Thread Nikola Janceski

This is much more than I needed to know.

Thanx for all the wonderful suggestions.
I wish it was Friday.

> -Original Message-
> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 3:38 PM
> To: Jenda Krynicky
> Cc: Beginners (E-mail)
> Subject: RE: Any difference in this?
> 
> 
> On Jul 15, Jeff 'japhy' Pinyan said:
> 
> >On Jul 15, Jenda Krynicky said:
> >
> >>> (better question) is there a better way to achieve the 
> same result?
> >>
> >> my @crap = map{ s/\.\w+$//; $_ } glob( '*.pl *.pgp');
> >
> >I'm so funny.
> >
> >  my @crap = grep s/\.\w+$//, glob("*.pl *.pgp");
> 
> And here's a better regex:
> 
>   s/\.(pl|pgp)$//
> 
> or
> 
>   s/\.\w{2,3}$//
> 
> No reason not to be as specific as possible.
> 
> -- 
> Jeff "japhy" Pinyan  [EMAIL PROTECTED]  
http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
 what does y/// stand for?   why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Any difference in this?

2002-07-15 Thread Nikola Janceski

heheh.. and it still goes on.

Actually I am using different directories in the qw() with *, and I am doing
a different substitution (not for the basenames).

That's why I said I am getting more than enough info.
Efforts can be spent elsewhere to help the less fortunate.

Thanx again,
Nikola Janceski

Praise from the common people is generally false, and rather follows the
vain than the virtuous.
-- Francis Bacon



> -Original Message-
> From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 3:20 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Any difference in this?
> 
> 
> Nikola Janceski wrote at Mon, 15 Jul 2002 21:16:09 +0200:
> 
> > (better question) is there a better way to achieve the same result?
> > 
> >> my @crap = map{ s/\.\w+$//; $_ } map { glob($_) } qw(*.pl *.pgp);
> 
> It seems you want to get the basenames of the files.
> Express what you want in a natural way:
> 
> use File::Basename;
> 
> my @suffixes = qw/.pl .pgp/;
> my @crap = map {basename $_, @suffixes} map {glob "*$_"} @suffixes;
> 
> print join "\n", @crap;
> 
> 
> Greetings,
> Janek
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Strange tie Problem

2002-07-16 Thread Nikola Janceski



The first element is a filehandle (or reference to one) and once the
filehandle is closed the element is now uninitialized.

I think the module didn't splice out that element.



You have no value for that element from the data you are tying.



What does $array[0] have?

have you tried debugging or Data::Dumper to see what @array consistes of?

this is only a warning, you can turn off warnings to avoid the message if
that's all you wanted.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 8:33 AM
> To: [EMAIL PROTECTED]
> Subject: Strange tie Problem
> 
> 
> The following snippet is from "Advanced perl programming" by Sriram 
> Srinivasan. A test program is also attached.
> If I print any other list element, it works fine but for 
> the first element ( $array[1] ), it gives a warning. What's on??
> Perl version is 5.6.0 on RH Linux 7.
> 
> /home/atul/myperl> ./tst.pl 
> Use of uninitialized value in seek at 
> /home/atul/myperl/TieFile.pm line 27.
> #!/usr/bin/perl -w
> /home/atul/myperl> 
> 
> 
> - Example Program ( tst.pl ) 
> #!/usr/bin/perl -w
> use lib qw(/home/atul/myperl); # so it can find module
> use TieFile;
> my @array;
> tie @array, 'TieFile', 'tst.pl'; # read the program file 
> itself as data
> print "$array[1]";
> - Example Program ( tst.pl ) 
> 
> 
> - CUT HERE 
> 
> package TieFile;
> use Symbol;
> use strict;
> # The object constructed in TIEARRAY is an array, and these are the
> # fields
> my $F_OFFSETS= 0;  # List of file seek offsets (for each line)
> my $F_FILEHANDLE = 1;  # Open filehandle
> 
> sub TIEARRAY {
>my ($pkg, $filename) = @_;
>my $fh = gensym;
>open ($fh, $filename) || die "Could not open file: $!\n";
>bless [  [0],  # 0th line is at offset 0
> $fh
>  ], $pkg;
> }
> 
> sub FETCH {
>my ($obj, $index) = @_;
># Have we already read this line?
>my $rl_offsets = $obj->[$F_OFFSETS];
>my $fh = $obj->[$F_FILEHANDLE];
>if ($index > @$rl_offsets) {
>$obj->read_until ($index);
>} else {
># seek to the appropriate file offset
>seek ($fh, $rl_offsets->[$index], 0); 
>}
>return (scalar <$fh>);  # Return a single line, by 
> evaluating <$fh> 
> }
> 
> sub STORE {
>die "Sorry. Cannot update file using package TieFile\n";
> }
> 
> sub DESTROY {
>my ($obj) = @_;
># close the filehandle
>close($obj->[$F_FILEHANDLE]);
> }
> 
> sub read_until {
>my ($obj, $index) = @_;
>my $rl_offsets = $obj->[$F_OFFSETS];
>my $last_index = @$rl_offsets - 1;
>my $last_offset = $rl_offsets->[$last_index];
>my $fh = $obj->[$F_FILEHANDLE];
>seek ($fh, $last_offset, 0); 
>my $buf;
>while (defined($buf = <$fh>)) {
>   $last_offset += length($buf);
>   $last_index++;
>   push (@$rl_offsets, $last_offset);
>   last if $last_index > $index;
>}
> }
> 
> 1;
> 
> - CUT HERE 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Scalar context problem I think

2002-07-16 Thread Nikola Janceski

Let's make this easier here's an example of what it should look like in the
end:


my @crap = qw(45 / 3 + 6 - 4 * 2);
my $ans = eval( "@crap" );
print "$ans\n"; ## prints 13;



> -Original Message-
> From: Jackson, Harry [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 10:23 AM
> To: '[EMAIL PROTECTED]'
> Subject: Scalar context problem I think
> 
> 
> Hi
> 
> If I have the following variables splits are numbers and totals are
> operators how can I have them executed to get the value.
> 
> $split[0] $total[0] $split[1] $total[1] $split[2] $total[2] $split[3]
> $total[3] $split[4];
>   45   \   3   + 6 -
> 4   *   2
> 
> 
> Harry
> 
> 
> **
> ***
> COLT Telecommunications
> Registered in England No. 2452736
> Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
> Tel. +44 20 7390 3900
> 
> This message is subject to and does not create or vary any contractual
> relationship between COLT Telecommunications, its subsidiaries or 
> affiliates ("COLT") and you. Internet communications are not secure
> and therefore COLT does not accept legal responsibility for the
> contents of this message.  Any view or opinions expressed are those of
> the author. The message is intended for the addressee only and its
> contents and any attached files are strictly confidential. If you have
> received it in error, please telephone the number above. Thank you.
> **
> ***
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl constants with modules

2002-07-16 Thread Nikola Janceski

I still think you are safer with a config file.
With a module they can screw up the script so when it fails they will be
calling you.
with a config file you can program in the error checking.


> -Original Message-
> From: Kevin Old [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 11:48 AM
> To: [EMAIL PROTECTED]
> Subject: Perl constants with modules
> 
> 
> Hello all,
> 
> I am writing a script for a client and they have requested an easy way
> to configure their script.without having to enter the script code
> itself.  
> 
> I'm not to crazy about using a config file like VARIABLE=VALUE, so I
> thought that since I am using a module anyway, why not have the values
> they might want to ever change in the top of the module.  These are
> thigns like paths and number values, that are separate from 
> the command
> line parameters that are passed in when the script is run each time.
> 
> First, is this a good idea?
> 
> Second, which sytax (in your opinion) should I use?
> 
> $CDMA::USER = "myusername";
> 
> or
> 
> use constant USER => "myusername";
> (called like CDMA::USER.correct?)
> 
> Any help is appreciated.
> 
> Thanks,
> Kevin
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: find biggest number

2002-07-16 Thread Nikola Janceski

$largest = (sort { $b <=> $a } @array)[0]

> -Original Message-
> From: Konrad Foerstner [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 12:38 PM
> To: [EMAIL PROTECTED]
> Subject: find biggest number
> 
> 
> Hi,
> 
> Im looking for a method to exact the
> biggest element (number) out of array. 
> Does anyone know a function for that?
> 
> cu
> 
> Konrad
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: The True Guide to Learning Perl was Re: Thank You! :)

2002-07-16 Thread Nikola Janceski

> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 1:25 PM
>
> But we do have an ethical obligation to beginner's to make
> them aware that there is:
> 
>   the right way
what happened to 'the best way' 'the readable way'?

>   the wrong way
does this incapsulate 'the old perl way'?

>   the way they taught them in school
or does this?

>   the way we did perl when we started
AKA 'the wrong way'

Comments for the below has been deffered to Larry Wall
8^)
I don't tell God it's wrong, I say, "Great idea!"

>   THE TRUE OTHODOXY
> 
> and that of course will mean mastering which are the
> TRUE CPAN Modules
> 
> So the bright student will of course begin with the
> simple problem:
> 
>   take a position for or against Perl6
> 
>   be specific
>   use illustrations
>   demonstrate your position completely
>   show all of your work
> 
> as well as solving the Church-Turing Hypothesis,
> and demonstrating that this can only be done in Perl...
> 
> ciao
> drieux
> 
> ---
> 
> 
> The voices in my head make me write this
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: word count (limit) in a scalar...

2002-07-16 Thread Nikola Janceski

why does this idea sound like it's coming from:

A. a student who hopes to have computer program write his 500 word essays
every week.

B. a teacher who put the rule on students that s/he will ignore anything
beyond 500 words.

:)

> -Original Message-
> From: Daniel Gardner [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 3:37 PM
> To: [EMAIL PROTECTED]; Anthony E.
> Subject: Re: word count (limit) in a scalar...
> 
> 
> Anthony E. wrote:
> 
> > i have a bunch of text in a scalar $text
> > How would I keep the word count to a maximum, and just
> > dump the rest.. ie - I only want the paragraph to
> > contain 500 words, and trash the rest.
> 
> I know this isn't exaclty what you asked...
> 
> I'm taking a wild guess and thinking that what you want to do 
> is show some 
> sort of summary of various documents, and 500 words is a good 
> size for a 
> summary.
> 
> If that's the case, then I would avoid the overhead of splitting and 
> joining by simply taking the first n characters of the 
> string, where n is 
> about 500 words worth of characters.
> 
> Assuming the average word has 6 characters in it:
> 
> ,[ code ]
> | my $summary_size = 6 * 500;
> | my $summary = $start_text;
> | $summary = substr $start_text, 0, $summary_size
> |   if (length($start_text) > $summary_size);
> `
> 
> Of course it all depends what you want to use the data for.
> 
> --
> Best Regards,
> Daniel
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Consolidate if/else

2002-07-16 Thread Nikola Janceski

precedence..

?:

has lower precedence than

{}


change it to:
(!$opt_Z) ? die("Must supply Market\n") : $mkt = $opt_Z;


> -Original Message-
> From: Kevin Old [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 4:54 PM
> To: [EMAIL PROTECTED]
> Subject: Consolidate if/else
> 
> 
> 
> Hello all,
> 
> I'm trying to get this line to work 
> 
> (!$opt_Z) ? die "Must supply Market\n" : $mkt = $opt_Z;
> 
> and I keep getting compiler errors.
> 
> 
> Basically I'm trying to consolidate:
> 
> if (!$opt_Z) {
>   die "Must supply Market\n";
> } else {
>   $mkt = $opt_Z;
> }
> 
> 
> Any ideas?
> 
> Thanks,
> Kevin
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Random generator

2002-07-17 Thread Nikola Janceski

you for got the int.. he said whole numbers

my $rand_num = int(rand(90) + 10);

> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 12:25 PM
> To: begin begin
> Subject: Re: Random generator
> 
> 
> 
> On Wednesday, July 17, 2002, at 09:15 , Jilani, Mohammad K wrote:
> 
> > How can I generate a whole number betwee 10 - 99?
> >
> 
> perldoc -f rand
> 
> and then tweek it
> 
> since rand runs from 0 you might try say
> 
>   my $rand_num = rand(90) + 10;
> 
> 
> 
> ciao
> drieux
> 
> ---
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Setting environment variable for process spawned with system()

2002-07-17 Thread Nikola Janceski

kinda like this?

system(qq/export FIT_LOG="check toilet"; gnuplot -some options/);


> -Original Message-
> From: Dan Fish [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 1:27 PM
> To: Perl List
> Subject: Setting environment variable for process spawned 
> with system()
> 
> 
> Okay... maybe this is just so simple that I can't see the 
> forest through the
> trees, but I've never had a need to do it before and so that 
> inherently
> makes it difficult :-)
> 
> I've got a script that runs gnuplot via system().  In order 
> to use a custom
> path for gnuplot's "fit" regression function, It looks for 
> the environment
> variable FIT_LOG.
> 
> How can I set an environment variable in the script that will 
> be inherited
> by the system() process?
> 
> Thanks,
> -Dan
> 
> ---
> "Old programmers never die... Unless of course they refuse to 
> accept a few
> extra CPU cycles over months of efficiency tuning... [Have 
> times changed or
> WHAT!]"
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Confirm a possible bug

2002-07-18 Thread Nikola Janceski

I think I have stumbled onto a bug. I'd like one of the gurus (Jeff, druiex,
Jenda or any perlguy.com) to confirm that my test is correct or if I missed
something in docs.
using Perl 5.6.1 on a Solaris sparc.

#perl
use strict;
use warnings;

my $wofile = "noread";  # text file with no read permissions
my $file = "canread";   # text file with read perms

if( -T $file ){  # will be true
print "exists\n" if -e _;  # will print
} else {
print "doesn't exist\n" unless -e _;
}

## here's the possible bug
if( -T $wofile ){  # will be false (you need read to determine if text file)
print "exists\n" if -e _;
} else {
print "doesn't exist\n" unless -e _;  # will print BUT SHOULDN'T
}

__END__


According to perldoc perlfunc about file tests:
 If any of the file tests (or either the "stat" or
 "lstat" operators) are given the special filehandle
 consisting of a solitary underline, then the stat
     structure of the previous file test (or stat
 operator) is used, saving a system call.



Nikola Janceski

Go with the flow, don't get caught in the current.
-- Nicky J. from da' Bronx




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




scope of perlvars?

2002-07-18 Thread Nikola Janceski

I was wondering what the scope of perlvars (ie. $! and $?) are across
modules?

Here's my situation:

In module:
open file || return -1;

In script:
Can I use $! here? and will it contain the reason open didn't open (if it
didn't) in the module?
Would I need to export the $! from the module?


Nikola Janceski

How I wish that somewhere there existed an island for those who are wise and
of good will.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: UPPERCASE and DOING MULTIPLE THINGS

2002-07-22 Thread Nikola Janceski

See inline comments

> -Original Message-
> From: Bob H [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: UPPERCASE and DOING MULTIPLE THINGS
> 
> 
> I have a script that is *supposed* to search a file and make certain 
> words that I have in an array uppercase. My brain is not grokking it.
> 
> Q1: What is wrong with my script (below)?
> Q2: Can I update a file in place?
> Q3: How do I run multiple things against one file in one script?
> 
> === SCRIPT ===
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> # variables
> my $word = undef;
> 
> # setup the words to uppercase
> my @words = qw/ Mary John Joe /;
#you want to use pattern matching like this:
my @words = map qr/$_/i, qw/ Mary John Joe /;

> 
> open FILE, ">> NEW1 "  or die "can't open FILE:  $!";
> 
> while (<>) {
>  foreach $word (@words) {
>  $word = ~ tr /a-z/A-Z/;
>  print FILE;
>  }
# this whole foreach just changes the words in the array not the file.
# note that you are also reading in from stdin.
# to fix do this
foreach $word (@words){
s/ ## substitute in current line, 
($word) # match $word (Mary) case-insenstive, 
/ # and replace 
uc($1) # with uppercase of same word.
/gex;  # g = globally (throughout line as many times), e =
eval right side (uc($1)), x = ignore whitespace and comments
}
print FILE; # print to file after all @words are changed in line
> }
> 
> # close the file
> close (FILE);
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: One Liner Problems

2002-07-23 Thread Nikola Janceski

output is buffered.
try it like this

perl -e 'for(1..300){sleep 1;print ".\n";}'


> -Original Message-
> From: Balint, Jess [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 2:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: One Liner Problems
> 
> 
> Hello. What is wrong with this?
> 
> perl -e 'for(1..300){sleep 1;print ".";}'
> 
> It never prints anything.
> Thanks.
> 
> Jess
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Crypt::Cracklib?

2002-07-23 Thread Nikola Janceski

I just checked CPAN
and found:

http://search.cpan.org/doc/DANIEL/Crypt-Cracklib-0.01/Cracklib.pm

and there is a good example right there, but there isn't much documentation.
That's all the input I can supply.

> -Original Message-
> From: Batchelor, Scott [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 3:57 PM
> To: Batchelor, Scott; [EMAIL PROTECTED]
> Subject: RE: Crypt::Cracklib?
> 
> 
> Anyone have any input on this?
> 
> Scott 
>  
> 
> 
> 
>  -Original Message-
> From: Batchelor, Scott  
> Sent: Tuesday, July 23, 2002 12:07 PM
> To:   [EMAIL PROTECTED]
> Subject:  Crypt::Cracklib?
> 
> Does anyone have any experience with this module?
> 
> Basically I have a PHP page which is passing a username and 
> password to a perl script that does some preliminary 
> checking...then I want to call cracklib to do the rest...
> 
> Does anyone have a good example of how to do this.  
> Everything is working fine but I am ready to implement the 
> Cracklib portion and I am unsure of how to do this.
> 
> Thanks in advance.
> 
> Scott
>  
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another sort question (flame away)

2002-07-24 Thread Nikola Janceski

not a dumb question... I actually have the same problem.
I have version numbers that look like this:

V1.2.3
V1.2.20
V1.2.23

and it sorts it wrong with cmp and <=>

soo.. I had to come up with my own sort subroutine


here is very generic one that breaks up the elements by \w (word types
[a-Z0-9])
that I made and works like a champion.




to use it:
use strict;
use warnings;


my @sorted = sort { wordtype() } @your_array;

# for reverse
my @sorted = sort { wordtype($b, $a) } @your_array;


sub wordtype {
#
#  Inputs:  $a, $b (not required)
#
#  Globals: $a $b
#
#  Subs called: NONE
#
#  Purpose: sort \w chars in groups
#   numerically if numbers
#
#  Returns: sort ordering (1,0,-1)
#
my ($a, $b);
if(exists $_[0]){
$a = $_[0];
} else {
no strict 'refs';
$a = ${caller()."::a"};
}
if(exists $_[1]){
$b = $_[1];
} else {
no strict 'refs';
$b = ${caller()."::b"};
}

my @first = split /\W/, $a;
my @second = split /\W/, $b;

for(my $n = 0; $n <= $#first; $n++){
if($first[$n] =~ /^\d+$/ && $second[$n] =~ /^\d+$/){
return $first[$n] <=> $second[$n] if $first[$n] <=>
$second[$n];
} else {
return $first[$n] cmp $second[$n] if $first[$n] cmp
$second[$n];
}
}
return 0;
} ## END wordtype

> -Original Message-
> From: nkuipers [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 1:39 PM
> To: [EMAIL PROTECTED]
> Subject: another sort question (flame away)
> 
> 
> Hello all,
> 
> My hash keys look something like this:
> 
> >1234 x5
> 
> So I am thinking a cmp, as opposed to <=> is best.
> 
> What I want is for the keys to be sorted as follows:
> 
> >1 x
> >2 x
> >3 x
> ..
> ..
> ..
> >n x
> 
> This is what I have in my script at the moment:
> 
> my @sort_this = keys %final_list;
> my @sorted = sort { $a cmp $b } @sort_this;
> for (@sorted) { print OUT "$_\n$final_list{$_}\n" }
> 
> This gives
> 
> >1 x
> >10 x
> >100 x
> >1000 x
> >1001 x
> 
> etc.
> 
> Any suggestions?  I'm not asking for you to spell it out for 
> me with code and 
> all unless you really want to.  Sorry if this is a dumb question.
> 
> cheers,
> 
> nathanael
> 
> "I think for my lunch tomorrow I'll make a tuna and pickle 
> triangle bunwich."
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another sort question (flame away)

2002-07-24 Thread Nikola Janceski

yeah.. but that's not all I use it for 
=P

> -Original Message-
> From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 1:22 PM
> To: [EMAIL PROTECTED]
> Subject: RE: another sort question (flame away)
> 
> 
> Nikola Janceski wrote at Wed, 24 Jul 2002 19:45:54 +0200:
> 
> > not a dumb question... I actually have the same problem. I 
> have version numbers that look like
> > this:
> > 
> > V1.2.3
> > V1.2.20
> > V1.2.23
> > 
> > and it sorts it wrong with cmp and <=>
> > 
> > soo.. I had to come up with my own sort subroutine
> 
> For that special purpose it wouldn't be necessary.
> Sort::Versions
> from the CPAN could it do, too.
> 
> 
> Greetings,
> Janek
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another sort question (flame away)

2002-07-24 Thread Nikola Janceski

or just use my subroutine =P

> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 3:11 PM
> To: 'nkuipers'; [EMAIL PROTECTED]
> Subject: RE: another sort question (flame away)
> 
> 
> > -Original Message-
> > From: nkuipers [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 24, 2002 3:03 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: another sort question (flame away)
> > 
> > 
> > >Would trapping it an eval be what the doctor ordered?
> > 
> > To answer my own question, no, it would not.
> > 
> > #use warnings;
> > 
> > would be better.
> 
> Or, for fine-grain control:
> 
>{
>   no warnings 'numeric';   # disable warning until end of block
>   @foo = sort { $a <=> $b } @foo;
>}
> 
> perldoc perllexwarn
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: threads in perl

2002-07-24 Thread Nikola Janceski

It is possible to change vars in the main script with fork if you use
IPC::Shareable
But be forewarned it's gets pretty cumbersome when you have 2+ processes
sharing vars.

> -Original Message-
> From: Chas Owens [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 3:29 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: threads in perl
> 
> 
> On Wed, 2002-07-24 at 02:57, [EMAIL PROTECTED] wrote:
> > Hello All,
> > 
> > I want to execute same perl procedure with different parameters at 
> > the almost same time in a perl program indefendantly. (next process 
> > should be started without waiting for the end of previous one)  The 
> > procedure is located in .pm file. How can I use thread in 
> perl to get 
> > my work done?
> > 
> > regards
> > Rohana.
> 
> You need to question whether or not you need threads.  You can achieve
> much the same result with fork.  If your subroutine does 
> things without
> needing to modify variables in the main script then fork is probably a
> better solution.  Read perldoc -f fork for more info.
>  
> -- 
> Today is Setting Orange the 59th day of Confusion in the YOLD 3168
> Keep the Lasagna flying!
> 
> Missile Address: 33:48:3.521N  84:23:34.786W
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: directory scanning

2002-07-25 Thread Nikola Janceski

Funny. I wrote a script that does that, but recursively for all subdirs too.
Here's a good place to start: File::Find


> -Original Message-
> From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 8:56 AM
> To: Perl beginners
> Subject: re: directory scanning
> 
> 
> On Thu, 25 Jul 2002, William Black wrote:
> 
> > Hi All,
> > 
> > I need an idea on how to approach a script.  Say I had a 
> directory X with 50 
> > files in it and I have another directory Y that is suppose 
> to have the same 
> > exact files in it as X.  How could someone approach 
> checking directory Y 
> > aginst X to see if they had the same files?
> 
> By the same file if you mean same contents, check out File::Compare
> The approach would be something like this.
> 
> use File::Compare;
> opendir (DIRX, $dirX) or die ".";
> while (my $xfile = readdir(DIRX)) {
>   if (compare($xfile, "$dirY/$xfile") != 0) {
> print "Your error messages";
>   }
> }
> closedir (DIRX);
> 
> Note, you will have to add a check to see if the number of 
> files in dir X 
> and dir Y are the same.
> 
> > 
> > Thks,
> > 
> > 
> > William Black
> > 
> > 
> > 
> > _
> > MSN Photos is the easiest way to share and print your photos: 
> > http://photos.msn.com/support/worldwide.aspx
> > 
> > 
> > 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Percent % completed?

2002-07-25 Thread Nikola Janceski

I think Tim meant:

open(COMMAND, "command |") or die "$!";

while (){
#here will come each line of output in $_ while the command runs and
until the command ends.
}
close COMMAND;

> -Original Message-
> From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 1:18 PM
> To: 'David Samuelsson (PAC)'; '[EMAIL PROTECTED]'
> Subject: RE: Percent % completed?
> 
> 
> 
> Perhaps you could open the command to a filehandle
> 
> open(COMMAND,"|command");
> 
> and figure out something from there.  I've never done it, so 
> I'm not sure,
> and I have to run, but that might get you started.
> -Original Message-
> From: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 12:28 AM
> To: '[EMAIL PROTECTED]'
> Subject: Percent % completed?
> 
> 
> Hello again out there.
> 
> Is there anyway to get perl to do a counter so it counts in 
> the command
> shell how many % that is done? I have a script that runs a check on a
> database, its just 1 command and it spits out some 
> information. Can i parse
> this information from when its printing out this information, 
> and insted
> capture some variabels and make it count like 0 % ready, 25 % ready or
> similar? its hard since its just 1 command and that spits out all the
> infomation if the database is at good health, but the check can take a
> really long time for some databses and a very short time for 
> not so big
> databases.  But the out put is always the same for the 
> databses unless there
> is an error in them.
> 
> Processing key file: vob_db.k01(1), total of 444 nodes
> 
> 
> --
> 
> Processing key file: vob_db.k02(2), total of 840 nodes
> 
> 
> --
> 
> Processing key file: vob_db.k03(5), total of 1 node
> 
> 
> --
> 
> Processing key file: vob_db.k04(6), total of 1 node
> 
> 
> --
> 
> Processing data file: vob_db.d01(0), total of 37651 records
> 
> 
> --
> 
> Processing data file: vob_db.d02(3), total of 20628 records
> 
> 
> --
> 
> Processing data file: vob_db.d03(4), total of 1 record
> 
> 
> Database consistency check completed
> 
> 0 errors were encountered in 0 records/nodes
> 
> This is the output from the command.  Anyone got a clue on 
> how to make it
> count for each line or something?
> 
> Thanks for any info or similar scripting techniqes.
> 
> //Dave
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: little help

2002-07-25 Thread Nikola Janceski

No offense intended, but you could start by making the varible names a
little more descriptive.
Then use at least use strict, but it's only a suggestion.
Now see inline comments

> -Original Message-
> From: William Black [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 1:39 PM
> To: [EMAIL PROTECTED]
> Subject: re: little help
> 
> 
> Can someone tell me why the below code can't won't work.
> 
> Essentially, there is a directory full of files and I wanted 
> to compare them
> to names I stored in a file.  If the name of the file is not 
> found I just
> want to say file not found, etc...
> 
> A liitle help please
> 
> $bin_dir = '...';
> 
> 
> open(FILE,'ck') or die "Could not open file!" ;
> $ct=0;
> while(){$tmp = $_;chomp($tmp); $array[$ct] = $tmp;$ct++;}
#better written as:
while(){
chomp;
push @array, $_;
}

> close(FILE);
> 
> 
> chdir($bin_dir);
> opendir(BINDIR,$bin_dir) or die "Could not open" $trillium=@array;
# this looks like a typo. shouldn't it be:
opendir(BINDIR,$bin_dir) or die "Could not open: $!"; # $! tells you why it
died
$trillium = @array; ## you really don't need this and you will see why.

> $laurel = @binfiles;
## where did @binfiles come from

> foreach $file(@binfiles){
## shouldn't it be
## foreach $file (@array){ #
## or 
foreach $file (readdir BINDIR){ #???

print "$file was not found in ck.\n" unless grep $file eq $_, @array;
}

## what the heck is this while loop? use grep (see above)
>$marker=0;
>$count=0;
>while($count <= ($trillium-1)){
>if($file eq $array[$count]){
>$marker=1;
>last;
>}
> 
>   $count++;
>}#while
> 
>if($marker == 0){print"$file was not found\n";}
> }
> 
> 
> 
> 
> 
> William Black
> 
> 
> 
> William Black
> 
> 
> 
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: time comparison

2002-07-25 Thread Nikola Janceski

Date::Calc

And any other Date module you can find on search.cpan.org


> -Original Message-
> From: lz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 2:02 PM
> To: [EMAIL PROTECTED]
> Subject: time comparison
> 
> 
> Hi guys,
> 
> I am extracting the following expiration time from a
> certificate, and I get expiration time from the
> certificate in the following format.
>notAfter=Nov 16 23:59:59 2002 GMT
> 
> I need to compare system date with the date from a
> certificate to find out whether certificate has
> already been expired or within 4 weeks of expiration.
> 
> Does anyone have any good pointers on how do it?
> 
> Thanks a lot!
> 
> __
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: empty a dir

2002-07-30 Thread Nikola Janceski

File::Path  has a function called rmtree.

> -Original Message-
> From: loan tran [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: empty a dir
> 
> 
> Is there a better way to do this in perl:
> 
> $reportdir = '/sybase/dba/scripts/dbuser_report';
> `rm -r $reportdir/*`;
> 
> __
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: empty a dir

2002-07-30 Thread Nikola Janceski

nope that won't work. s/he wants recursive removal. not just files.

check search.cpan.org for File::Path docs or perldoc File::Path

use rmtree.

> -Original Message-
> From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 12:54 PM
> To: loan tran; [EMAIL PROTECTED]
> Subject: RE: empty a dir
> 
> 
> Try this:
> 
> @files=glob("/sybase/dba/scripts/dbuser_report/*");
> unlink(@files);
> 
> HTH,
> 
> José.
> 
> -Original Message-
> From: loan tran [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, July 30, 2002 6:44 PM
> To: [EMAIL PROTECTED]
> Subject: empty a dir
> 
> 
> Is there a better way to do this in perl:
> 
> $reportdir = '/sybase/dba/scripts/dbuser_report';
> `rm -r $reportdir/*`;
> 
> __
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better http://health.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
>  DISCLAIMER 
> 
> "This e-mail and any attachment thereto may contain 
> information which is confidential and/or protected by 
> intellectual property rights and are intended for the sole 
> use of the recipient(s) named above. 
> Any use of the information contained herein (including, but 
> not limited to, total or partial reproduction, communication 
> or distribution in any form) by other persons than the 
> designated recipient(s) is prohibited. 
> If you have received this e-mail in error, please notify the 
> sender either by telephone or by e-mail and delete the 
> material from any computer".
> 
> Thank you for your cooperation.
> 
> For further information about Proximus mobile phone services 
> please see our website at http://www.proximus.be or refer to 
> any Proximus agent.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Down and dirty duplicate deleter

2002-07-30 Thread Nikola Janceski

{
my %seen;
@uniq = grep { !$seen{$_}++ }, @arrayWithDups;
}

> -Original Message-
> From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 3:04 PM
> To: [EMAIL PROTECTED]
> Subject: Down and dirty duplicate deleter
> 
> 
> Hi, 
> 
> I have instances where I want to delete duplicate elements 
> out of an array.
> Is there an easy way to do this?
> 
> -Sarah
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Down and dirty duplicate deleter

2002-07-30 Thread Nikola Janceski

as per Japhy, corrected below

{
my %seen;
@uniq = grep { !$seen{$_}++ } @arrayWithDups;
}

## then ignore this
@uniq = map { my $temp = $_ ^ $temp; } @uniq;
undef @uniq;

# now @uniq contains no duplicates. (nor anything else). :P

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 3:08 PM
> To: 'Kirby_Sarah'; [EMAIL PROTECTED]
> Subject: RE: Down and dirty duplicate deleter
> 
> 
> {
> my %seen;
> @uniq = grep { !$seen{$_}++ }, @arrayWithDups;
> }
> 
> > -Original Message-
> > From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 30, 2002 3:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: Down and dirty duplicate deleter
> > 
> > 
> > Hi, 
> > 
> > I have instances where I want to delete duplicate elements 
> > out of an array.
> > Is there an easy way to do this?
> > 
> > -Sarah
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Editor

2002-07-31 Thread Nikola Janceski

nedit.org <-- the best there is (in my book)

> -Original Message-
> From: Angerstein [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 9:55 AM
> To: Scott Barnett; [EMAIL PROTECTED]
> Subject: AW: Editor
> 
> 
> I really love nedit.
> 
> > -Ursprüngliche Nachricht-
> > Von: Scott Barnett [mailto:[EMAIL PROTECTED]]
> > Gesendet am: Mittwoch, 31. Juli 2002 15:44
> > An: [EMAIL PROTECTED]
> > Betreff: Editor
> >
> > Hi,
> >
> > I am new to Perl just over a month now. I have tried other
> > programming languages and they just seem to hard to understand. I
> > have found Perl to be a lot easier to understand, and that brings
> > me to my question. What is a good Perl Editor for writing
> > scripts? I am currently using Crimson Editor.
> >
> > Thanks
> >
> > Scott Barnett
> > Home Care Medical - Technical Support Specialist
> > 1-800-369-6939
> > 1-262-786-9870 ext.214
> > E-Mail [EMAIL PROTECTED]
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Editor

2002-07-31 Thread Nikola Janceski

perhaps you haven't dl-ed the latest version of nedit.
It's up to 5.3 now, and has come along way from version 4.2.

> -Original Message-
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 9:57 AM
> To: Scott Barnett; [EMAIL PROTECTED]
> Subject: Re: Editor
> 
> 
> Me too !! This editor is the greatest I found on Win OS.
> But have you download the Syntax pack for Perl ? Go ahead
> if no.
> 
> Anyway, the other choice for me is Note Tab Lite. But seems
> very unstable if I am using Chinese ( Perhaps that do not
> have any infect on you ).
> 
> But if you are doing a global text replacement, I would
> suggest using CuteHtml. The replacement speed and quality is
> the fastest and flexiable( Up to paragraphs ).
> 
> Rgds,
> Connie
> 
> 
> - Original Message -
> From: "Scott Barnett" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 31, 2002 9:43 PM
> Subject: Editor
> 
> 
> Hi,
> 
> I am new to Perl just over a month now. I have tried other  
> programming languages and they just seem to hard to
> understand. I have found Perl to be a lot easier to 
> understand, and that brings me to my question. What is a good Perl
> Editor for writing scripts? I am currently using Crimson Editor.
> 
> Thanks
> 
> Scott Barnett
> Home Care Medical - Technical Support Specialist
> 1-800-369-6939
> 1-262-786-9870 ext.214
> E-Mail [EMAIL PROTECTED]
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




empty anonomous hash

2002-07-31 Thread Nikola Janceski

I have a data structure that I want to initialized with an empty anon. hash.

I know for arrays I can do:
$DATA{$key1}{$key2} = [];

but what if I want it to be a hash?

Nikola Janceski

God is subtle, but he is not malicious.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Editor

2002-07-31 Thread Nikola Janceski

Yes. The regexs in nedit look more like perl regexs.
Also it has customizable keyboard shortcuts, and a nice graphical interface
if you don't like keystroking.

> -Original Message-
> From: Kay Bieri [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 10:06 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Editor
> 
> 
> Is anybody using GNU Emacs to write perl programs? Is its 
> perl-mode good
> enough to compete with nedit and alike? I've been using Emacs 
> for almost
> anything (including C++, Latex, Perl ...) and hardly ever 
> tried another
> editor.
> 
> Greetings
> Kay
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl IDE's v. Perl Editors was Re: Editor

2002-07-31 Thread Nikola Janceski

Yep even the best of syntax highlighting patterns still can't handle some of
those FUNKY regexs I use in my perl program.

> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 10:46 AM
> To: begin begin
> Subject: Perl IDE's v. Perl Editors was Re: Editor
> 
[snip]
> 
> Many editors now come with various forms of 'colour'
> for providing 'syntax mark up' - that will provide
> 'visual clues' to when one has injected a 'typo' into
> a script. This helps IF you know the 'colour schema'
> for how perl syntax SHOULD look like to begin with. It
> will of course help you along the way to learn basic
> perl syntax as you use this 'memory aid'.
> 
[snip]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




regex capturing

2002-07-31 Thread Nikola Janceski

$\ = "\n";
$date = "20020731";
print join "/", ($date =~ /(\d{4})(\d{2})(\d{2})/)[1,2,0]; # this works
print join "/", ($date =~ /(\d{4})(\d{2}){2}/)[1,2,0]; # this doesn't

__END__

why did the second pattern not capture the second occurance of \d{2} ?
Is this the correct action? or should it capture the second one in the
second example?
Is there a way to capture like so (like second example as I expected it to
work)?


Nikola Janceski

If you enjoy what you do, you'll never work another day in your life.
-- Confucius 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: regex capturing

2002-07-31 Thread Nikola Janceski

Nested quantifiers before HERE mark in regex m/(\d{4})(\d{2}{ << HERE 2})/
at line.
when i do that, so that's not the answer.
print join "/", ($date =~ /(\d{4})(\d{2}{2})/)[1,2,0];

> -Original Message-
> From: Tanton Gibbs [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 11:55 AM
> To: Nikola Janceski; Beginners (E-mail)
> Subject: Re: regex capturing
> 
> 
> To capture the second occurance you have to surround the {2} 
> with parens.
> 
> print join "/", ($date =~ /(\d{4})(\d{2}{2})/)[1,2,0]
> 
> Tanton
> - Original Message -
> From: "Nikola Janceski" <[EMAIL PROTECTED]>
> To: "Beginners (E-mail)" <[EMAIL PROTECTED]>
> Sent: Wednesday, July 31, 2002 11:27 AM
> Subject: regex capturing
> 
> 
> > $\ = "\n";
> > $date = "20020731";
> > print join "/", ($date =~ /(\d{4})(\d{2})(\d{2})/)[1,2,0]; 
> # this works
> > print join "/", ($date =~ /(\d{4})(\d{2}){2}/)[1,2,0]; # 
> this doesn't
> >
> > __END__
> >
> > why did the second pattern not capture the second occurance 
> of \d{2} ?
> > Is this the correct action? or should it capture the second 
> one in the
> > second example?
> > Is there a way to capture like so (like second example as I 
> expected it to
> > work)?
> >
> >
> > Nikola Janceski
> >
> > If you enjoy what you do, you'll never work another day in 
> your life.
> > -- Confucius
> >
> >
> > 
> --
> 
> --
> > 
> > The views and opinions expressed in this email message are 
> the sender's
> > own, and do not necessarily represent the views and 
> opinions of Summit
> > Systems Inc.
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: regex capturing

2002-07-31 Thread Nikola Janceski

Correct actually. It just didn't dawn on me that $2 was being "reused" but
that is unlike perl to do that.
I would have thought that it would know that I wanted 2 captures. So is this
just a new issue that hasn't come up before? or is it something seen just
nothing done about it?

I am using the first example anyway because I need it working now, but I was
curious to learn if this is a problem/bug or if this was the intended
result. Perldocs didn't have much about this kind of situation, so I don't
know what the intended result would be.

> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 12:21 PM
> To: 'Nikola Janceski'; Beginners (E-mail)
> Subject: RE: regex capturing
> 
> 
> But it does capture the second occurrence (the 31). It doesn't capture
> the first (the 07).
> 
> In the absence of /g, it would seem that since there are only two
> sets of parens in the second regex, only two values can be captured.
> The {2} quanitifier would simply cause $2 to be "reused".
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl IDE's v. Perl Editors was Re: Editor

2002-07-31 Thread Nikola Janceski

see inline comments

> -Original Message-
> From: Paul Tremblay [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 12:24 PM
> To: begin begin
> Subject: Re: Perl IDE's v. Perl Editors was Re: Editor
> 
> 
> I'm surprised that more posters didn't advocate vim as *the* editor.
> I think it is linux world that did a survey and found that 80 
> percent of
> the users picked vim as their favorite editor. 
> 
> I originally started using vim, then switched to nedit, and now have
> switched back to vim. Nedit if very nice, but I had problems with
> keyboard commands. About half the time when I would press keys like
>  z to undo a command, I would get a "^ack" or 
> something like that
> on the screen.

that's been fixed on the new release.

> 
> I can see why vim is the most popular linux editor. It is extremelly
> powerful. It has all sorts of options for automatic inenting, 
> as well as
> a feature called folding, which I still have to learn how to use; it
> bascially hides lines on your screen. So if you were working between
> your main program and a subroutine 1000 lines below, you could hide
> those thousand lines. Of course, vim as full highlighting 
> capabilities.
> Vim offers so many options that I doubt I could learn them all.

nedit too, and the help docs are much better now, vim docs weren't that
great.
IMHO.

> 
> The drawback to vim is that it is a bit hard to learn at first. It is
> keyboard driven, which goes against how most people learn to operate
> a computer, with a mouse. Of course, there is full graphical interface
Ack, love the keyboard, hate the mouse.

> version of vim, which I use, called gvim. Once you get over 
> the initial
> difficulty of learning vim (which should only take a few 
> days?), then it
> can be easier to use, depending on your preferences.
> 
> Vim is also one hundred percent free--as is Nedit. I wouldn't 
> pay for an
> editor, with all the excellent free choices out there.
> 
Agreed.

> But nedit is also a good choice as an editor. It is very 
> intuitive and also
> powerful.

And easy to learn.




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




qr/$stuff/

2002-07-31 Thread Nikola Janceski

I want to make sure that I am using this correctly for efficiency.

I want to use $stuff as a regex but I want to store it in a data structure.
so when I do use it in a regex will it be more efficient than just saying
/$stuff/?

I cannot use the /o option because $stuff changes with each OUTER iteration.

ex:

foreach my $stuff (@stuffs){

$INFO{key1}{regex} = qr/$stuff/;

## do stuff using $INFO{key1}{regex} several times as so:
foreach my $test (@tests){ ## yeah I know I could store @tests as qr
regexs but this is an example
print "somthing" if $test =~ $INFO{key1}{regex};
}

}


thx for feedback

Nikola Janceski

Not until we dare to regard ourselves as a nation, not until we respect
ourselves, can we gain the esteem of others, or rather only then will it
come of its own accord.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: speed and perl

2002-08-02 Thread Nikola Janceski

personally I don't do speed while writing perl. I tend to break many keys.



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: speed and perl

2002-08-02 Thread Nikola Janceski

What? you mean maintainable, effective code is ruining the economy? This is
a joke right?
Microsoft follows this idea, but they really are in it just for the money
and nothing else, and that is ruining our economy.

Microsoft idealogy:
1. Write it well enough to be easy to use.
2. get everyone on your software.
3. pass better software (aka "enhancements") later with flaws still.
4. force better computers to run the new software (ineffecient code).
5. repeat step 3.

But if you write it well the first time you don't make as much money,
but you gain lots more respect and reliablity, so when you do send out
enhancements, they won't be in quotes *quote motion with fingers*.

the Microsoft idea is good for games and NON-CRITICAL systems.
but you would want reliablity for critical things.

Yeah you can rent the cheap scuba gear, but would you trust it?


> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 1:07 PM
> To: begin begin
> Subject: Re: speed and perl
> 
> 
> 
> On Friday, August 2, 2002, at 08:36 , Dennis G. Wicks wrote:
> > On Fri, 2 Aug 2002, Jenda Krynicky wrote:
> >
> >>Computing power is cheap, programmers' time is expensive!
> [..]
> > The cost of inefficient programs is cumulative and results
> > in increasing all the infrastructure costs because of the
> > requirement for more and more "cheap" computing power.
> [..]
> 
> but that also means more goods and services as more
> manufactured products are release to compensate for
> bad coding.
> 
> in like manner coding it badly the first time also
> means that if and when the project is identified
> as 'under-performing' - then of course there is
> all sorts of employment opportunity for managers,
> designers, and even software developers.
> 
[snip]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: speed and perl

2002-08-02 Thread Nikola Janceski

correct that I disapprove of NT based weapons systems.
Remember "Wargames" the movie? They couldn't shutdown 
WOPR in NORAD because the silos would carry out their
final orders.

"Incoming bogie, Colonel."
"Defcon 1. Ready silos for launch sequence."
"Sorry Colonel, my bad, it was just my new WindowsXP cursor."
"Take us back down to defcon 5."
"Sorry, no can do. GIANTWINDOW [new WOPR] is rebooting."
"Oh crap."


> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 02, 2002 2:23 PM
> To: Beginners (E-mail)
> Subject: Re: speed and perl
> 
> 
> 
> On Friday, August 2, 2002, at 10:23 , Nikola Janceski wrote:
> [..]
> > the Microsoft idea is good for games and NON-CRITICAL systems.
> > but you would want reliablity for critical things.
> [..]
> 
> I presume that you then disapprove of NT based
> weapons systems and avionics packages - and
> consider the idea of a system reboot as a
> corrective mechanism for fighter interceptors
> and other 'fly by wire' technologies to be
> a sub-optimal survival strategy?
> 
> or am I merely reading into your position.
> 
> ciao
> drieux
> 
> ---
> 
> When You absolutely, Positively, Have to get it RIGHT
>   the first time.
> 
> It may help to work from a solid design on proven
>   technology that works, not merely that sells well...
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Deep copy

2002-08-09 Thread Nikola Janceski

Hey anyone have the link handy that explained deep copying and had the
simplest little code snip to make deep copies?

Nikola Janceski

We are such stuff as dreams are made on, rounded with a little sleep.
-- William Shakespeare




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Deep copy

2002-08-09 Thread Nikola Janceski

Deep copy.
I have a data structure (hashes of hashes)
I want to make a real/deep copy of the values to store elsewhere.
So when I change the values of one, the references don't point to the same
values as the original data structure.
hence deep copy.


> -Original Message-
> From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 09, 2002 9:44 AM
> To: Nikola Janceski; Beginners (E-mail)
> Subject: RE: Deep copy
> 
> 
> What you mean by deep copy ?
> Be more clear :-)
> 
> José.
> 
> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, August 09, 2002 3:40 PM
> To: Beginners (E-mail)
> Subject: Deep copy
> 
> 
> Hey anyone have the link handy that explained deep copying 
> and had the simplest little code snip to make deep copies?
> 
> Nikola Janceski
> 
> We are such stuff as dreams are made on, rounded with a little sleep.
> -- William Shakespeare
> 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's own, and do not necessarily represent the views 
> and opinions of Summit Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
>  DISCLAIMER 
> 
> "This e-mail and any attachment thereto may contain 
> information which is confidential and/or protected by 
> intellectual property rights and are intended for the sole 
> use of the recipient(s) named above. 
> Any use of the information contained herein (including, but 
> not limited to, total or partial reproduction, communication 
> or distribution in any form) by other persons than the 
> designated recipient(s) is prohibited. 
> If you have received this e-mail in error, please notify the 
> sender either by telephone or by e-mail and delete the 
> material from any computer".
> 
> Thank you for your cooperation.
> 
> For further information about Proximus mobile phone services 
> please see our website at http://www.proximus.be or refer to 
> any Proximus agent.
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Deep copy

2002-08-09 Thread Nikola Janceski

http://www.stonehenge.com/merlyn/UnixReview/col30.html

Found it. Interesting read once you get into large complex data structures.

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 09, 2002 9:46 AM
> To: 'NYIMI Jose (BMB)'; Nikola Janceski; Beginners (E-mail)
> Subject: RE: Deep copy
> 
> 
> Deep copy.
> I have a data structure (hashes of hashes)
> I want to make a real/deep copy of the values to store elsewhere.
> So when I change the values of one, the references don't 
> point to the same
> values as the original data structure.
> hence deep copy.
> 
> 
> > -Original Message-
> > From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 09, 2002 9:44 AM
> > To: Nikola Janceski; Beginners (E-mail)
> > Subject: RE: Deep copy
> > 
> > 
> > What you mean by deep copy ?
> > Be more clear :-)
> > 
> > José.
> > 
> > -Original Message-
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, August 09, 2002 3:40 PM
> > To: Beginners (E-mail)
> > Subject: Deep copy
> > 
> > 
> > Hey anyone have the link handy that explained deep copying 
> > and had the simplest little code snip to make deep copies?
> > 
> > Nikola Janceski
> > 
> > We are such stuff as dreams are made on, rounded with a 
> little sleep.
> > -- William Shakespeare
> > 
> > 
> > --
> > --
> > 
> > The views and opinions expressed in this email message are 
> > the sender's own, and do not necessarily represent the views 
> > and opinions of Summit Systems Inc.
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> >  DISCLAIMER 
> > 
> > "This e-mail and any attachment thereto may contain 
> > information which is confidential and/or protected by 
> > intellectual property rights and are intended for the sole 
> > use of the recipient(s) named above. 
> > Any use of the information contained herein (including, but 
> > not limited to, total or partial reproduction, communication 
> > or distribution in any form) by other persons than the 
> > designated recipient(s) is prohibited. 
> > If you have received this e-mail in error, please notify the 
> > sender either by telephone or by e-mail and delete the 
> > material from any computer".
> > 
> > Thank you for your cooperation.
> > 
> > For further information about Proximus mobile phone services 
> > please see our website at http://www.proximus.be or refer to 
> > any Proximus agent.
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




XML::Simple help needed PLEASE!

2002-08-12 Thread Nikola Janceski

I have read and re-read the docs for this module but can't get my thing to
work.

I have an XML file generated by XML::Simple that looks like

  
  
  


When I use XMLin() the data structure looke like:
$VAR1 = {
  'XXX' => {
 'date' => '8/12/2002',
 'name' => 'V3.2.1',
 'show' => '1'
   },
  '' => {
  'V2.6e2.10' => {
   'date' => '8/12/2002',
   'show' => '0'
 },
  'V3.0.8' => {
'date' => '8/12/2002',
'show' => '1'
  }
}
}

they  portion is right but only for items that have more than one
version.
XXX has only one version and that should have been the second key.

I read the docs and it says that keyattr is by default ['name', 'key',
'id'], but it's not acting that way for all the items.

Can someone shed some light as to why it's behaving this way?

Thanx in advance,

Nikola Janceski

The mere formulation of a problem is far more essential than its solution,
which may be merely a matter of mathematical or experimental skills. To
raise new questions, new possibilities, to regard old problems from a new
angle requires creative imagination and marks real advances in science.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: add_delta_workdays from Date::Calendar not returning what I'd expect

2002-08-12 Thread Nikola Janceski

you know that 7 is Sunday?
you know that 1 is Monday?
right? (this confused me to death for a long time with Date::Calc)

> -Original Message-
> From: Ian Zapczynski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 1:58 PM
> To: [EMAIL PROTECTED]
> Subject: add_delta_workdays from Date::Calendar not returning what I'd
> expect
> 
> 
> Hello all,
> 
> I hope this is not too specific for this list.  If so, please let me
> know if you have suggestions on a better place to seek the answer for
> this.
> 
> In the code below, I am using add_delta_workdays from 
> Date::Calendar to
> check if yesterday was a business day.  My problem is that it seems to
> work when checking for holidays, but when the script runs on 
> a Saturday
> or Sunday, it reports that the previous business day was Thursday, and
> *not* Friday as I'd expect.  However, on a Monday, it properly
> identifies the previous business day as the previous Friday.  So I am
> quite perplexed.
> 
> If anyone out there has a moment to lend some insight, this script can
> be easily tested by first running it with the system date set properly
> as today, and then setting the date to be either Saturday, August 10th
> or Sunday, August 11th (although it happens with any Saturday 
> or Sunday
> I've tried).  The dates are not printed out in the same 
> precise format,
> but you'll get the idea.
> 
> I hesitate to assume this would be a bug in the module since 
> it has been
> a stable release for so long, so I could really use another 
> opinion.  Or
> if you don't receive the same results, perhaps it could be 
> something in
> my environment.
> 
> Thanks!!
> 
> -Ian
> 
> -
> 
> #!/usr/bin/perl
> #
> use strict;
> use Date::Calc qw(:all);
> use Date::Calendar;
> use Date::Calendar::Profiles qw( $Profiles );
> 
> my ($year,$month,$day) = Date::Calc->Today();
> 
> # figure out what day yesterday was so we can determine if it matches
> the previous business day
> my ($yesteryear,$yestermonth,$yesterday) =
> Add_Delta_Days($year,$month,$day, -1);
> 
> # now find out what Date::Calendar says the previous business day is
> based on the standard US profile
> my ($cal) = Date::Calendar->new( $Profiles->{'US'} );
> my ($prevdate) = $cal->add_delta_workdays($year,$month,$day, -1);
> 
> print "today is $year-$month-$day \n";
> print "yesterday is $yesteryear-$yestermonth-$yesterday \n";
> print "the previous business day is $prevdate \n";
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: add_delta_workdays from Date::Calendar not returning what I'd expect

2002-08-12 Thread Nikola Janceski

just ran your script as is.. and the date is fine for me

output:

today is 2002-8-12 
yesterday is 2002-8-11 
the previous business day is 20020809 

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 2:06 PM
> To: 'Ian Zapczynski'; [EMAIL PROTECTED]
> Subject: RE: add_delta_workdays from Date::Calendar not returning what
> I'd expect
> 
> 
> you know that 7 is Sunday?
> you know that 1 is Monday?
> right? (this confused me to death for a long time with Date::Calc)
> 
> > -Original Message-
> > From: Ian Zapczynski [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, August 12, 2002 1:58 PM
> > To: [EMAIL PROTECTED]
> > Subject: add_delta_workdays from Date::Calendar not 
> returning what I'd
> > expect
> > 
> > 
> > Hello all,
> > 
> > I hope this is not too specific for this list.  If so, please let me
> > know if you have suggestions on a better place to seek the 
> answer for
> > this.
> > 
> > In the code below, I am using add_delta_workdays from 
> > Date::Calendar to
> > check if yesterday was a business day.  My problem is that 
> it seems to
> > work when checking for holidays, but when the script runs on 
> > a Saturday
> > or Sunday, it reports that the previous business day was 
> Thursday, and
> > *not* Friday as I'd expect.  However, on a Monday, it properly
> > identifies the previous business day as the previous 
> Friday.  So I am
> > quite perplexed.
> > 
> > If anyone out there has a moment to lend some insight, this 
> script can
> > be easily tested by first running it with the system date 
> set properly
> > as today, and then setting the date to be either Saturday, 
> August 10th
> > or Sunday, August 11th (although it happens with any Saturday 
> > or Sunday
> > I've tried).  The dates are not printed out in the same 
> > precise format,
> > but you'll get the idea.
> > 
> > I hesitate to assume this would be a bug in the module since 
> > it has been
> > a stable release for so long, so I could really use another 
> > opinion.  Or
> > if you don't receive the same results, perhaps it could be 
> > something in
> > my environment.
> > 
> > Thanks!!
> > 
> > -Ian
> > 
> > -
> > 
> > #!/usr/bin/perl
> > #
> > use strict;
> > use Date::Calc qw(:all);
> > use Date::Calendar;
> > use Date::Calendar::Profiles qw( $Profiles );
> > 
> > my ($year,$month,$day) = Date::Calc->Today();
> > 
> > # figure out what day yesterday was so we can determine if 
> it matches
> > the previous business day
> > my ($yesteryear,$yestermonth,$yesterday) =
> > Add_Delta_Days($year,$month,$day, -1);
> > 
> > # now find out what Date::Calendar says the previous business day is
> > based on the standard US profile
> > my ($cal) = Date::Calendar->new( $Profiles->{'US'} );
> > my ($prevdate) = $cal->add_delta_workdays($year,$month,$day, -1);
> > 
> > print "today is $year-$month-$day \n";
> > print "yesterday is $yesteryear-$yestermonth-$yesterday \n";
> > print "the previous business day is $prevdate \n";
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: deprewhat?

2002-08-12 Thread Nikola Janceski

read:

perldoc -f split

 split /PATTERN/,EXPR,LIMIT
 split /PATTERN/,EXPR
 split /PATTERN/
 split   Splits a string into a list of strings and returns
 that list.  By default, empty leading fields are
 preserved, and empty trailing ones are deleted.

 In scalar context, returns the number of fields
 found and splits into the "@_" array.  Use of split
 in scalar context is deprecated, however, because it
 clobbers your subroutine arguments.

[snip]

you are using split in scalar context. Anyone know what's the solution to
get around this? other than turning off warnings.

> -Original Message-
> From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 5:29 PM
> To: '[EMAIL PROTECTED]'
> Subject: deprewhat?
> 
> 
> 
> What does this mean?
> 
> Use of implicit split to @_ is deprecated at UNIX_prelim.pl line 344.
> 
> line 344: $policyCount = split (/\t/, $violations{$vID}); 
> 
> -Sarah
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: News from Prague

2002-08-14 Thread Nikola Janceski

[off topic]
I think drieux has finally lost it.
What *it* is, I do not know.
Don't know if I have *it* either.

> -Original Message-
> From: drieux [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 10:36 AM
> To: begin begin
> Subject: Re: News from Prague
> 
> 
> 
> On Wednesday, August 14, 2002, at 03:33 , Jenda Krynicky wrote:
> 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




possible RFC?

2002-08-14 Thread Nikola Janceski

WTF doesn't perl -c check for valid subroutines/function calls?

I can write a perlscript calling a function that doesn't exist but perl -c
will say syntax ok.
ie:
% perl -ce "nothing_here('some junk')"
-e syntax OK

% perl -e "nothing_here('some junk')"
Undefined subroutine &main::nothing_here called at -e line 1.

That doesn't make sense!
It should check function calls at compile time, correct?
So why not for -c?

Excuse me if I have overstepped my bounds. I still love Perl regardless, but
it can be better.

Nikola Janceski

The significant problems we face today cannot be solved at the same level of
thinking we were at when we created them.
-- Albert Einstein (1879-1955) 


PS. I still drool over the apocalypse papers on Perl 6. I can't wait!



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: possible RFC?

2002-08-14 Thread Nikola Janceski

Okay I understand the dynamic subroutine declarations.
but perhaps a warning should be made for -w or 'use warnings'?

It's just to find misspelled functions. I use 'use strict' for finding
misspelled vars.
Is there nothing for finding misspelled functions, aside from running it and
hoping for the best?

Nikola Janceski

What counts is not necessarily the size of the dog in the fight - it's the
size of the fight in the dog.
-- Dwight D. Eisenhower




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Active State

2002-08-15 Thread Nikola Janceski

Looks like you got an incomplete download.
Try re-dl-ing it.

> -Original Message-
> From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 15, 2002 11:36 AM
> To: drieux; begin begin
> Subject: RE: Active State
> 
> gzip -d/gunzip  ActivePerl-5.6.1.633-sun4-solaris.tar.gz  (tried both)
> tar -xvf ActivePerl-5.6.1.633-sun4-solaris.tar
> 
> Segment error!!
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




undef of nested data structures

2002-08-15 Thread Nikola Janceski

I am wondering how undef works.

I know that undef will undefine a variable if used like undef($scalar);
I also know that it doesn't actually free up the memory but tells Perl that
it's now available to be recycled for other data.

but what about nested data (ie. hashes of hashes, arrays of arrays, etc.).
if $ref is a reference to a nested structure (let's say a hash of hashes).
will - 
undef $ref;
 - undefine the enitre nested data structure if no other variables contain
references to any part of it? (assuming no cyclical references)

if not, how would you free it so Perl can reuse it?

Nikola Janceski

Leaders who win the respect of others are the ones who deliver more than
they promise, not the ones who promise more than they can deliver.
-- Mark A. Clement 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How fatalsToBrowser works ?

2002-08-16 Thread Nikola Janceski



Can we have a weekly FAQ on cross posting?
Kinda like:

Subject: Weekly FAQ on cross posting

Don't do it.



> -Original Message-
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 11:38 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: How fatalsToBrowser works ?
> 
> 
> I am on a Win32 system, and  I use the fatalsToBrowser to 
> prompt errors 
> with some scripts. However, the error mesg will also prompt 
> where exactly
> the file(script) is located. In case, I don't want the full 
> path is exposed.
> Can I modify sth , perhaps regex s///, to mask the root path ?
> 
> like :
> File not found : html/log/connie.txt at 
> C:\WWWroot\CGI-ALL\index.pl line 12.
> 
> is better be masked as :
> File not found : html/log/connie.txt at /index.pl line 12.
> 
> Is that possible ?
> 
> Rgds,
> Connie
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Wierd error...

2002-08-16 Thread Nikola Janceski

ld.so.1: //perl-5.6.1-unix/bin/perl: fatal: relocation error: file
//perl-5.6.1-unix/bin/perl: symbol fopen64: referenced symbol not found

I suddenly got this error when running a script that I had run an hour ago
with no problem.
I am on a shared env. but this is my private build of perl.

anyone know what can cause this? and how to resolve it?

Nikola Janceski

This is your life and it's ending one minute at a time.
-- Jack ('Fight Club')




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Wierd error...

2002-08-16 Thread Nikola Janceski

it occured on this line in my code:

die "Something went wrong with '$RSH $OS->{$ext}{machine} $GATHER_INFO $ext
$OS->{$ext}{dir}' command exit status $?"
if system( $RSH, "-n", $OS->{$ext}{machine}, "$GATHER_INFO $ext
$OS->{$ext}{dir}" );

this runs a script on another computer.

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 3:49 PM
> To: Beginners (E-mail)
> Subject: Wierd error...
> 
> 
> ld.so.1: //perl-5.6.1-unix/bin/perl: fatal: relocation error: file
> //perl-5.6.1-unix/bin/perl: symbol fopen64: referenced 
> symbol not found
> 
> I suddenly got this error when running a script that I had 
> run an hour ago
> with no problem.
> I am on a shared env. but this is my private build of perl.
> 
> anyone know what can cause this? and how to resolve it?
> 
> Nikola Janceski
> 
> This is your life and it's ending one minute at a time.
> -- Jack ('Fight Club')
> 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Wierd error...

2002-08-16 Thread Nikola Janceski

I am a dumbass..
I was trying to run a solaris 2.6 compiled version of perl on solaris 2.5.

DUh...

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 3:52 PM
> To: Nikola Janceski; Beginners (E-mail)
> Subject: RE: Wierd error...
> 
> 
> it occured on this line in my code:
> 
> die "Something went wrong with '$RSH $OS->{$ext}{machine} 
> $GATHER_INFO $ext
> $OS->{$ext}{dir}' command exit status $?"
> if system( $RSH, "-n", $OS->{$ext}{machine}, "$GATHER_INFO $ext
> $OS->{$ext}{dir}" );
> 
> this runs a script on another computer.
> 
> > -Original Message-
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 16, 2002 3:49 PM
> > To: Beginners (E-mail)
> > Subject: Wierd error...
> > 
> > 
> > ld.so.1: //perl-5.6.1-unix/bin/perl: fatal: relocation 
> error: file
> > //perl-5.6.1-unix/bin/perl: symbol fopen64: referenced 
> > symbol not found
> > 
> > I suddenly got this error when running a script that I had 
> > run an hour ago
> > with no problem.
> > I am on a shared env. but this is my private build of perl.
> > 
> > anyone know what can cause this? and how to resolve it?
> > 
> > Nikola Janceski
> > 
> > This is your life and it's ending one minute at a time.
> > -- Jack ('Fight Club')
> > 
> > 
> > --
> > --
> > 
> > The views and opinions expressed in this email message are 
> > the sender's
> > own, and do not necessarily represent the views and 
> opinions of Summit
> > Systems Inc.
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another reg needed

2002-08-16 Thread Nikola Janceski

probably what you wanted is:

($row, $col) = /(\d+)/g;

> -Original Message-
> From: Jerry Preston [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 4:49 PM
> To: Connie Chan; Beginners Perl
> Subject: RE: another reg needed
> 
> 
> Connie,
> 
> This is what I am looking for!  But all I get is','.
> 
> Thanks,
> 
> Jerry
> 
> -Original Message-
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 3:34 PM
> To: [EMAIL PROTECTED]; Beginners Perl
> Subject: Re: another reg needed
> 
> 
> > $_ = "Die,Row 0, Column 12"
> 
> do you trying to get this ?
> 
> my ($row, $col) = ($1, $2) =~ m/^.+(\d+).+(\d+)$/;
> # $row = 0;
> # $col = 12;
> 
> /^ means beginning of line
> ..+ means anything
> \d+ means 1 more more digit numbers
> (xxx) capture matched values within blankets in order to $1, $2...$x.
> $/ means the end of the line.
> 
> > 
> > What I want is the 0 and 12.  What about the text?
> > 
> 
> So what do you want to deal with the text ? 
> 
> Rgds,
> Connie
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another reg needed

2002-08-16 Thread Nikola Janceski

doh... forgot the ~

($row, $col) =~ /(\d+)/g;

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 4:54 PM
> To: '[EMAIL PROTECTED]'; Connie Chan; Beginners Perl
> Subject: RE: another reg needed
> 
> 
> probably what you wanted is:
> 
> ($row, $col) = /(\d+)/g;
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: another reg needed

2002-08-16 Thread Nikola Janceski

soorry.. long week.
Brain malfunction, shouldn't have ~
you aren't doing a bitwise, you want the assignment.

this is right:
($row, $col) = /(\d+)/g;

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 4:56 PM
> To: Nikola Janceski; '[EMAIL PROTECTED]'; Connie Chan; Beginners Perl
> Subject: RE: another reg needed
> 
> 
> doh... forgot the ~
> 
> ($row, $col) =~ /(\d+)/g;
> 
> > -Original Message-
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 16, 2002 4:54 PM
> > To: '[EMAIL PROTECTED]'; Connie Chan; Beginners Perl
> > Subject: RE: another reg needed
> > 
> > 
> > probably what you wanted is:
> > 
> > ($row, $col) = /(\d+)/g;
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Problems with rsh command

2002-08-19 Thread Nikola Janceski

I have posted this to XML and no response there. so maybe it's simpler than
that...

I have script that uses XML::Simple, which works when run via command line:
/yyy/TreeInfo/tmp/gather_os_info.pl

but if run it via an rsh command (on the same host for now):
/bin/rsh host1 /yyy/TreeInfo/tmp/gather_os_info.pl

I get the following error:
Can't locate object method "new" via package "XML::SAX::PurePerl" (perhaps
you forgot to load "XML::SAX::PurePerl"?) at
/yyy/perl-5.6.1-unix/lib/perl5/site_perl/5.6.1/XML/SAX/ParserFactory.pm line
37.

** NOTE **: Specifically it fails on the XMLin() function call supplied by
XML::Simple.

Strange huh? host1 is the same host where I tested it via command line
alone.

Please I can't figure this one out for the life of me.

Thanx in advance,

Nikola Janceski

When I am working on a problem I never think about beauty. I only think
about how to solve the problem. But when I have finished, if the solution is
not beautiful, I know it is wrong.
-- Buckminster Fuller (1895-1983) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with rsh command

2002-08-19 Thread Nikola Janceski

nope.. then it would be able to get that far.

Remember I have:
use XML::Simple;

Which calls other modules (XML::SAX etc.)
but stranger is that PurePerl.pm is in the same dir as the ParserFactory.pm.

plus the onlything I have in my PERL5LIB env var is my private module dirs.
I use 'use lib' all the time anyway.

> -Original Message-
> From: Tanton Gibbs [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 19, 2002 3:44 PM
> To: Nikola Janceski; Beginners (E-mail)
> Subject: Re: Problems with rsh command
> 
> 
> One thing you might check is your PERL5LIB environment 
> variable when you rsh
> vs when you login.  It could be that rsh does not run your 
> .profile and
> therefore does not set up your environment variables thereby 
> prohibiting
> perl from seeing the appropriate libraries.




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with rsh command

2002-08-19 Thread Nikola Janceski

host1 is one host. the only host that I have been testing this on.
via command line it works.
via rsh command line it doesn't.
via rsh to command prompt, then command lining it, it works.

It looks like it is differences in the env. vars.
essentially when I use rsh and run a command (ie rsh host1 env) the env is
pretty damn empty.
but when I just rsh to the host the env comes back full (ie rsh host [wait
for prompt] env).

now to think of a way to fix this... better to know what env to set so I can
set it in the script.

Thanx for your help!

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 19, 2002 3:50 PM
> To: 'Tanton Gibbs'; Beginners (E-mail)
> Subject: RE: Problems with rsh command
> 
> 
> nope.. then it would be able to get that far.
> 
> Remember I have:
> use XML::Simple;
> 
> Which calls other modules (XML::SAX etc.)
> but stranger is that PurePerl.pm is in the same dir as the 
> ParserFactory.pm.
> 
> plus the onlything I have in my PERL5LIB env var is my 
> private module dirs.
> I use 'use lib' all the time anyway.
> 
> > -Original Message-
> > From: Tanton Gibbs [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, August 19, 2002 3:44 PM
> > To: Nikola Janceski; Beginners (E-mail)
> > Subject: Re: Problems with rsh command
> > 
> > 
> > One thing you might check is your PERL5LIB environment 
> > variable when you rsh
> > vs when you login.  It could be that rsh does not run your 
> > .profile and
> > therefore does not set up your environment variables thereby 
> > prohibiting
> > perl from seeing the appropriate libraries.
> 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski

er.. see correction

> -Original Message-
> From: Angerstein [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 9:00 AM
> To: [EMAIL PROTECTED]
> Subject: AW: how to make a regex for a ip address
> 
> 
> What about:
> /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/

/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/

> 
> or
> 
> @ip = split (/\./);
> foreach $part (@ip) {
>   if ( $part > 255 && $part =~ /\d?\d?\d\/ ) {

if ( $part > 255 && $part =~ /^\d{1,3}$/ ) {

>   die "That´s not an IP";
>   }
> }
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski

But that would match

000255.000255.000255.000255.

hehehe :)

I like the split loop check.

> -Original Message-
> From: Samy Kamkar [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 9:02 AM
> To: Angerstein
> Cc: [EMAIL PROTECTED]
> Subject: Re: AW: how to make a regex for a ip address
> 
> 
> /^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/
> 
> -Samy
> 
> Angerstein wrote:
> 
> > What about:
> > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/
> > 
> > or
> > 
> > @ip = split (/\./);
> > foreach $part (@ip) {
> > if ( $part > 255 && $part =~ /\d?\d?\d\/ ) {
> > die "That´s not an IP";
> > }
> > }
> > 
> > 
> >>-Ursprüngliche Nachricht-
> >>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im 
> Auftrag von
> >>zentara
> >>Gesendet am: Dienstag, 20. August 2002 14:50
> >>An: [EMAIL PROTECTED]
> >>Betreff: Re: how to make a regex for a ip address
> >>
> >>On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] 
> (Root) wrote:
> >>
> >>>for a one liner:
> >>>
> >>>$_ = '12.34.56.78';
> >>>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not
> >>>
> >>valid ip: $_\n");
> >>
> >>I tried this with $_ = '1234.2345.56.78';  and received no warning.
> >>That's not good.
> >>
> >>
> >>
> >>--
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> > 
> > 
> 
> 
> -- 
> Samy Kamkar -- cp5 -- [EMAIL PROTECTED]
> LucidX.com / LA.pm.org / code.LucidX.com
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski

oh and anything else after that last .

000255.000255.000255.000255.slkfdja;ljd;alkjf;lajkd;ljkasfljka;ljdkf;lajsdl;
jkf;lsajd

> -Original Message-
> From: Nikola Janceski 
> Sent: Tuesday, August 20, 2002 9:12 AM
> To: 'Samy Kamkar'; Angerstein
> Cc: [EMAIL PROTECTED]
> Subject: RE: AW: how to make a regex for a ip address
> 
> 
> But that would match
> 
> 000255.000255.000255.000255.
> 
> hehehe :)
> 
> I like the split loop check.
> 
> > -Original Message-
> > From: Samy Kamkar [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 20, 2002 9:02 AM
> > To: Angerstein
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: AW: how to make a regex for a ip address
> > 
> > 
> > /^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/
> > 
> > -Samy
> > 
> > Angerstein wrote:
> > 
> > > What about:
> > > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/
> > > 
> > > or
> > > 
> > > @ip = split (/\./);
> > > foreach $part (@ip) {
> > >   if ( $part > 255 && $part =~ /\d?\d?\d\/ ) {
> > >   die "That´s not an IP";
> > >   }
> > > }
> > > 
> > > 
> > >>-Ursprüngliche Nachricht-
> > >>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im 
> > Auftrag von
> > >>zentara
> > >>Gesendet am: Dienstag, 20. August 2002 14:50
> > >>An: [EMAIL PROTECTED]
> > >>Betreff: Re: how to make a regex for a ip address
> > >>
> > >>On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] 
> > (Root) wrote:
> > >>
> > >>>for a one liner:
> > >>>
> > >>>$_ = '12.34.56.78';
> > >>>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not
> > >>>
> > >>valid ip: $_\n");
> > >>
> > >>I tried this with $_ = '1234.2345.56.78';  and received 
> no warning.
> > >>That's not good.
> > >>
> > >>
> > >>
> > >>--
> > >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > > 
> > > 
> > 
> > 
> > -- 
> > Samy Kamkar -- cp5 -- [EMAIL PROTECTED]
> > LucidX.com / LA.pm.org / code.LucidX.com
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski

/^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9
]|[0-1][0-9]{2}|[1-9]{1,2})$/

shortened from stephen's just a bit.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 9:17 AM
> To: [EMAIL PROTECTED]
> Subject: RE: AW: how to make a regex for a ip address
> 
> 
> /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]
> )\.(25[0-5]|2[
> 0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]
> |2[0-4][0-9]|[
> 0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9
> ]|[0-1]{1}[0-9
> ]{2}|[1-9]{1}[0-9]{1}|[0-9])$/ 
> 
> Stephen Redding
> 
> BT Ignite Solutions
> Telephone - 0113 237 3277
> Fax - 0113 244 1413
> Email - [EMAIL PROTECTED]
> http://www.technet.bt.com/sit/public/
> 
> 
> British Telecommunications plc
> Registered office: 81 Newgate Street London EC1A 7AJ
> Registered in England no. 180
> This electronic message contains information from British 
> Telecommunications
> plc which may be privileged or  confidential. The information 
> is intended to
> be for the use of the individual(s) or entity named above. If 
> you  are not
> the intended recipient be aware that any disclosure, copying, 
> distribution
> or use of the contents of  this information is prohibited. If you have
> received this electronic message in error, please notify us 
> by  telephone or
> email (to the numbers or address above) immediately.
> 
> 
> 
> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 14:13
> To: Nikola Janceski; 'Samy Kamkar'; 'Angerstein'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: AW: how to make a regex for a ip address
> 
> 
> oh and anything else after that last .
> 
> 000255.000255.000255.000255.slkfdja;ljd;alkjf;lajkd;ljkasfljka
> ;ljdkf;lajsdl;
> jkf;lsajd
> 
> > -Original Message-
> > From: Nikola Janceski 
> > Sent: Tuesday, August 20, 2002 9:12 AM
> > To: 'Samy Kamkar'; Angerstein
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: AW: how to make a regex for a ip address
> > 
> > 
> > But that would match
> > 
> > 000255.000255.000255.000255.
> > 
> > hehehe :)
> > 
> > I like the split loop check.
> > 
> > > -Original Message-
> > > From: Samy Kamkar [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, August 20, 2002 9:02 AM
> > > To: Angerstein
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: AW: how to make a regex for a ip address
> > > 
> > > 
> > > /^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/
> > > 
> > > -Samy
> > > 
> > > Angerstein wrote:
> > > 
> > > > What about:
> > > > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/
> > > > 
> > > > or
> > > > 
> > > > @ip = split (/\./);
> > > > foreach $part (@ip) {
> > > > if ( $part > 255 && $part =~ /\d?\d?\d\/ ) {
> > > > die "That´s not an IP";
> > > > }
> > > > }
> > > > 
> > > > 
> > > >>-Ursprüngliche Nachricht-
> > > >>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im 
> > > Auftrag von
> > > >>zentara
> > > >>Gesendet am: Dienstag, 20. August 2002 14:50
> > > >>An: [EMAIL PROTECTED]
> > > >>Betreff: Re: how to make a regex for a ip address
> > > >>
> > > >>On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] 
> > > (Root) wrote:
> > > >>
> > > >>>for a one liner:
> > > >>>
> > > >>>$_ = '12.34.56.78';
> > > >>>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not
> > > >>>
> > > >>valid ip: $_\n");
> > > >>
> > > >>I tried this with $_ = '1234.2345.56.78';  and received 
> > no warning.
> > > >>That's not good.
> > > >>
> > > >>
> > > >>
> > > >>--
> > > >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >>For additional commands, e-mail: [EMAIL PROTECTED]
> > > >>
> > > >>
> > > >>
> > > > 
> > > > 
> > > 
> > > 
> > > -- 
> > > Samy Kamkar -- cp5 -- [EMAIL PROTECTED]
> > > LucidX.com / LA.pm.org / code.LucidX.com
> > > 
> > > 
> > > -- 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski

Ooopss... mistake
/^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9
]|[0-1][0-9]{2}|[0-9]{1,2})$/
 ^
^   

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 9:28 AM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: AW: how to make a regex for a ip address
> 
> 
> /^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9]{1,2})\.){3}(25[0
> -5]|2[0-4][0-9
> ]|[0-1][0-9]{2}|[1-9]{1,2})$/
> 
> shortened from stephen's just a bit.
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 20, 2002 9:17 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: AW: how to make a regex for a ip address
> > 
> > 
> > /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]
> > )\.(25[0-5]|2[
> > 0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]
> > |2[0-4][0-9]|[
> > 0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9
> > ]|[0-1]{1}[0-9
> > ]{2}|[1-9]{1}[0-9]{1}|[0-9])$/ 
> > 
> > Stephen Redding
> > 
> > BT Ignite Solutions
> > Telephone - 0113 237 3277
> > Fax - 0113 244 1413
> > Email - [EMAIL PROTECTED]
> > http://www.technet.bt.com/sit/public/
> > 
> > 
> > British Telecommunications plc
> > Registered office: 81 Newgate Street London EC1A 7AJ
> > Registered in England no. 180
> > This electronic message contains information from British 
> > Telecommunications
> > plc which may be privileged or  confidential. The information 
> > is intended to
> > be for the use of the individual(s) or entity named above. If 
> > you  are not
> > the intended recipient be aware that any disclosure, copying, 
> > distribution
> > or use of the contents of  this information is prohibited. 
> If you have
> > received this electronic message in error, please notify us 
> > by  telephone or
> > email (to the numbers or address above) immediately.
> > 
> > 
> > 
> > -Original Message-
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 20, 2002 14:13
> > To: Nikola Janceski; 'Samy Kamkar'; 'Angerstein'
> > Cc: '[EMAIL PROTECTED]'
> > Subject: RE: AW: how to make a regex for a ip address
> > 
> > 
> > oh and anything else after that last .
> > 
> > 000255.000255.000255.000255.slkfdja;ljd;alkjf;lajkd;ljkasfljka
> > ;ljdkf;lajsdl;
> > jkf;lsajd
> > 
> > > -Original Message-
> > > From: Nikola Janceski 
> > > Sent: Tuesday, August 20, 2002 9:12 AM
> > > To: 'Samy Kamkar'; Angerstein
> > > Cc: [EMAIL PROTECTED]
> > > Subject: RE: AW: how to make a regex for a ip address
> > > 
> > > 
> > > But that would match
> > > 
> > > 000255.000255.000255.000255.
> > > 
> > > hehehe :)
> > > 
> > > I like the split loop check.
> > > 
> > > > -Original Message-
> > > > From: Samy Kamkar [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, August 20, 2002 9:02 AM
> > > > To: Angerstein
> > > > Cc: [EMAIL PROTECTED]
> > > > Subject: Re: AW: how to make a regex for a ip address
> > > > 
> > > > 
> > > > /^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/
> > > > 
> > > > -Samy
> > > > 
> > > > Angerstein wrote:
> > > > 
> > > > > What about:
> > > > > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/
> > > > > 
> > > > > or
> > > > > 
> > > > > @ip = split (/\./);
> > > > > foreach $part (@ip) {
> > > > >   if ( $part > 255 && $part =~ /\d?\d?\d\/ ) {
> > > > >   die "That´s not an IP";
> > > > >   }
> > > > > }
> > > > > 
> > > > > 
> > > > >>-Ursprüngliche Nachricht-
> > > > >>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im 
> > > > Auftrag von
> > > > >>zentara
> > > > >>Gesendet am: Dienstag, 20. August 2002 14:50
> > > > >>An: [EMAIL PROTECTED]
> > > > >>Betreff: Re: how to make a regex for a ip address
> > > > >>
> > > > >>On Mon, 19 Aug 2002 12:0

RE: newbie question

2002-08-20 Thread Nikola Janceski

It's not a bug as I see it. You gurus must have told the compiler that $|
can only hold a 0 or 1 for whatever reason;

Just because something isn't documented, doesn't make it a bug.

But even in the docs it tells you,
"The following names have special meaning to Perl."
Translation: "Don't do crap with it, unless it's for it's special purpose."


> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 5:22 PM
> To: [EMAIL PROTECTED]
> Subject: Re: newbie question
> 
> 
> Kevin Meltzer wrote:
> > 
> > I'm curious as to why. When I mentioned it on channel, a few people
> > didn't see it as a bug either, at first. Being that it is 
> using -- in a
> > way which isn't consistent with -- (it increments as opposed to
> > decrement). In fact, it isn't just with --/++ but + and - will yield
> > the same results. Anyways, just curious why you think that 
> subtracting
> > from 0 yields a 1 doesn't seem like a bug (and when adding 1 never
> > yields a 0).
> 
> Well, because Perl has lots of special cases like this.  Most people
> don't ever use $| let alone the special properties of $|--.  
> The average
> programmer just needs to know that setting $| to 1 turns on autoflush
> and setting $| to 0 turns off autoflush.  What about the fact that ++
> will increment a string but -- will not decrement it?
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Remove elements in an array from a different array

2002-08-21 Thread Nikola Janceski

use hashes.

my %HASH;
$HASH{$_}++ foreach @arr1;
delete $HASH{$_} foreach @arr2;

@arr1 = keys %HASH;

@arr1 now has ( one three five );

> -Original Message-
> From: Priss [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 21, 2002 8:54 AM
> To: [EMAIL PROTECTED]
> Subject: Remove elements in an array from a different array
> 
> 
> Hello,
> 
> I am very new to Perl, wonder if someone can help me
> with this... if I have:
> 
> @arr1 = qw (one two three four five);
> @arr2 = qw (two four);
> 
> How can I remove all elements from @arr2 from @arr1 so
> the new array will be @newarr = (one three five)?? 
> 
> Many thanks.
> 
> Priss
> 
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Remove elements in an array from a different array

2002-08-21 Thread Nikola Janceski

See inline comment:

> -Original Message-
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 21, 2002 8:58 AM
> To: 'Priss'; [EMAIL PROTECTED]
> Subject: RE: Remove elements in an array from a different array
> 
> 
> use hashes.
> 
> my %HASH;
> $HASH{$_}++ foreach @arr1;
> delete $HASH{$_} foreach @arr2;
> 
> @arr1 = keys %HASH;

To preserve the order change the above line to:
@arr1 = grep $HASH{$_}, @arr1;

> 
> @arr1 now has ( one three five );
> 
> > -Original Message-
> > From: Priss [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 21, 2002 8:54 AM
> > To: [EMAIL PROTECTED]
> > Subject: Remove elements in an array from a different array
> > 
> > 
> > Hello,
> > 
> > I am very new to Perl, wonder if someone can help me
> > with this... if I have:
> > 
> > @arr1 = qw (one two three four five);
> > @arr2 = qw (two four);
> > 
> > How can I remove all elements from @arr2 from @arr1 so
> > the new array will be @newarr = (one three five)?? 
> > 
> > Many thanks.
> > 
> > Priss
> > 
> > __
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Best way to save nested data structure.

2002-08-27 Thread Nikola Janceski

I learned that you can also use XML::Simple for this task.
It's working pretty well for me, but I think I have found a possible bug
which I am trying to setup replication steps for. But I think the bug isn't
with the module.

> -Original Message-
> From: Rowan Reid [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 26, 2002 6:51 PM
> To: [EMAIL PROTECTED]
> Subject: Best way to save nested data structure.
> 
> 
> 
> 
> 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 the same as accessing the contents of the hash
> 
>  
> Rowan Reid
> Job Captain, 
> Systems Administrator
> STUDIO 3 ARCHITECTS
> 909  982  1717
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: generating arrays on the fly

2002-08-27 Thread Nikola Janceski

perhaps a hash of arrays is what you want:

if ($line=~(/^\[\[(\w+)\]\]/)){
$HASH{$1} = [];
}


and you reference the array like

push @{ $HASH{'text'} }, "someinfo";

or anyother array functions.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 27, 2002 9:57 AM
> To: [EMAIL PROTECTED]
> Subject: generating arrays on the fly
> 
> 
> hi,
> 
> what I'm wanting to do is generate an array named after a 
> string that is
> found in a text file.
> 
> i.e something like this:
> if ($line=~(/^\[\[(\w+)\]\]/)){
> @$1=();   #this is the line I want to acheive my aim with!
> }
> 
> I know the syntax is wrong, but hopefully it explains what 
> I'm trying to
> do, any clues?
> 
> thanks,
> Adrian
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




globally scoped variables changed

2002-09-03 Thread Nikola Janceski

I am trying to pin point some error I am getting with a module (from some
old post that one person responded to).

I have narrowed it down some point elsewhere in MY programming.

The point is a backtick execution. ie. my @output = `some command that spews
output`;

QUESTION: What are all the possible globally scoped variables that backticks
can possible set/unset/change/populate?

Thanx!

Nikola Janceski

As far as I'm concerned, I prefer silent vice to ostentatious virtue.
-- Albert Einstein (1879-1955) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: globally scoped variables changed

2002-09-03 Thread Nikola Janceski

thnx to all for the feedback.
$! and $? is what I was looking for and anyothers which there aren't.

Now I am on a mission to find a bug in XML::Simple related to rsh, system
commands and lack of sanity.

> -Original Message-
> From: david [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 2:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: globally scoped variables changed
> 
> 
> backticks is simply an operator in Perl that tells Perl to 
> run something and 
> capture whatever that external program sends to standout. 
> backticks itself
> doesn't set/unset/change/pupulate any variables(well except 
> $!, $? etc when 
> Perl is having problem running your program and trying to 
> tell you that). 
> as far as user variable is concern, backticks doesn't change 
> any of those. 
> it's what you assign the output of backticks that matters. it 
> that case, 
> you can capture the output of backticks to anything you like 
> including:
> 
> my
> out
> local
> 
> david
> 
> backticks do not change any 
> Nikola Janceski wrote:
> 
> > I am trying to pin point some error I am getting with a 
> module (from some
> > old post that one person responded to).
> > 
> > I have narrowed it down some point elsewhere in MY programming.
> > 
> > The point is a backtick execution. ie. my @output = `some 
> command that
> > spews output`;
> > 
> > QUESTION: What are all the possible globally scoped variables that
> > backticks can possible set/unset/change/populate?
> > 
> > Thanx!
> > 
> > Nikola Janceski
> > 
> > As far as I'm concerned, I prefer silent vice to 
> ostentatious virtue.
> > -- Albert Einstein (1879-1955)
> > 
> > 
> > 
> --
> --
> > 
> > The views and opinions expressed in this email message are 
> the sender's
> > own, and do not necessarily represent the views and 
> opinions of Summit
> > Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: HELP !! displaying Associate Array value pairs

2002-09-04 Thread Nikola Janceski

love the mnemonic for $!,
"What just went bang?"

> -Original Message-
> From: david [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 04, 2002 1:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: HELP !! displaying Associate Array value pairs
> 
> 
> Quincy Ntuli wrote:
> 
> > open(INVIN, "$sortedListing[$i]") or die 
> "COULD NOT OPEN
> > $i\n";
> > 
> 
> if the open is failing, you probably want to know why($! 
> tells you why):
> 
> open(INVIN, $sortedListing[$i]) or die "COULD NOT OPEN $i: $!\n";
> 
> david
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Arrays inside

2002-09-06 Thread Nikola Janceski

see inline comments:

> -Original Message-
> From: Tobin, Elliot [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 9:55 AM
> To: '[EMAIL PROTECTED]'
> Subject: Arrays inside 
> 
> 
> I have the following as my data inside a package:
> 
> my $dataBlock = { isInsertable=> $isInsertable,
>   fields  => undef,
>   requiredFields  => undef,
>   selectionFields => undef,
>   returnFields=> undef };
> 
> How do I go about storing a list as the value of the 
> $dataBlock->{'fields'}
> key?
> 
> I'd like something like the following to work:
> 
> sub setFields
>  {
> my ($inBlock, @fieldList) = @_;
> 
> foreach my $i (@fieldList)
> {
>push($inBlock->{'fields'}, $i);
   push(@{$inBlock->{fields}}, $i);

> }
> 
> return $inBlock;
>  }
> 
> I understand it won't because $inBlock->{'fields'} is not an 
> array...  Any
> help would is appreciated.
> 
> TIA,
> 
> EllioT
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: stumped on error...

2002-09-06 Thread Nikola Janceski

instead of accessing the $opt_h from the namespace of Getopt that way do
this:
see inline


> -Original Message-
> From: Mike Singleton [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 11:17 AM
> To: [EMAIL PROTECTED]
> Subject: stumped on error...
> 
> 
> Name "Getopt::Std::opt_h" used only once: possible typo.
> 
> === Partial Script ==
> use strict;
> use English;
> use Getopt::Std;
> use Cwd;
> my $RPTFILE="jobrpt.tmp";

our ($opt_h, $opt_n, $opt_p, $opt_o, $opt_s);

> getopts('hn:p:o:s:') or die ;
> ($Getopt::Std::opt_h) and die;

#change above to
$opt_h and die;



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: hours minutes and seconds in seconds

2002-09-06 Thread Nikola Janceski

http://search.cpan.org/author/MSERGEANT/Time-Object-1.00/Seconds.pm

that can do it too.

> -Original Message-
> From: Rob [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 1:19 PM
> To: [EMAIL PROTECTED]
> Subject: hours minutes and seconds in seconds
> 
> 
> I'm working on a script that parses a log file which gives 
> connection time
> in seconds.  Below is how I resolved the problem but I think 
> there must be
> a better way?
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> my $sessionTime = 4000;
> 
> my $hour = $sessionTime / 3600;
> my $hr = int($hour);
> $sessionTime = $sessionTime - ($hr * 3600);
> my $minute = $sessionTime / 60;
> my $min = int($minute);
> my $sec = $sessionTime - ($min * 60);
> print "$hr hour $min minutes and $sec seconds.\n"
> 
> 
> Rob
> 
> Good judgement comes from experience, and experience -
> well, that comes from poor judgement.
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Weekly posting statistics - 36/2002

2002-09-09 Thread Nikola Janceski

for once I am not on the top 10 since I first subscribed to the list. :)

> -Original Message-
> From: Felix Geerinckx [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 09, 2002 12:59 PM
> To: [EMAIL PROTECTED]
> Subject: Weekly posting statistics - 36/2002
> 
> 
> Weekly posting statistics for perl.beginners - week 36 of 2002.
> 
> The authors top-10 by number of articles is as follows:
> 
>  All/Ori Lines  lpa  Author
> 
>   29/01229   42  [EMAIL PROTECTED] (David)
>   25/01590   63  [EMAIL PROTECTED] (John W. Krahn)
>   19/0 235   12  [EMAIL PROTECTED] (Dharmendra rai)
>   18/0 548   30  [EMAIL PROTECTED] (Sudarshan Raghavan)
>   13/0 565   43  [EMAIL PROTECTED] (Bob Showalter)
>   13/2 405   31  [EMAIL PROTECTED] (Felix Geerinckx)
>   12/0 386   32  [EMAIL PROTECTED] (Jeff 'Japhy' Pinyan)
>7/0 348   49  [EMAIL PROTECTED] (Drieux)
>7/1 283   40  [EMAIL PROTECTED] (Timothy Johnson)
>6/1 305   50  [EMAIL PROTECTED] (Wiggins D'Anconia)
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Simple RegEx Question

2002-09-11 Thread Nikola Janceski

see below

/^[^0-9a-fA-F]+$/   #if this evals to true string is NOT

## start of string ^ and end of string $

-Original Message-
From: RTO RTO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 11:00 AM
To: [EMAIL PROTECTED]
Subject: Simple RegEx Question


Here is a RegEx that I am using to check if the given
string is Hexadecimal or not.

/[^0-9a-fA-F]+/   #if this evals to true string is NOT
hex

I am having a trailing "+" to make sure at least one
permissible character is present. Yet, it matches an
empty string as a hex string.

a) What am I missing? 
b) Why is an empty string being matched?



Thanks,
Rex


__
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  1   2   3   4   5   >