Re: problems with chmod

2001-07-07 Thread Jim Conner

You should do some error checking...

#!/usr/bin/perl -w

use strict;
use Getcwd;

my $dir = "cody";
mkdir("$dir",0770) or warn("Could not mkdir $dir in ".getcwd.": $!\n");

This will tell you why or how something might be going wrong and what your 
pwd is.  Also, you should check the parent directory in which you are 
trying to make this directory for directory permissions (seteuid) which can 
cause the directory to be created the same as the parent directory.  You 
should also see if you have a umask set.  If so, this could cause the 
directory to default to a certain mode at first that might cause caveats 
with Perl (doubt it but just brain storming here).

At 10:48 AM 7/7/2001 -0500, [EMAIL PROTECTED] wrote:
>#!/usr/bin/perl -w
>
>use strict;
>
>my $dir = "cody";
>mkdir("$dir",0770);
>
>
>i am running this in my home directory on a linux machine, so i have full
>rights. when i run this however, the permissions on the directory are:
>
>drwxr-x---2 cmenzes  cmenzes  1024 Jul  7 10:39 cody/
>
>which translates to 0750. i am thinking that this limit may have to do
>with my shell umask setting which is at 022, but i am not certain why it
>is taking precedence over the perl setting. if i change my second argument
>in my mkdir statement to 0660 or 0444, the proper permissions are set. the
>only pattern that i see is that i *can* explicitly set the permissions in
>a mkdir statement if they are more restrictive than my umask. otherwise
>the perms default to my umask.
>i know i can get past this by following the mkdir statement with a chmod,
>but i just wanted to verify that my logic on this one is correct.



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--




Re: Editor

2001-07-07 Thread Jim Conner

If you got a precompiled version then it was compiled with highlighting 
turned off.  Just recompile it.  If you compiled it yourself then you 
somehow did so with highlighting turned off.  ./configure --help when 
compiling should be helpful.


At 08:19 PM 7/7/2001 +0200, Matija Papec wrote:
>"Wine, Michael" <[EMAIL PROTECTED]> wrote:
> >YES!
> >Try http://www.vim.org for a 'vi on steroids'...
> >
> >If you area vi freak, you'll love vim!
>
>:) Somehow it isn't my favorite, besides it says that syntax coloring
>":syn-on" isn't implemented, huh? Guess I'm stuck with some weird version.
>
> >-Original Message-
> >From: Matija Papec [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, July 06, 2001 3:06 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Editor
>
>
>--
>AMD FAQ
>http://performancefiles.cjb.net/



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--




How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner

I am writing a script that is quite cool imo once I get it done.  But 
already I am seeing that it takes a ton of system resources.  Simply put, 
the script watches a log file (like tail -f) and then reacts to certain 
things that occur.  I am thinking that the loop that it is in might be 
taking up all the resources but that doesn't quite jive with my knowledge 
of how this kind of thing works.  Here is a snippet of the resource usage 
from top(3):

Swap:  34236K av,   7268K used,  26968K free 35756K cached

   PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
  8400 qadmin17   0  3560 3560  1404 R   0 98.8  5.6   0:28 perl


Here is a snippet of the part of the code that does the tail -f:


if ( !chdir($qlogdir) ) {
 print "Cannot read $qlogdir: $!\n";
 return(undef);
} else {
 my $curpos;

 &dmsg( __LINE__,
   "Reading at end of Quake logfile: $qlogfile\n");

 open(QLOG,$qlogfile)
 or die("Unable to open $qlogfile: $!\n");

 while (  ) {
 $curpos++;
 }

 &dmsg( __LINE__, "Cursor Pos: $curpos\n");

 # Following tail -f code provided by http://www.PerlMonks.org
 # Monk unknown.

 for ( ; ; ) {
my $vip   = 0;  # vote in progress
 my $input;
 my $timestart;  # Leave this here
 # until I know I dont
 # need it.
  my $timestop;
 my $player_name;
 my $reqed_map;
 my $command;

 for ( $curpos = tell(QLOG) ;
   $input  =  ;
   $curpos = tell(QLOG) ) {
 chomp $input;

 if ( defined $input ) {
 &dmsg( __LINE__,"$input\n");
 } else {
 &dmsg( __LINE__,
basename($qlogfile) . " : EMPTY SET!\n");
 }

 $_  = $input;

 ## START OUR SWITCH BLOCK!

 switch: {

 ##
 # This next block for map voting.
 ##

   /.*] (.*): \!$keyword_map/ && do {
 $input   =~ /] (.*): \!($keyword_map) 
([a-zA-Z0-9].*)/;
($player_name,
 $command,
 $reqed_map  )= ($1,$2,$3);
 my $current_map  = ¤t_map;

 if ( !defined $reqed_map && $player_name ne 
/[Cc]onsole/ ) {
   &usage("vote_assist");
 } else {
 # This is where we decide what kind of vote we are
 # in.  See comments.

 if ( $vote_type == 0 ) {
 &type_votemap($reqed_map) if ( 
$current_map eq $vote_map );

 } elsif ( $vote_type == 2 ) {
  # check what map we are in here.
 # then if we are in votemap, react :
  # or if we are in regular map, react
 ( $current_map eq $vote_map ) ? 
&type_votemap   ($reqed_map):
 
&type_no_votemap($reqed_map);
 }

 sub type_votemap($) {
my $funcName = (caller(0))[3];
my $reqed_map=  shift;

print STDERR "Now in $funcName\n";
# This section will work in votemap ONLY and
# players can only vote during this map.
&map_vote($player_name,0,$reqed_map);
 }

 sub type_no_votemap($) {
 my $funcName = (caller(0))[3];
 my $reqed_map=  shift;

 print STDERR "Now in $funcName\n";
 # This section will work in any map and
 # players can vote anytime during play.
 # Must use vote session.
 print STDERR "Requested map is: $reqed_map 
from $funcName\n";
 $vip= &map_vote($player_name,1,
 $reqed_map   );
 }

 }
 };
last switch;

 ## END OF SWITCH BLOCK!

 if ( $vip ) {
 # Set my timestop (time limit for an active vote)
 ($timestart,
  $timestop) = &get_seconds();
  print "Timestart is: $timestart and " .
"timestop is: $timestop\n";
 }

 }

  

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner

Ok. So you are thinking it might be the loop then too?

TIA
- Jim


At 11:48 AM 7/8/2001 -0700, Sandor W. Sklar wrote:
>you might want to look at "swatch", by Todd Atkins, to see how it is done 
>there  ...
>
><http://www.oit.ucsb.edu/~eta/swatch/>
>
>There is a File::Tail module which might work for you as well, or, at 
>least show you another way to do it.
>
>-s-
>
>
>At 2:20 PM -0400 7/8/01, Jim Conner wrote:
>>I am writing a script that is quite cool imo once I get it done. But 
>>already I am seeing that it takes a ton of system resources. Simply put, 
>>the script watches a log file (like tail -f) and then reacts to certain 
>>things that occur.  I am thinking that the loop that it is in might be 
>>taking up all the resources but that doesn't quite jive with my knowledge 
>>of how this kind of thing works.  Here is a snippet of the resource usage 
>>from top(3):
>>
>>Swap:  34236K av,   7268K used,  26968K free 35756K cached
>>
>>   PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
>>  8400 qadmin17   0  3560 3560  1404 R   0 98.8  5.6   0:28 perl
>>
>>
>>Here is a snippet of the part of the code that does the tail -f:
>>
>>
>>if ( !chdir($qlogdir) ) {
>> print "Cannot read $qlogdir: $!\n";
>> return(undef);
>>} else {
>> my $curpos;
>>
>> &dmsg( __LINE__,
>>   "Reading at end of Quake logfile: $qlogfile\n");
>>
>> open(QLOG,$qlogfile)
>> or die("Unable to open $qlogfile: $!\n");
>>
>> while (  ) {
>> $curpos++;
>> }
>>
>> &dmsg( __LINE__, "Cursor Pos: $curpos\n");
>>
>> # Following tail -f code provided by http://www.PerlMonks.org
>> # Monk unknown.
>>
>> for ( ; ; ) {
>>my $vip   = 0;  # vote in progress
>> my $input;
>> my $timestart;  # Leave this here
>> # until I know I dont
>> # need it.
>>  my $timestop;
>> my $player_name;
>> my $reqed_map;
>> my $command;
>>
>> for ( $curpos = tell(QLOG) ;
>>   $input  =  ;
>>   $curpos = tell(QLOG) ) {
>> chomp $input;
>>
>> if ( defined $input ) {
>> &dmsg( __LINE__,"$input\n");
>> } else {
>> &dmsg( __LINE__,
>>basename($qlogfile) . " : EMPTY SET!\n");
>> }
>>
>> $_  = $input;
>>
>> ## START OUR SWITCH BLOCK!
>>
>> switch: {
>>
>> ##
>> # This next block for map voting.
>> ##
>>
>>   /.*] (.*): \!$keyword_map/ && do {
>> $input   =~ /] (.*): \!($keyword_map) 
>> ([a-zA-Z0-9].*)/;
>>($player_name,
>> $command,
>> $reqed_map  )= ($1,$2,$3);
>> my $current_map  = ¤t_map;
>>
>> if ( !defined $reqed_map && $player_name ne 
>> /[Cc]onsole/ ) {
>>   &usage("vote_assist");
>> } else {
>> # This is where we decide what kind of vote 
>> we are
>> # in.  See comments.
>>
>> if ( $vote_type == 0 ) {
>> &type_votemap($reqed_map) if ( 
>> $current_map eq $vote_map );
>>
>> } elsif ( $vote_type == 2 ) {
>>  # check what map we are in here.
>> # then if we are in votemap, react :
>>  # or if we are in regular map, react
>> ( $current_map eq $vote_map ) ? 
>> &type_votemap   ($reqed_map):
>>&type_no_votemap($reqed_map);
>> }
>>
>> sub type_votemap($) {
>>my $funcName = (caller(0))[3];
>>my $reqed_map=  shift;
>>
>>print STDERR "Now in $funcName\n";
>>

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner

Excellent!  I will check that out!

- Jim

At 04:31 PM 7/8/2001 -0400, Walt Mankowski wrote:
>On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote:
> > I am writing a script that is quite cool imo once I get it done.  But
> > already I am seeing that it takes a ton of system resources.  Simply put,
> > the script watches a log file (like tail -f) and then reacts to certain
> > things that occur.  I am thinking that the loop that it is in might be
> > taking up all the resources but that doesn't quite jive with my knowledge
> > of how this kind of thing works.  Here is a snippet of the resource usage
> > from top(3):
>
>You're using up all those resources because your program is sitting in
>a hard loop.  Try inserting a sleep at the bottom of your outer for
>loop.  You might also want to take a look at "How do I do a 'tail -f"
>in perl?' in perlfaq5.
>
>Walt



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--




Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner

I decided to go ahead and use File::Tail.  it works like a champ.  However, 
writing my own was quite helpful (or atleast tweaking my own ;))

Thanks all.

- Jim

At 04:31 PM 7/8/2001 -0400, Walt Mankowski wrote:
>On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote:
> > I am writing a script that is quite cool imo once I get it done.  But
> > already I am seeing that it takes a ton of system resources.  Simply put,
> > the script watches a log file (like tail -f) and then reacts to certain
> > things that occur.  I am thinking that the loop that it is in might be
> > taking up all the resources but that doesn't quite jive with my knowledge
> > of how this kind of thing works.  Here is a snippet of the resource usage
> > from top(3):
>
>You're using up all those resources because your program is sitting in
>a hard loop.  Try inserting a sleep at the bottom of your outer for
>loop.  You might also want to take a look at "How do I do a 'tail -f"
>in perl?' in perlfaq5.
>
>Walt



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--




hash comparisons...

2001-07-19 Thread Jim Conner

What is the best way to compare hash of arrays against each 
other?  Actually, a better way to ask my question would be...

I have a hash called %player_info that contains 4 elements per hash 
reference.  I want to compare just the key of the hash against against 
another hash that I will build from replies from the client (yes's and 
no's).  Difficult to follow?  Let me explain what I am trying to accomplish:

I am building a voting script.  This is particularly tough because of the 
things I need to pay attention to such as disallowing corrupt votes by 
someone voting multiple times.  What I want to do is allow players to 
revote.  Their new vote will simply overwrite the first vote.  There is a 
list of other things I want to do but these things all pivot around how I 
am going to do comparisons.

I perhaps haven't asked this question in the best way but I hope the 
question is understood.  Any thoughts and assistance would be greatly 
appreciated.

TIA!



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: hash comparisons...

2001-07-20 Thread Jim Conner

Really??  I am not familiar with the magazine (well, at least not with a 
site for the magazine).  Gotta URL?

Thanks!

- Jim


At 09:30 AM 07.20.2001 -0500, Tom Yarrish wrote:
>Didn't Randall do a voting script for an article in Linux Journal/Mag or
>TPJ recently?  You might want to look at that.
>
>Thanks,
>Tom
>
>--
>#!/usr/bin/perl -w # 526-byte qrpff, Keith Winstein and Marc Horowitz
><[EMAIL PROTECTED]> # MPEG 2 PS VOB file on stdin -> descrambled output
>on stdout # arguments: title key bytes in least to most-significant order
>$_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@a=unx"C*",$_)[20]&48){$h=5;
>$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
>unxV,xb25,$_;$b=73;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=($t=255)&($d
> >>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9
>,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t
>^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271))
>[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval
>
>On Fri, 20 Jul 2001, Jim Conner wrote:
>
> > What is the best way to compare hash of arrays against each
> > other?  Actually, a better way to ask my question would be...
> >
> > I have a hash called %player_info that contains 4 elements per hash
> > reference.  I want to compare just the key of the hash against against
> > another hash that I will build from replies from the client (yes's and
> > no's).  Difficult to follow?  Let me explain what I am trying to 
> accomplish:
> >
> > I am building a voting script.  This is particularly tough because of the
> > things I need to pay attention to such as disallowing corrupt votes by
> > someone voting multiple times.  What I want to do is allow players to
> > revote.  Their new vote will simply overwrite the first vote.  There is a
> > list of other things I want to do but these things all pivot around how I
> > am going to do comparisons.
> >
> > I perhaps haven't asked this question in the best way but I hope the
> > question is understood.  Any thoughts and assistance would be greatly
> > appreciated.
> >
> > TIA!
> >
> >
> >
> > - Jim
> >
> > -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> > http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861
> >
> > -BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
> > Version: 0.01 Version: 3.12
> > P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
> >  >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
> > $C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ 
> L+++()>+$ !E*
> > +PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- 
> PS---(-)@ PE
> >  >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- 
> X++ R@
> >  >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
> > --END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--
> >
> >
> >
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: hash comparisons...

2001-07-20 Thread Jim Conner

Good point.  Fortunately, this system will not have to reply on any such 
thing.  The votes are not critical either (ie its just gonna be used for 
the ability for players to change or rarther vote to change certrain 
aspects of the game).  My resolution for this is that the minute they 
connect to the server the server assigns them a userid.  It is sequentially 
given out but once a player leaves that userid can not be used again until 
the server is reset.  The chance that  a player (I monitor by IP address) 
gets the same userid within the same 30 minute or 1 hour game is very unlikely.

Thanks guys.
- Jim

At 10:57 AM 07.20.2001 -0500, Eric J. Wisti wrote:

>The one question that comes to mind:
>
>What about AOL users, where there could be hundreds coming from the 'same
>ip' (cache server)? Libraries and cyber cafes??
>
>It may not be an issue for Jim, but it is still something to remember.
>Many large companies and isps use cache servers, so ALL users appear to
>come from one ip. Like Randal mentions, the isn't really a GOOD, SAFE
>way to insure that someone doesn't vote twice, unless it is a secure site
>with logins required or other unique information is used.
>
>Some surveys that I have participated in, send out a unique 'password' that
>is then logged and cannot be used to vote again. But these surveys are
>from companies that have customer information for me and will only send me
>one password.
>
>On 20 Jul 2001, Randal L. Schwartz wrote:
>
> > Date: 20 Jul 2001 08:36:44 -0700
> > From: Randal L. Schwartz <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Re: hash comparisons...
> >
> > >>>>> "Jim" == Jim Conner <[EMAIL PROTECTED]> writes:
> >
> > Jim> I am building a voting script.  This is particularly tough because of
> > Jim> the things I need to pay attention to such as disallowing corrupt
> > Jim> votes by someone voting multiple times.  What I want to do is allow
> > Jim> players to revote.  Their new vote will simply overwrite the first
> > Jim> vote.  There is a list of other things I want to do but these things
> > Jim> all pivot around how I am going to do comparisons.
> >
> > The "someone" part is hard.  How do you tell if two uncorrelated hits
> > are from the same person?
> >
> > Hint: you lose if you mention
> >
> > cookies
> > IP address
> > browser signature
> > javascript
> >
> > :-)
> >
> > But I did cheat a bit, and use "same IP address within an hour" for
> > my unscientific polling mechanism for a recent WT column, at
> >
> > http://www.stonehenge.com/merlyn/WebTechniques/col59.html
> >
> > --
> > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> > <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
> > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl 
> training!
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>  Eric Wisti
>  Kinetic, Inc.
>  (651) 848-0477



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Linux commands in perl

2001-07-25 Thread Jim Conner

There are other ways as well.

You can use the system() function which forks into a child process, waits 
for the process to complete, and returns..

system("/bin/ls");
@FILES = system("/bin/ls");

And you can use the exec() function.  This function does not fork a child 
process.  According to the book I have here, exec() executes the command 
but never returns.  The exec() function fails only when the command you are 
attempting to run does not exist.  There are other caveats with exec().  I 
would use system().  On the other hand, I personally discourage the use of 
system() or exec() when I code because if I use the native abilities of 
Perl my code is cleaner, quicker, and more fun to code.  But thats just me.

eg: You can move files using system():

system("/bin/mv $PATH/to/file $PATH/to/newfile");

or you can use the move function:

use File::Copy

$file= "/path/to/file";
$newfile = "/path/to/newfile";

move($file,$newfile);

The only thing extra about these is the use syntax at the top.  The second 
one is faster because Perl can do it all by itself happy lil self.  It 
doesn't have to spawn a shell process to do the work for it.

At 03:18 PM 07.25.2001 +0530, KK wrote:
>Hello Rahul -
>
>Just prepend and append the command with the symbol - ` - mind u, this is
>the back apostrophe, the first button on the keyboard from the left nad side
>on the second row from top. For eg.
>--- starts here --
>#!/usr/local/bin/perl
>
>`ls -l`;
>--- ends here --
>
>Kind regards.
>
>KK
>[EMAIL PROTECTED]
>
>
>- Original Message -
>From: Rahul Garg <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, July 25, 2001 2:14 PM
>Subject: Linux commands in perl
>
>
>hello Everybody ,
>
>
>Simple question..
>
>How to run Linux commands in Perl code...
>
>Waiting for Reply
>Thanx in Advance...
>Rahul
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Date problem

2001-07-25 Thread Jim Conner

Use the POSIX function strftime:


#!/usr/local/bin/perl -w

use POSIX;
print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n";

-- snip --

[notjames@concon notjames]$ perl -MPOSIX -e '
 > print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n";
 > '
The date is : 07252001

-- !snip --

Now, you mentioned conversion so if that involves sucking in a date from 
something else other than the system you will have to be more specific in 
origin to convert from ie a filename or something.

Hope this helps.

- Jim

At 12:22 PM 07.25.2001 -0400, F.H wrote:
>Hi,
>does anyone know how to convert a date from mmddyy to mmdd?
>so 010201 becomes 01022001
>
>Thanks for your help
>
>I.S
>
>
>__
>Your favorite stores, helpful shopping tools and great gift ideas. 
>Experience the convenience of buying online with Shop@Netscape! 
>http://shopnow.netscape.com/
>
>Get your own FREE, personal Netscape Mail account today at 
>http://webmail.netscape.com/
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




adding an element to an array in a hash of arrays...

2001-08-01 Thread Jim Conner

How can I do this? :)





- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: very funny...

2001-08-08 Thread Jim Conner

At 06:30 PM 08.07.2001 +, Mel Matsuoka wrote:
>At 09:08 AM 08/08/2001 +0530, Karthik Krishnamurthy wrote:
> >All of the experts you are talking about started
> >out some time as clueless newbies too. They didn't
> >become experts by asking questions, the answers to
> >which they could find themselves.
>
>Good point.
>
>I didn't post a single thing to a Perl mailing list or newsgroup until
>about a year and a half /after/ I started learning Perl. The main reason
>why I didn't post is simply because I didn't really have to, since
>virtually every question or problem I had was solvable by searching the web
>or Dejanews. There are very very few totally "original" problems that no
>one has ever asked before, so chances are you'll find your answer
>yourself...you just have to get off your ass and mke the initiative to find
>and learn it for yourself first. Then after all your attempts, you are
>truly stumped, that is the time to bug the "experts" ;) Thats what learning
>and is all about.

Unfortunately, this ''issue'' will never go away for various 
reasons.  Those reasons range from the person asking the question simply 
does not know netiquette to the person is too lazy to look for the answer 
him/herself to the person is on a deadline and needs the answer now and 
just doesn't have time to look around for the answer.  I understand all of 
these because I have worn every pair of these shoes.  I am not advocating 
any reason not to RTFM but I am also being realistic that this will never 
go away.  I admire that the author of this discertation was willing to 
'splain the issue so gently yet boldly.  In fact, I found it good reading 
and I also believe that every newbie should read this paper as it is very 
informative.  But, alas, I realize that this will plainly not always 
happen.  Therefore, I continue on with my life and answer those questions 
which interest me enough to answer them...er well, that and those that I 
*can* answer =).

>This is why I have a big problem with most types of formal (esp. public)
>education. Children are taught WHAT to learn, and not HOW to learn. In my
>opinion, finding the right answer is nowhere near as important as the
>process you took in order to arrive at that answer.

I think that this is an excellent point that unfortunately everybody has 
lost site of.  Another thing is that schools are too busy trying to help 
children memorize and test them on what they memorize.  Then everyone is 
baffled when they find out that the child retained only some-odd percent of 
the information assimilated...er no, looked at last week.  Hmm, a lil off 
the topic.  Sorry bout that.  Where'd my manners go.  Ah hem...back to the 
issues at hand.  Perl rocks!  Remember, the camel is your friend.


>Aloha,
>mel
>
>--
>mel matsuoka  Hawaiian Image Productions
>Chief Executive Alphageek(vox)1.808.531.5474
>[EMAIL PROTECTED](fax)1.808.526.4040
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: A little off topic.

2001-08-08 Thread Jim Conner

At 11:07 PM 08.08.2001 -0400, Rex Arul wrote:
>Please visit http://www.activestate.com . They have PerlApp and PerlCOM
>tools as part of the Perl Development Kit.
>
>With PerlApp you can generate free running EXEs and with PerlCOM you can
>create DLLs which can be invoked by any VB/VBScript/JScript code.
>
>
>
>- Original Message -
>From: "Michael Carmody" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, August 08, 2001 10:21 PM
>Subject: A little off topic.
>
>
> > Having crafted my masterpiece in perl, I now need to get it to run from
> > within a VB script.
> >
> > (VB takes office file, converts to .csv, which perl scripts then parses,
> > but poor secretary has to have excel doco to work on)
> > So this is only in the interest of allowing perl to actually be used at my
> > work in a real environment (as opposed to only me using when I need it)
> > and being seen as a REAL tool, even though it's free/open source/not
>microsoft
> >

Just make sure you guys never upgrade to the .NET platform.  M$ license for 
that junk dissallows the use of any ''viral'' software including all open 
source  (Perl specifically mentioned in the license) with there .NET 
platform.  *sigh*...I really dislike M$.

Sorry for the out of band message folks.

- Jim

> > So how do i get visual basic to call external executable files ?
> > Such as perlscript.bat containing "perl myscript.pl"
> >
> > Any help doubly appreciated...
> >
> > Michael Carmody
> > MDU, Public Health Lab
> > Dept. of Microbiology and Immunology
> > The University of Melbourne, Parkville
> >
> >
> > --
> > 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]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Calculation the total of my column

2001-08-15 Thread Jim Conner

I would do it like this (taking a stab at this...critique is welcomed):

At 03:17 PM 08.16.2001 +0930, Daniel Falkenberg wrote:
>List,
>
>I have a problem here that I am having a little bit of trouble trying to
>resolve.  Firstly I have a Perl script that connects to a PostgreSQL
>database using the DBI module.  I want to be able to SELECT a column from
>the database and return the total result.
>
>For example if I do the following...
>
>$sth = $dbh ->prepare( qq{  SELECT  minutes
>FROMtable
>WHERE   status = 'COMPLETE'
>} ) || die $dbh->errstr; ;
>$sth->execute;

my $total = 0;
map { $total = $total + $_ } $sth->execute;
print "The sum of the minutes is: $total\n";

I THINK that would work.  I am still somewhat new to Perl myself so if 
someone could validate that for me I'd appreciate it.  I am assuming (now 
probably I shouldn't have buuut porting this shouldn't be hard) that your 
resulting query returns just the minutes.  If it doesn't, then you will 
have to isolate those minutes into a list or array.  Then you can do the 
same thing as above but you would want to replace the '$sth->execute;' with 
'@YOUR_ARRAY' in the map statement.

Remember, map{} is your friend. :)

Thanks everyone IA.

- Jim

>The minutes attribute is of type integer.  I want to be able to calculate
>the total for the attribue minutes.  So far the result for the SQL query
>above is...
>
>minutes
>
>30
>45
> 5
> 5
>15
>25
>15
> 5
>25
>25
>(10 rows)
>
>
>How would I with Perl now count the column above and return a result?
>
>Any ideas would help imensly.
>
>kind regards,
>
>Daniel Falkenberg
>
>==
>VINTEK CONSULTING PTY LTD
>(ACN 088 825 209)
>Email:  [EMAIL PROTECTED]
>WWW:http://www.vintek.net
>Tel:(08) 8523 5035
>Fax:(08) 8523 2104
>Snail:  P.O. Box 312
> Gawler   SA   5118
>==
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




RE: PERL IS NOT A HIGH LEVEL LANGUAGE and What is a Script

2001-08-17 Thread Jim Conner

At 04:41 PM 08.17.2001 -0700, Dean Theophilou wrote:
>Hello:
>
> I understand what you're saying but the fact remains: STRICTLY 
> speaking,
>Perl is NOT an interpreted language (such as the BASIC language I learned in
>high school, many, many years ago).

Just a minor correction (semantics only).  Perl *is* an interpreted 
language where BASIC and C are compiled languages.  I believe everyone, 
including myself, got the idea though.  I just wanted to make clear the 
words used between the two.

Interpreted meaning that the script/program is interpreted and compiled at 
run time by the compiler (the Perl binary) and then run.  Whereas BASIC, C, 
C++, COBOL, FORTRAN, etc, etc are all compiled into machine language.  At 
runtime the OS knows how to run the program and is therefore *not* 
interpreted but simply run.


>   Sure, there is an interpreter, but
>there is also a compile phase (which is the point you sorta made in your 2nd
>paragraph).  Now, I make no claims at being an expert on this, but if your
>argument is that the authors of Perl in a Nutshell are wrong, then say so.
>And if that's the case, then I will research it some more.
>
> On a different subject: as to what a script is, and to stir the 
> pot a bit,
>let me quote Tim Hill, the author of Windows NT Shell Scripting (published
>by MTP) and a professional software developer (among other things):
>
>"This is a book about Windows NT scripting.  In Windows NT, a SCRIPT is a
>record, in a text file, of a sequence of shell commands. (A SHELL COMMAND is
>approximately the same as a command typed into a command prompt window.)
>Once created, a script can be executed as if it were an executable
>program...thus a script, in its simplest form, is just a way of saving
>typing...[scripting] has evolved into a full programming language"  (pp.
>7-8) (Emphases, in caps, are the author's and not mine.)
>
> Conclusion: Perl is a high-level language; and it is both a scripting
>language as well as a programming language (since it has the characteristics
>of both).  In other words, you can have your cake and eat it too.  :)
>
>
>Dean Theophilou
>
>P.S. I've always considered Assembly to be a low-level language, C to be a
>mid-level language, and Pascal and Perl to be high-level, but that's simply
>my own personal way of categorizing.
>
>
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Friday, August 17, 2001 3:11 PM
>To: Dean Theophilou
>Cc: Jon Acierto; [EMAIL PROTECTED]
>Subject: Re: PERL IS NOT A HIGH LEVEL LANGUAGE
>
>
> > "Dean Theophilou" <[EMAIL PROTECTED]> said:
>
> >   Technically, Perl is NOT an interpreted language.  The Perl 
> interpreter
> > converts the program into byte code before executing, just like C.  This
>is
> > a paraphrase of p. 31 of Perl in a Nutshell, by O'Reilly.  I suggest you
>get
> > the book, since it was written by real-world (as opposed to "teachers")
> > professional programmers.
>
>A C compiler generates machine specific assembly code which is loaded to
>create an executable program which can run independent of the compiler. e.g.
>the language parsing, code generation step is performed once.  Perl parses
>and
>generates code each time the program is run.  So parsing and code generation
>overhead is part of normal perl execution.  That is why a perl "executable"
>is
>just the script itself.
>
>There are ways to generate perl "object" code, but for most application
>the reduction in overhead is hardly worthwhile.  Also having the perl
>parser and code generator around at runtime is useful for executing
>dynamically generated code e.g. eval() and do(). It also allows very
>late symbol table binding, since the symbol table is carried with the
>execution environment in perl.  This is generally not true with C,
>where variables are bound at compile/load time.
>
>Please remember the compile->load->execute paradigm was developed at a
>time when memory and cpu cycles were a scarce resource. It works well
>when you have to run a program many times (e.g. a heavily used utility
>like the Unix shell) with little runtime overhead.
>
>
>--
>Smoot Carl-Mitchell
>Consultant
>
>
>--
>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]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++

Re: html to SQL script

2001-08-17 Thread Jim Conner

At 11:14 PM 08.17.2001 -0500, Teresa Raymond wrote:
>I have never worked with SQL before but I need to dump about 900 html 
>files into a SQL database.  Someone else has written a PHP script to put 
>the content of the html pages in the database but you can only do it one 
>page at a time by submitting a form with the relevant contents copied and 
>pasted into it. This seemed a little crazy to me, so...

It can be done in Perl...but I would do something like this in shell and 
just run the php script through a for loop.  However, since this *is* a 
Perl list, you can really just do the same thing in Perl.  Just run the 
sucker through a for loop.  The reason I'd do it in shell vs in Perl is 
because it is a little easier to suck up files in shell than it is in Perl 
and Frankly, that is what shell scripting is for.

- Jim

>It seems to me that a Perl script ought to be able to do this.  So, to 
>start with I need some introductory information about SQL.  How do you 
>access it, by open database?  Anyway, if I could get some pointers on 
>where to start, that would be great.
>
>*Teresa Raymond
>*Mariposa Net
>*http://www.mariposanet.com
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




RE: How to reference env variables.

2001-08-22 Thread Jim Conner

At 11:26 AM 08.22.2001 -0400, Bob Showalter wrote:
> > -Original Message-
> > From: Kingsbury, Michael [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 22, 2001 11:07 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: How to reference env variables.
> >
> >
> > When running a command such as :
> >
> > `ls -la /some/directory`
> >
> >  there is an envirornment variable called !EXITCODE that I want to
> > reference.  I already have Use Env in place, but how do I
> > keep perl from
> > gagging on the bang in the variable name??
>
>Based on a cursory glance at Env.pm, it appears that it will skip
>any names in the environment that dont match [A-Za-z_].

Theoretically you shouldn't be using any environment tokens with special 
characters in them anyway since the shell can and will misinterpret them at 
the most un useful times.  The '!' is a great example of this since bash 
will go crazy on it as well as many other shells.  In fact, you should 
really find out what is gagging, the Perl script or the shell.  You're 
probably right that it is the Perl interpreter but I'd double check to make 
sure.  It looks like the c shell is innocuous to the '!' based on HP 
example below.

I have to agree with the suggestion made here too, that you need to be 
specific about what your env var !EXITCODE does.  Perhaps there is a Unix 
mechanism or Perl mechanism already in place that will do what you are 
attempting (seem to anyway) do.

- Jim


>You could get at it through the regular %ENV hash:
>
>$ENV{'!EXITCODE'}
>
>This command works on my (HPUX) system:
>
>$ env !EXITCODE=hello perl -e 'print $ENV{q[!EXITCODE]}, "\n"'
>hello
>
>Is this variable some artifact of your shell? Are you wanting to
>test it following the ls backticks? If so, this isn't going to
>work. The shell/ls will be executed in a child process, and the
>child cannot affect the parent's environment. If you just want
>the exit status from the backtics, you can use Perl's regular
>$? variable. Or maybe I'm misunderstanding the whole issue.
>(Wouldn't be the first time).
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Perl is amazing!!

2001-08-22 Thread Jim Conner

At 07:17 AM 08.21.2001 -0500, Randy5235 wrote:
>I just started learning Perl about 2 days ago. I am totally blown away at
>the power and ease. I am however trying to find as much reference as
>possible. I have checked most of the popular sites thus far and managed to
>find some docs there. Any links to documentation and how to's for a beginner
>would be much appreciated. Thanks Randy5235
>

I absolutely *love* perlmonks.org

http://www.perlmonks.org

I recommend that site to anyone.  Remember, the key to being monk is the 
ability to search. :)


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



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: REQ concise steps for setting up a socket

2001-08-26 Thread Jim Conner

At 07:10 PM 08.26.2001 -0700, Peter Scott wrote:
>At 08:56 PM 8/26/01 -0400, Jim Conner wrote:
>>I have looked all over the place for something about the basic steps to 
>>setting up a tcp socket in Perl using Socket.pm and I simply cannot find 
>>it. I am using Socket.pm and I need to know if anyone out there would be 
>>willing to provide this.
>>Now, I know that there are examples for using Socket.pm in the Camel and 
>>the Cookbook but the explanations (for me) are sketchy at best and are in 
>>no way IMO easy for a beginner to get.
>>So, for example, what I would like to know is what are the steps to 
>>setting up a socket? Something like the following would be helpful:
>>
>># First, get the remote IP address
>>$remote_ipaddr = "192.168.120.1"
>>
>># Then get the remote port
>>$remote_port   = "1400";
>>
>># Then what?  And better yet, why?
>>
>>
>>The Socket.pm functions just totally baffle me as to their purpose and 
>>needs. There are so many of them yet only a few them are needed it seems 
>>like, right? And if so which ones are absolutely necessary to use? Why? 
>>At what times are they to be used and not used?
>>I am opting *not* to use IO::Socket::INET simply because its so easy to 
>>use and I really want to know what the needs are for Socket.pm (and my 
>>current project dissallows me from installing the module too).
>
>These are bizarre requirements.  Socket.pm is too hard for a beginner, but 
>you don't want to use IO::Socket::INET because it's too *easy*?  This is 
>like Goldilocks and the Three Bears.  I don't think there's an in-between 
>module.

LolYeah, I can see your point of view.  I guess I was just looking for 
easy steps and didn't think that that was a big deal but then again, I've 
been somewhat stumped on this for sometime so maybe that was an oversight. 
:)  I consider myself to be more intermediate in Perl and definitely 
beginner in socket programming.


>For the best examples and explanations I've seen on Socket.pm and 
>everything else to do with networking in Perl, see Lincoln Stein's book, 
>"Network Programming with Perl" (Addison-Wesley, 2001).
>
>To learn about socket programming in general, W. Richard Stevens' books 
>"TCP/IP Illustrated" and "UNIX Network Programming" can't be beat.  Since 
>your goal appears to be to understand what's going on - commendable - I'd 
>suggest you get one or the other of those.

Thank you very much for the book recommendations.  I will see if the 
company will float me a few bucks for these.


>If you have to get something done on a schedule, of course, go wit the 
>easy way to do it.  A project that won't let you install a module that 
>makes life easier is just strange.  You know you can install a module into 
>your own directory, right?  You don't have to put it in with Perl?  It can 
>live in the same directory as whatever script you're writing if you want.

Well, I am pretty sure I could get some strings pulled but again, I was 
very interested in using this opportunity to learn about socket 
programming...perhaps a quick and dirty was what I was looking for. :)

Thanks again! :)

- Jim



>--
>Peter Scott
>Pacific Systems Design Technologies
>http://www.perldebugged.com
>



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: frustrating search on the NET::IRC module

2001-11-10 Thread Jim Conner

At 21:50 11.10.2001 +0100, samuel wrote:
>hi there!,
>i'm writing this email with a great frustration feeling. i've been all
>evening looking for the NET::IRC perl module, but it was a waste.
>
>After searching CPAN modules list and find nothing, i tried it in a
>more active way, i tried it in search.cpan.org with a (fake)
>successful result.
>
>I got links to http://search.cpan.org/doc/SARGIE/Net-IRC-0.71/IRC.pm and the
>other 3 related modules, but it's not gold all that glitters.
>
>the links took me to a v ery comprehensive page explaining the uses of the
>module, but no module to the module itself on CPAN.
>Everything i found was "Up-to-date source and information about the
>Net::IRC project can be found at http://netirc.betterbox.net/ "
>But the great news is that  netirc.betterbox.net is a broken link!!!
>Please, help me find the module so my pain can finally end.
>I will b eternally greatful
>thanx...
>A very frustrated newbie

I just installed it a few nights ago.

perl -MCPAN -e 'install Net::IRC'

You MUST get the case right though.  Net is NOT 'NET'.

- Jim


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



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




CPAN module...and forceful installs

2001-11-08 Thread Jim Conner

I am getting:

Failed Test Status Wstat Total Fail  Failed  List of Failed

t/19_filterchange.t2   51255   55 100.00%  1-55
5 tests skipped.
Failed 1/26 test scripts, 96.15% okay. 55/463 subtests failed, 88.12% okay.
*** Error code 2

Stop in /root/.cpan/build/POE-0.17.
   /usr/bin/make test -- NOT OK
Running make install
   make test had returned bad status, won't install without force

How would I do a force(ful) installation with the CPAN module??




- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: CPAN module...and forceful installs

2001-11-08 Thread Jim Conner

At 02:02 11.09.2001 -0500, Jim Conner wrote:
>I am getting:
>
>Failed Test Status Wstat Total Fail  Failed  List of Failed
>
>t/19_filterchange.t2   51255   55 100.00%  1-55
>5 tests skipped.
>Failed 1/26 test scripts, 96.15% okay. 55/463 subtests failed, 88.12% okay.
>*** Error code 2
>
>Stop in /root/.cpan/build/POE-0.17.
>   /usr/bin/make test -- NOT OK
>Running make install
>   make test had returned bad status, won't install without force
>
>How would I do a force(ful) installation with the CPAN module??
>

Heh, its amazing what one can learn if one just rtfm's ;)  I will answer my 
own question here.

  Example:

  cpan> install OpenGL
  OpenGL is up to date.
  cpan> force install OpenGL
  Running make
  OpenGL-0.4/
  OpenGL-0.4/COPYRIGHT
  [...]





>- Jim
>
>-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
>http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861
>
>-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
>Version: 0.01 Version: 3.12
>P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
> >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
>$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
>+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
> >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
> >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
>--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




RE: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner

Transplant from Los Angeles Ca, in Charlotte NC...MAN do I wanna go home!

At 10:27 11.09.2001 -0500, [EMAIL PROTECTED] wrote:
>Atlanta, Georgia
>
>Rex :)-
>
>-Original Message-
>From: Wagner-David [mailto:[EMAIL PROTECTED]]
>Sent: Friday, November 09, 2001 10:26 AM
>To: 'Etienne Marcotte'; [EMAIL PROTECTED]
>Subject: RE: Off-Topic (200%) - Where are you from?
>
>
> San Jose, CA
>Wags ;)
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner

At 11:58 11.09.2001 -0700, Tyler Cruickshank wrote:
>ah, what the hey ...
>
>Salt Lake City, UT - Greatest Snow on Earth.
>
> and no, Im not!

Hahaha, and I know exactly what you're talking about! =P  Cuz, I 
am...that's funny.

> >>> "Joyce Harris" <[EMAIL PROTECTED]> 11/09/01 11:57AM >>>
>Knoxville, Tennessee
>- Original Message -
>From: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, November 09, 2001 1:47 PM
>Subject: RE: Off-Topic (200%) - Where are you from?
>
>
> > Winnipeg, MB, Canada
> >
> > --
> > 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]
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner

My parents live in SD.  Heh, maybe when I move back I will move to OC and 
live between SD and LA ;)  I love OC!

At 12:25 11.09.2001 -0800, Michael Kelly wrote:
> > San Diego, California, dude.
>
>Definitely a small world. Same here! Good ol' sunny San Diego where
>it's...foggy.
>
>-Michael Kelly
>Email: [EMAIL PROTECTED]
>The Web: http://www.jedimike.net
>
>
> > -Original Message-
> > From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 09, 2001 7:08 AM
> > To: [EMAIL PROTECTED]
> > Subject: Off-Topic (200%) - Where are you from?
> >
> > By reading the messages everyday I can guess most of us are from United
> > States right? And since there are not a lot of messages in (my) morning
> > time, probably means most are from the west coast (different timezone).
> >
> > Am I right?
> >
> > I'm from Quebec, Canada.. and you?
> >
> > Sorry if it's way off topic, I hope the ones that hate OT subject
> > filtered *off*topic* in their  emails!
> >
> > Etienne
> >
> > --
> > 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]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




RE: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner


At 15:29 11.09.2001 -0600, Frank Newland wrote:
>Opelika, Alabama..
>North of Beauregard,
>East of Lochapoka,
>South of Buffalo,
>West of Bleecker
>
>-Original Message-
>From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
>Sent: Friday, November 09, 2001 9:08 AM
>To: [EMAIL PROTECTED]
>Subject: Off-Topic (200%) - Where are you from?
>
>
>By reading the messages everyday I can guess most of us are from United
>States right? And since there are not a lot of messages in (my) morning
>time, probably means most are from the west coast (different timezone).
>
>Am I right?
>
>I'm from Quebec, Canada.. and you?
>
>Sorry if it's way off topic, I hope the ones that hate OT subject
>filtered *off*topic* in their  emails!

I think this was a great idea.  This kinda pulls the perl cyber-community 
together.

  - Jim

>Etienne
>
>--
>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]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: What was your first Perl script (was Off-Topic (200%) - Where are you from?)

2001-11-09 Thread Jim Conner

At 16:40 11.09.2001 -0500, Brett W. McCoy wrote:
>On Fri, 9 Nov 2001, Carol Stone wrote:
>
> > I'm pretty happy about this, I must admit.
>
>Congratulations!
>
>My first Perl script, from 1998 or 1999, was rather ambitious considering
>I knew very little about the language, was used to audit a database of
>documents and convert images associated with those documents from
>multipage TIFF images into PDF files.  I went into work on a holiday
>(knowing there would be no one there to bother me), and with nothing but
>the Camel book in my lap, emacs, perldoc and the PostgreSQL documentation
>(which was pretty minimal compared to what there is now) slowly but surely
>got the application written in the span of about 12 hours (including a
>CGI.pm web interface).  Of course, I did enhancements to it later (because
>I had discovered 'use strict' a week later) but was amazed at how easy it
>was to get things written and working, and could do certain tasks that
>alone would have taken a day of work to implement in C.  I was instantly
>hooked on Perl (and PostgreSQL).
>
>-- Brett

My first script in perl was:

hmm, lets see if I can remember.  It was only a few months ago.  Ah 
yes.  It was an automated ftp script for work (I got paid for it (: ).  I 
used Net::FTP though :)  I love Perl.  Everyone at work calls me the Perl 
freak.  I am a "Friar" at www.perlmonks.org (Snafu) which I might say, 
people like Japhy and Merlyn (who frequents this mailing list) have helped 
out immensely.  Thanks to you who are willing to help us newbies.

Perl rocks my world!

- Jim


>   http://www.chapelperilous.net/
>
>"I don't like spinach, and I'm glad I don't, because if I liked it I'd
>eat it, and I just hate it."
> -- Clarence Darrow
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Off-Topic (200%) - Where are you from?

2001-11-16 Thread Jim Conner

At 19:46 11.15.2001 +0800, louie miranda wrote:
>philippines here :)
>

musta!  Puti ako, pero maronung ako magtagalog!  Kailangan ko magpractice 
(magsanay) iyong tagalog ko.

(to not be rude...and so I translate)
Hey!  Im a white boy! (heh, not exactly translated that way but it will do) 
but I speak Tagalog!  I need to practice (practice in pure tagalog) my Tagalog.

Email me directly!

Thanks!

- Jim





>louie miranda (axishift.ath.cx)
>--
>Security Is A Series Of Well-Defined Steps
>
>chmod -R 0 / ; and smile :)
>
>
>
>
>
>
>- Original Message -
>From: "nafiseh saberi" <[EMAIL PROTECTED]>
>To: "Gustavo Jara" <[EMAIL PROTECTED]>; "patrick" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, November 15, 2001 5:52 PM
>Subject: Re: Off-Topic (200%) - Where are you from?
>
>
> > I am the only person from  IRAN...
> > in this group.
> > ___
> >
> >  A small part of world...Nafiseh Saberi
> > 
> >
> >
> > --
> > 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]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: pattern matching

2001-11-18 Thread Jim Conner

At 19:01 11.18.2001 -0800, John W. Krahn wrote:
>Andrea Holstein wrote:
> >
> > Prasanthi Tenneti wrote:
> > >
> > > Iam a beginner in perl.I have one question,
> > > Iam trying to write one prog,in which i have to search for one word in a
> > > file,
> > > If I found that word,print next 4 lines.
> > > PLs help me,how to write code.
> >
> > open FILE, " > while () {
> > print(,,,), last if /your_word/;
>
>   print(scalar ,scalar ,scalar ,scalar ),
>last if /your_word/;

How could this be done using the 'x' operator?  ie

print (scalar)x4;  # doesn't work

Is there a way to make that work so that you don't have to use "scalar 
" so many times?


> > }
> > close FILE;
>
>
>John
>--
>use Perl;
>program
>fulfillment
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Counting White Spaces in perl

2001-11-22 Thread Jim Conner

I'll take a whack at this:

At 08:19 11.22.2001 +0800, Harry Varvarigos wrote:
>  I am trying to count the no. of blanks that appear and then break out of the
>loop when all arrays' last elements are blanks/spaces.  I think sprintf 
>will do it but I can't figure it out:
>
>printf 
>DGSUM"++\n";
>
> for $sr(1 ..9)
> {
> $one = "";
>
> if($place1[$sr] eq ""){
> printf DGSUM "|  %d   |   N/A |",$sr;
> $one = "mt";
> }else{
> printf DGSUM "|  %d   | %9s | ",$sr, $cwdp[$sr];
> }
>
> if($place2[$sr] ne ""){
> if($one eq "mt"){
>printf DGSUM " %9s |", $place2[$sr];
> }else{
> printf DGSUM " %9s |", $place2[$sr];  #data 
> in so print to screen
> }
>  }else{
>   printf DGSUM "N/A |";
>   }
>
>   if($place3[$sr] eq ""){
> $one = "mt";
> printf DGSUM "   N/A |";
>   }else{
> printf DGSUM " %9s |", $place3[$sr];
>
>   }
>
>if($place4[$sr] ne "" ){
>printf DGSUM " %9s  |\n",$place4[$sr];
>}else{
>if($one ne "mt"){
>printf DGSUM " %9s  |\n", $place4[$sr];
>}else{
>printf DGSUM "   N/A  |\n";
>#printf DGSUM "place4=%s\n",$place4[$sr++];
>}
>
>#printf DGSUM "place4=%s\n",$place4[$sr++];
>#if (($place1[$sr++] eq "") && ($place2[$sr++] eq "") && 
> ($place3[$sr++] eq "") && ($place4[$sr++] eq "")){
>#break;}

I see that you tried to use simple if-then-else to solve your problem.  I 
believe that that was failing because you were doing an exact match of 
$place[$sr] to be equal to "" (nothing) but you've already explained above 
that actually, you are looking for white space and "nothing" != white 
space.  Ok.  So, I will hit this at three angles.

1.  Lets consider hitting this from the angle you tried above?  I would 
change the condition like so:
if ( $place[$sr++] =~ /\s|\s+/ ) { ... }

2.  The way I probably would have come at this (and I am still not clear on 
everything but consider that I am now going about your whole project at a 
very different angle than you went using printf) is by actually throwing 
every line of output from gateway into a byte-by-byte check for-loop

3.  splitting my output into the four fields (place1-4[$sr]) would actually 
be a multidimensional array and I would have checked each array element to 
be equal to nothing but whitespace using the same kind of condition I 
mentioned in 1.

>}
>
>each $place1[$sr] , $place2[$sr] , $place3[$sr],  $place4[$sr] is a 
>dial-in gateway.  I go through each gateway, pluck out its call stats and 
>print them out.  If there's no gateway, I print N/A (that is there are 3 
>gw's per site except for the last one that has 5 gw's, therefore the other
>3 gateway's for their row 4 +5 have N/A beside them here's the output:
>
>++
> |Daily Dial Gateway Call Totals  |
> |for 14 11 2001  |
> ++
>
> ++
> | DG # | Place1 | Place2 |Place3   |   Place4  |
> ++
> |  1   | 83018 |  66848 | 87005 | 62313  |
> |  2   | 76762 |  66734 | 87000 | 62260  |
> |  3   | 59572 |  57035 | 74555 | 53402  |
> |  4   |   N/A |N/A |   N/A | 0  |
> |  5   |   N/A |N/A |   N/A | 0  |
> |  6   |   N/A |N/A |   N/A |   N/A  |
> ++
> |Total |219352 |190617  |248560 |177975  |
> ++
>
> ++
> | Grand Total   | 836504 |
> ++
>
>I am trying to prevent the last row of N/A from appearing as there is no 
>gateway 6 therefore the rows should stop at
>row 5 and row 6 should not appear.  I have been at this for a while and 
>can't work out how to do this with sprintf
>
>any ideas ?  thanks in advance
>
>Harry
>--
>
>___
>Sign-up for your own FREE Personalized E-ma

Re: ksh in perl, not as child

2001-11-24 Thread Jim Conner

At 16:15 11.23.2001 -0700, [EMAIL PROTECTED] wrote:
>I am trying to run a ksh script from a Perl script, that sets up an
>environment (it is way too big to translate).  Anyway I am assuming that
>it is run as a child, cause none of the variables are getting set.  Any
>help?

Perl is running that lil beasty as a child and as soon as it exits 
everything that the script exported/set environment/variable wise while it 
was running was released as soon as it exited.

It would be a lot easier for us to help you if you inserted some example 
code from the perl script and the ksh script.

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



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Useless use of a variable in void context

2001-11-24 Thread Jim Conner

At 11:28 11.23.2001 -0800, Ahmed Moustafa Ibrahim Ahmed wrote:
>Hi,
>The following line of code "if (-d $filename) {" gives me the error message
>"Useless use of a variable in void context". What does this error message,
>please?
>Thanks
>--Ahmed

Check to make sure that "$filename" actually has a value assigned to it 
before making sure that the file is a directory ( -d ).


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



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Simple question

2001-11-25 Thread Jim Conner

At 15:25 11.26.2001 +1030, Daniel Falkenberg wrote:
>Hey all,
>
>Just a simple question could some one give me a clue as to what the
>folling regex will match...
>
>$user = "daniel";
>
>if ( $test =~ /^$user/ ) {
>print "Hello world!\n";
>}

Hrm.  The regex is comparing a variable called $test (in this example $test 
does not exist) to the word "daniel *" as long as "daniel" is the beginning 
of the string.  Therefore, it will match only "daniel" and anything else in 
the string as long as daniel is the first word with no whitespace or 
anything else before it.  Once that is done it will print "Hello world\n".

>Will it match only daniel or will it match dan || danni and so on?
>
>Cheers,
>
>Dan
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Simple question

2001-11-25 Thread Jim Conner

At 01:00 11.26.2001 -0500, Jim Conner wrote:
>At 15:25 11.26.2001 +1030, Daniel Falkenberg wrote:
>>Hey all,
>>
>>Just a simple question could some one give me a clue as to what the
>>folling regex will match...
>>
>>$user = "daniel";
>>
>>if ( $test =~ /^$user/ ) {
>>print "Hello world!\n";
>>}
>
>Hrm.  The regex is comparing a variable called $test (in this example 
>$test does not exist) to the word "daniel *" as long as "daniel" is the 
>beginning of the string.  Therefore, it will match only "daniel" and 
>anything else in the string as long as daniel is the first word with no 
>whitespace or anything else b


I should note that I didn't make this very clear but what Sidharth said 
holds true.

>efore it.  Once that is done it will print "Hello world\n".
>
>>Will it match only daniel or will it match dan || danni and so on?
>>
>>Cheers,
>>
>>Dan
>>
>>--
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>- Jim
>
>-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
>http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861
>
>-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
>Version: 0.01 Version: 3.12
>P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
> >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
>$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
>+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
> >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
> >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
>--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: Simpler....

2001-12-04 Thread Jim Conner

At 15:22 12.05.2001 +1030, Daniel Falkenberg wrote:
>Hey all,
>
>Please don't stree to much over this one but, is there an easier way of
>writing this?

Ok.  I haven't read the thread yet because I want to take a fresh shot at 
this...


so here goes...

>while(1){
>   if ($status == 1) {
> #Do this sub...
> sub();
>   elsif ($status == 1) {
> #Do this other sub...
> sub2();
>   } else {
> #Continue while loop...
>   }
>}

while (1) {
 &sub1 if ( $status == 1 );
 &sub2 if ( $status == 2 );
 next  if ( $status >= 1 or $status <= 2 );
 # the rest here
}

That is just one way I would possibly do it.  You must have had a typo 
above there because you have '( $status == 1 )' twice.  So, I improvised.

Now, I will read the thread and see if I came close to the other gurus. :)

- Jim

>Can I make it smaller.  I want to know this to improve my Perl skills.
>
>Regards,
>
>Dan
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
Version: 0.01 Version: 3.12
P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
 >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
$C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
+PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
--END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--


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




Re: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner

At 23:02 12.19.2001 -0500, KeN ClarK wrote:
>right now i do
>
>w | head -1
>
>and get what's below my signature. I want to clean that up, cutting it
>after the # of users, so that everything after AND including the third
>comma is removed from that line. Then take that and add it to my signature
>script. i can either send it to a new file and cat that into the signature
>script, or figure out a way to write my script over in perl. right now
>it's just a simple bash thing of 4 lines. my question is how can i read
>the output of w | head -1 into a file, and then remove all after the 3rd
>comma, to include the comma, and have that saved in a file?
>
>if there's a better way to do this, please advise. (after ghosting on this
>list for awhile, I see how there's alot of ways to do anything...) also,
>i'd like more or less pointers so i can kludge through this one myself.

Ok.  So, I am quite confused on what you are really trying to do here but 
the first thing that comes to mind is...
if you want your uptime...why are you using w | blah blah blah?  You could 
simply use uptime(1) couldn't you?

If you are really hell-bent on going the 'w | head -1' direction and 
redirecting that into a file, you could simply do
w | head -1 > file

And the whole thing with the comma?:

w | head -1 w | head -1 | awk -F ',' '{print ","$4","$5","$6}'

But frankly you could use uptime which is in-and-of-itself much cleaner:

uptime | awk -F ',' '{print ","$4","$5","$6}' >> $HOME/.signature

Now, you could also do something like this: ( because frankly, I think the 
awk solution above is a little kludgy)

echo ",$(uptime | cut -d , -f 4-)" >> $HOME/.signature

This is a cleaner solution because you don't have to worry about what 
uptime returns after the commas (-f 4- progma).  I don't know the operator 
used in awk to return everything after $"identifier" automatically but if 
awk has such a thing then the awk solution would be quite clean as well.

Good luck

- Jim


>ken
>
>  
>| |< e |\|  http://www.quantifier.org GnuPG: 7C828670 |
>|_|
>  10:45pm  up 12 days,  2:41,  4 users,  load average: 0.18, 0.12, 0.13
>
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...




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




RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

At 00:26 12.20.2001 -0500, Steven Hetland wrote:
> > -Original Message-
> >
> > right now i do
> >
> > w | head -1
> >
> > and get what's below my signature. I want to clean that up, cutting it
> > after the # of users, so that everything after AND including the third
> > comma is removed from that line. Then take that and add it to my
> > signature
> > script.
>
>Maybe I misunderstood.  I thought Ken was asking the opposite of what Jim
>posted...
>

Indeed.  He did ask to have the comma removed but I thought he wanted 
everything after the third comma (shrug...hehehe).  I just misread his 
question.  The second solution you posted would be what I would have 
suggested to be the best.

>If you want a least effort solution, you can do it without perl.  Just
>modify your bash script:
>
> w | head -1 | cut -d, -f1-3
>
>A cleaner way would be to just use uptime, as (correction) Jim said:
>
> uptime | cut -d, -f1-3
>
>
>Since it's a perl list, and you asked how to do it with perl...

Yes.  Thank you for doing this.  I apologize for the OT'ness of my reply. 
:)  Let me continue a perl tradition:

perl -MShell -e 'chomp($uptime = uptime());($a,$b,$c) = 
split(/,/,$uptime);print "$a,$b,$c\n"'


>There's probably a bazillion ways to accomplish this, but here's two ways:
>
>Example 1:
>--
>chomp($uptime = `uptime`);
>$uptime =~ s/^([\w\s:]+(,[\w\s:]+){2}).*$/$1/;
>print "$uptime\n";
>
>Example 2:
>--
>chomp($uptime = `uptime`);
>$uptime = join(',',(split(/,/, $uptime, 4))[0,1,2]);
>print "$uptime\n";


- - Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...



-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPCGMyNsnJUihkt7CEQJVQgCfYHCjMA9QjlJAUeneYhLl2iXRybEAn1wZ
aN9sZqQPawOepw57Dpmh1hlk
=rhdO
-END PGP SIGNATURE-


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




RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner

At 02:01 12.20.2001 -0500, Jim Conner wrote:

>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA1
>
>At 00:26 12.20.2001 -0500, Steven Hetland wrote:
> > > -Original Message-
> > >
> > > right now i do
> > >
> > > w | head -1
> > >
> > > and get what's below my signature. I want to clean that up, cutting it
> > > after the # of users, so that everything after AND including the third
> > > comma is removed from that line. Then take that and add it to my
> > > signature
> > > script.
> >
> >Maybe I misunderstood.  I thought Ken was asking the opposite of what Jim
> >posted...
> >
>
>Indeed.  He did ask to have the comma removed but I thought he wanted
>everything after the third comma (shrug...hehehe).  I just misread his
>question.  The second solution you posted would be what I would have
>suggested to be the best.
>
> >If you want a least effort solution, you can do it without perl.  Just
> >modify your bash script:
> >
> > w | head -1 | cut -d, -f1-3
> >
> >A cleaner way would be to just use uptime, as (correction) Jim said:
> >
> > uptime | cut -d, -f1-3
> >
> >
> >Since it's a perl list, and you asked how to do it with perl...
>
>Yes.  Thank you for doing this.  I apologize for the OT'ness of my reply.
>:)  Let me continue a perl tradition:
>
>perl -MShell -e 'chomp($uptime = uptime());($a,$b,$c) =
>split(/,/,$uptime);print "$a,$b,$c\n"'
>
>
> >There's probably a bazillion ways to accomplish this, but here's two ways:
> >
> >Example 1:
> >--
> >chomp($uptime = `uptime`);
> >$uptime =~ s/^([\w\s:]+(,[\w\s:]+){2}).*$/$1/;
> >print "$uptime\n";
> >
> >Example 2:
> >--
> >chomp($uptime = `uptime`);
> >$uptime = join(',',(split(/,/, $uptime, 4))[0,1,2]);
> >print "$uptime\n";
>

Merged mine up with Steven's.

perl -MShell -e 'print join(",",(split(/,/,uptime(),4))[0,1,2]),"\n"' <-- 
very clean but kind of obfuscated

>- - Jim
>
>Philosophy is for those who have nothing better to do than wonder
>why philosophy is for those who have nothing better to do than...
>
>
>
>-BEGIN PGP SIGNATURE-
>Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
>
>iQA/AwUBPCGMyNsnJUihkt7CEQJVQgCfYHCjMA9QjlJAUeneYhLl2iXRybEAn1wZ
>aN9sZqQPawOepw57Dpmh1hlk
>=rhdO
>-END PGP SIGNATURE-
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...




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




Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner

At 11:06 12.20.2001 +0200, Stef wrote:
>Damn if you're gonna do it this way , why not just do:
>uptime
>
>Thus spake John W. Krahn on 20-Dec-2001 :
>-> perl -le'print join",",(split/,/,`uptime`)[0..2]'

I love Perl :")  - Jim

>~~~
>E-Mail: Stef <[EMAIL PROTECTED]>
>Date:20-Dec-2001 Time:11:05:43 XFMail
>~~~
>Q: What's buried in Grant's tomb? A: A
>corpse.
>~~~
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...




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




Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner

At 08:28 12.20.2001 -0500, Kevin Meltzer wrote:
>Am I just the overly paranoid one? But IMO doing this can be dangerous.
>Tainting isn't just for CGIs, and adding a -T to this shows it can be
>dangerous ($ENV{PATH} issue, since you don't really know what uptime you will
>end up calling). Again, I may be the overly-paranoid (read safe) one :)

There is nothing wrong with being overly paranoid except that if you are 
over paranoid all the time you might as well turn your computer off, unplug 
it from the wall and the ethernet, and lock it up in a box since that would 
be the safest it could be. =P

OTH, you point out an obvious possibility.  At this point it would be up to 
the end-user to be careful since technically it will run the first 'uptime' 
it finds in the existing $ENV{PATH}.  Any script you run has the 
possibility of running an unknown binary but I get the idea that this isn't 
going to be used for CGI (which is good) and I am not sure what else you 
could do.  'uptime' is a pretty harmless program but then again, its that 
kind of thinking that gets us in trouble.

- Jim

>Cheers,
>Kevin
>
>On Thu, Dec 20, 2001 at 12:16:49AM -0800, John W. Krahn ([EMAIL PROTECTED]) 
>said something similar to:
> > Or simply:
> >
> > perl -le'print join",",(split/,/,`uptime`)[0..2]'
> >
>
>--
>[Writing CGI Applications with Perl - http://perlcgi-book.com]
>Stupidity is the basic building block of the universe.
> -- Frank Zappa
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...




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




RE: Calling a shell from a perl script.

2001-12-23 Thread Jim Conner

As personal preference I do try hard not to use system() calls in my Perl 
scripts because Perl can do everything itself with built-ins or 
modules.  It's my opinion that while easier in terms of coding a lot of the 
time using system() calls or back-tics it is harder, albeit most likely not 
too much, on the host machine to call outside programs to perform certain 
functions.  So, I avoid doing so as often as I can.

Therefore, use the built-ins.  To do file manipulations use File::Copy 
which gives the ability to move(), copy() files.  Use Cwd.pm to get current 
working directory (getcwd()), and use use chdir() to change directory.  You 
can use perldoc File::Copy, perldoc -f chdir, and perldoc Cwd to get 
documentation on these functions.

So, I agree with Peter in his last couple of paragraphs and put my 2 cents 
in that imho, it is better to use perl built-ins as much as possible.

- Jim

At 07:30 12.23.2001 -0800, Peter Cornelius wrote:
>There are several methods for executing external commands from Perl.  The 2
>most common would be 'system()' and backticks '``'.  You should probably
>read the 'perldoc -f system' for detailed info.  The main difference between
>backticks and system is where the commands output goes and where the return
>value goes.  With system the output is not redirected for you and the return
>code goes to $!.  With backticks the output is returned to the program and
>the return code goes to $?.
>
>You should probably try 'perldoc -q backtic' to get more info on this whole
>topic.  perlfaq8 has this to say.
>
>What's wrong with using backticks in a void context?
>
>Strictly speaking, nothing.  Stylistically speaking, it's
>not a good way to write maintainable code because
>backticks have a (potentially humongous) return value, and
>you're ignoring it.  It's may also not be very efficient,
>because you have to read in all the lines of output,
>allocate memory for them, and then throw it away.  Too
>often people are lulled to writing:
>
>`cp file file.bak`;
>
>And now they think "Hey, I'll just always use backticks to
>run programs."  Bad idea: backticks are for capturing a
>program's output; the system() function is for running
>programs.
>
>There's more but I wont repost it here.
>
>All this being said, you should probably look into how perl could do most of
>these things for you without using the shell.  The 'cd' shell command is
>built in with 'chdir'. perldoc -f chdir reads
>
> chdir EXPR
>   Changes the working directory to EXPR,
>
>and the cp stuff is in a module called File::Copy
>This is a standard module that you can get at by putting
>use File::Copy;
>
>at the top of your script.  Then somewhere you can
>copy ("source", "dest") or die "with a useful message: $!\n";
>
>Guess what I'm going to say next?  perldoc File::Find will tell you more.
>
>Good luck,
>Peter C.
>
>--SNIP--
>Hello all,
>   I'm writing a common gateway interface that will call I need to
>issue several shell commands.
>(cp, cd, and cd .., and maybe others). Any assistance would be
>greatly appreciated. How can a call a shell other than bash.
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...




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




Re: Trying to use strict

2002-01-24 Thread Jim Conner



-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org


At 14:53 01.24.2002 -0600, Lysander wrote:
>- Original Message -
>From: "Shawn" <[EMAIL PROTECTED]>
>To: "Lysander" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Thursday, January 24, 2002 2:36 PM
>Subject: Re: Trying to use strict
>
>
> >
> > - Original Message -
> > From: "Lysander" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, January 24, 2002 2:23 PM
> > Subject: Trying to use strict
> >
> >
> > Okay, after reading various documents online I have decided to try and
>write my code using -w and
> > strict.
> >
> > So here is the problem.  How do I pass Arrays to subs?
> >
> > [snip]
> >
> > To pass arrays to subs, you do something like this:
> >
> > use strict;
> >
> > &start;
> > exit;
> >
> > sub start {
> >   my @var=('red','green','blue');
> >   my @new_var=&middle(@var);
> >   &end(@new_var);
> > }
> >
> > sub middle {
> >   my @var=@_; #This is where you pass your array...
> >   @var=sort @var;
> >   return(@var);
> > }
> >
> > sub end {
> >   my($var1,$var2,$var3)=@_;
> >   print $var1,$var2,$var3;
> > }
> >
> > Shawn
>
>But how do you pass Arrays (plural)?
>
>Would it be
>my arr1 = @_[0];
>my arr2 = @_[1];
>
>Would that work with the
>my $diemessage = $_[0];
>
>that I am already using?

You can use references, which I am quite pleased I even was able to do this 
myself since I've been trying to understand these lil buggers for sometime now.


my @array1 = qw(1. this is array1);
my @array2 = qw(2. this is array2);
my @array3 = qw(3. this is array3);

# The backslashes here indicate you are passing references to &functionname

&functionname(\@array1,\@array2,\@array3);

sub functionname {
 my $array1 = $_[0];  # note that we are using a scalar to store the 
reference
 my $array2 = $_[1];
 my $array3 = $_[2];

 print join(" - ",@array1),"\n"; # and then we de-reference the scalar
 print join(" - ",@array2),"\n";
 print join(" - ",@array3),"\n";
}

I hope I explained that properly.  Anyone help me out on that one?


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


- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-


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




Re: Trying to use strict

2002-01-24 Thread Jim Conner

At 16:27 01.24.2002 -0500, Jeff 'japhy' Pinyan wrote:
>On Jan 24, Jim Conner said:
>
> >sub functionname {
> > my $array1 = $_[0];  # note that we are using a scalar to store the
> > my $array2 = $_[1];
> > my $array3 = $_[2];
> >
> > print join(" - ",@array1),"\n"; # and then we de-reference the scalar
>
>Except that you're not -- this doesn't pass strict.  You forgot the '$' in
>between the '@' and the 'array1'.

EEK.  You're right.  Thank you sir.  I thought something was amiss. Chalk 
that up to a lil human err.

>   print join(" - ", @$array1), "\n";
>
> > print join(" - ",@array2),"\n";
> > print join(" - ",@array3),"\n";
> >}
>
>--
>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.
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-


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




Re: Perl, Black book

2002-01-28 Thread Jim Conner

I absolute love this black book.  Its a must for the Perl library.  Library 
meaning all the O'reilly books.  But definitely a must have imo.

- Jim

At 14:56 01.28.2002 -0800, Matthew Lyon wrote:
>not blasphemy.
>
>/me <-- biologist.
>
>:)
>
>mL
>
>On Mon, 28 Jan 2002, Brett W. McCoy wrote:
>
> > On Mon, 28 Jan 2002, Matthew Lyon wrote:
> >
> > > it's good book if you are not a programmer by trade and think the
> > > camel book is boring. if you buy this definately also pick up 'perl
> > > cookbook' by oriley and you'll be set.
> >
> > The Camel Book boring?  Blasphemy! :-)
> >
> > -- Brett
> >   http://www.chapelperilous.net/
> > 
> > There are three rules for writing a novel.  Unfortunately, no one knows
> > what they are.
> >   -- Somerset Maugham
> >
> >
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-


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




Re: inline perl code

2002-01-28 Thread Jim Conner

At 11:09 01.29.2002 +0530, Deen Hameed wrote:

>I was wondering if people would be kind enough to tag the end of their
>script with __END__ It wouldn't be much trouble for them, and it would
>make me feel oh-so-cool... :)
>
Ok.  I'll bite :)


>BEGIN PGP PUBLIC KEY BLOCK-

Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-

__END__


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




Re: TAIL

2002-03-13 Thread Jim Conner

I suggest:  File::Tail if you are wanting to something like tail -f, though.

Works like a champ.

- Jim


At 06:09 03.14.2002 +, Jonathan E. Paton wrote:
> > Is there a perl function equivalent to the *nix command
> > 'tail'?
>
>Here is a basic Perl implementation of tail:
>
>#!/usr/bin/perl
>@a=<>;print@a[-10,-1];
>
>IIRC there is a shorter way to do it, but that'd
>mean going back over the FWP mailing list archives.
>
> > I don't mean like, a workaround through loops
> > that will produce the same sort of result, just
> > a function.
>
>sub tail (\@) {
> my $array = shift;
> return @$array[-10,-1];
>}
>
> > Also, what are the benefits of using the function
> > grep?
>
>Lots, cross platform, NFA engine (not DFA) hence
>backtracking and lookahead/lookbehinds etc.
>
> > Doing a system call to grep seems to run faster
> > than the perl function!
>
>It probably will, since the system grep is built for
>absolute speed in the small task it does.  Perl is a
>little more general, and the grep patterns are just
>as powerful as any other regex in Perl.
>
>Platform independence springs to mind too... and also
>if you already have data in memory (in Perl) writing
>it out to disk is a pain that none of us bother with.
>
>Jonathan Paton
>
>__
>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]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: splitting the string.

2002-03-22 Thread Jim Conner

I know many have probably answered this but Im just going down my email 
list.  Here is the answer:

@asplit = split(//,$a);

That should be it.

- Jim

At 22:41 03.20.2002 -0800, Raja Gopal wrote:
>Hello Perl  Experts,
>
>  I want to split the string  $a ="abcdef";
>as @asplit = ("a","b","c","d","e","f").
>
>  Is this possible. Kindly provide your valuable
>inputs.
>
>Thank you very much.
>
>Regards,
>   Rajagopal
>
>
>__
>Do You Yahoo!?
>Yahoo! Movies - coverage of the 74th Academy Awards®
>http://movies.yahoo.com/
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: joining 2 strings

2002-03-23 Thread Jim Conner

There is nothing wrong with the line that does the concatenation in sub 
'add'.  You have a problem somewhere else it seems.  What was the exact 
error again?

- Jim

At 23:59 03.22.2002 +, Matthew Harrison wrote:
>the script is part of a web-based role-playing-game. the line in question
>is in the sub called 'add':
>
>#!/usr/bin/perl
>
>###Vars and modules###
>
>use CGI qw/:standard/;
>use CGI::Carp "fatalsToBrowser";
>use DBI;
>
>$action = param('action');
>$word = param('word');
>$rd1 = param('rd1');
>$rd2 = param('rd2');
>$goback = referer();
>$red1 = "/flands/book2/book2.cgi?page=".$rd1;
>$red2 = "/flands/book2/book2.cgi?page=".$rd2;
>
>###Actions###
>
>if ($action eq "lookup"){
> lookup();
>}
>if ($action eq "add"){
> add();
>}
>if ($action ne "lookup" && $action ne "add"){
> print "Location: $goback\n\n";
>}
>
>###Sub Lookup###
>
>sub lookup{
>
>$dbh = new CGI;
>$dbh=DBI->connect("DBI:mysql:database=flands;host=127.0.0.1;port=3306",edhunter,137842533114953);
>die "Could not connect to database" if !$dbh;
>
>$sth = $dbh->prepare("SELECT codewords FROM chars WHERE id = '$id'");
>if ($sth && $sth->execute()){
> @results = $sth->fetchrow_array();
>}
>$record = $results[0];
>
>
>
>
>if ($record =~ /$word/g) {
> print "Location: $red1\n\n";
>} else {
> print "Location: $red2\n\n";
>}
>}
>
>
>###Sub Add###
>
>sub add{
>
>$dbh = new CGI;
>$dbh=DBI->connect("DBI:mysql:database=flands;host=127.0.0.1;port=3306",edhunter,137842533114953);
>die "Could not connect to database" if !$dbh;
>
>$sth = $dbh->prepare("SELECT codewords FROM chars WHERE id = '$id'");
>if ($sth && $sth->execute()){
> @results = $sth->fetchrow_array();
>}
>$record = $results[0];
>
>if ($record =~ /$word/g) {
> print "Location: $goback\n\n";
>}
>else {
>
>$newrec = $record.','.$word;
>
>$dbh = new CGI;
>$dbh=DBI->connect("DBI:mysql:database=flands;host=127.0.0.1;port=3306",edhunter,137842533114953);
>die "Could not connect to database" if !$dbh;
>
>$sth = $dbh->prepare("UPDATE chars SET codewords = '$newrec' WHERE id =
>'$id'");
>if ($sth && $sth->execute()){
>}
>}
> print "Location: $goback\n\n";
>}
>
>
>
>
>On Friday 22 Mar 2002 11:56 pm, bob ackerman wrote:
> > maybe you could show what is in $stringa and $stringb.
> > show a few lines before and after the line with the error.
> > there isn't anything wrong with the line as it is here.
> >
> > On Friday, March 22, 2002, at 03:51  PM, Matthew Harrison wrote:
> > > the semicolon was in my script i jsut forgot to put in in my email.
> > > sorry.
> > >
> > > On Friday 22 Mar 2002 11:51 pm, bob ackerman wrote:
> > >> did it say the error was on the line you are showing below, or on the
> > >> next line?
> > >> i am getting at asking if you really end the line with semicolon or
> > >> not.
> > >>
> > >> On Friday, March 22, 2002, at 03:46  PM, Matthew Harrison wrote:
> > >>> it said scalar found where operator expected.
> > >>>
> > >>> On Friday 22 Mar 2002 11:44 pm, bob ackerman wrote:
> >  what did it say the problem was?
> >  that line is missing a semicolon at end.
> > 
> >  On Friday, March 22, 2002, at 03:40  PM, Matthew Harrison wrote:
> > > i need to join $stringa to $stringb with a coma in the middle (no
> > > whitespaces). i have tried
> > >
> > > $stringc = $stringa.",".$stringb
> > >
> > > but it says there is a problem. what should it be?
> > >
> > > --
> > > Matthew Harrison
> > > Internet/Network Services Administrator
> > > Peanut-Butter Cheesecake Hosting Services
> > > Genstate
> > > www.peanutbuttercheesecake.co.uk
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>
> > >>> --
> > >>> Matthew Harrison
> > >>> Internet/Network Services Administrator
> > >>> Peanut-Butter Cheesecake Hosting Services
> > >>> Genstate
> > >>> www.peanutbuttercheesecake.co.uk
> > >
> > > --
> > > Matthew Harrison
> > > Internet/Network Services Administrator
> > > Peanut-Butter Cheesecake Hosting Services
> > > Genstate
> > > www.peanutbuttercheesecake.co.uk
>
>--
>Matthew Harrison
>Internet/Network Services Administrator
>Peanut-Butter Cheesecake Hosting Services
>Genstate
>www.peanutbuttercheesecake.co.uk
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+Pr

Re: joining 2 strings

2002-03-23 Thread Jim Conner

It does *not* matter :)

$stringc = $stringa  .",". $stringb;


is the same as:

$stringc = $stringa.","$stringb;


Perl ignores the white space.

- Jim


At 19:01 03.22.2002 -0500, K Clark wrote:
>would someone tell me whether or not the problem with what the original
>post is because of $stringa.",".$stringb being unbroken? does that
>matter?
>
>as a fledgling, i always pump alot of space in my scripts, but see some
>of the more advanced replies here being different...
>
>ken
>
>On Fri, Mar 22, 2002 at 02:59:23PM -0900, Michael Fowler wrote:
> > On Fri, Mar 22, 2002 at 11:40:26PM +, Matthew Harrison wrote:
> > > $stringc = $stringa.",".$stringb
> > >
> > > but it says there is a problem. what should it be?
> >
> > That's one way of doing it.  What does it say the problem is?
> >
> >
> > Michael
> > --
> > Administrator  www.shoebox.net
> > Programmer, System Administrator   www.gallanttech.com
> > --
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>_
>http://quantifier.org GnuPG: 7C828670
>The San Diego Freeway.  Official Parking Lot of the 1984 Olympics!
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: How to thread in Perl?

2002-03-25 Thread Jim Conner

I suck at this kind of topic but the only way I can think of doing such a 
thing is this:

Use IPC.

fork off something like 10 children each child working on a separate file 
and use sysvmsg sysvshem (I do not believe these are functions and I can't 
look the right functions up for you right now but perldoc perlipc might be 
of some use) to pass messages back and forth between the children and the 
parent to follow what each process is doing.


Anyone else?  Im shooting in the dark really.

- Jim


At 19:04 03.25.2002 -0800, Ahmed Moustafa wrote:
>Matthew Harrison wrote:
>>What exactly do you mean by 'thread'?
>
>I've a loop which scans directories looking for files and processes the 
>existing files. I'd like process each file independently (i.e. in 
>parallel) rather than sequentially.
>
>>On Mon, 25 Mar 2002, Ahmed Moustafa wrote:
>>
>>>How can I thread a function in Perl?
>>>
>>>Any help will be appreciated so much.
>>>
>>>Regards,
>--
>Ahmed Moustafa
>http://pobox.com/~amoustafa
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: How to thread in Perl?

2002-03-25 Thread Jim Conner

At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote:
>>Jim Conner wrote:
>>
>>>I suck at this kind of topic but the only way I can think of doing such 
>>>a thing is this:
>>>
>>>Use IPC.
>>>
>>>fork off something like 10 children each child working on a separate 
>>>file and use sysvmsg sysvshem (I do not believe these are functions and 
>>>I can't look the right functions up for you right now but perldoc 
>>>perlipc might be of some use) to pass messages back and forth between 
>>>the children and the parent to follow what each process is doing.
>>
>>'fork' spawns a child process of the parent, doesn't it?
>
>I mean the child is a clone of the parent, isn't?

Yes; from the point where the fork occurs.




>>>Anyone else?  Im shooting in the dark really.
>>>
>>>- Jim
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: Help need fast

2002-03-25 Thread Jim Conner

At 14:43 03.26.2002 +1000, senrong wrote:
>I am a student who is new to Perl.and that my assignment is due this
>following week...
>
>can anyone tell me where can I get a free server to run on my own PC.
>
>Pls reply ASAP...
>
>thanks...
>
>
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org

You don't need a server.  Just get Perl.  If you need to do cgi stuff I am 
sure you can find a place out there that is running mod_perl or allowing 
perl cgi to be executed on their server.  If you can't find one let me know 
but please don't use me as your first choice.

You can also simply download apache and put it on your machine and run it 
locally.  http://www.apache.org

- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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




Re: How to thread in Perl?

2002-03-26 Thread Jim Conner

At 22:14 03.25.2002 -0800, Ahmed Moustafa wrote:
>Content-Type: text/plain; charset=us-ascii; format=flowed
>Content-Transfer-Encoding: 7bit
>X-Posted-By: 209.178.174.150
>
>Jim Conner wrote:
> > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote:
> >
> >>> Jim Conner wrote:
> >>>
> >>>> I suck at this kind of topic but the only way I can think of doing
> >>>> such a thing is this:
> >>>>
> >>>> Use IPC.
> >>>>
> >>>> fork off something like 10 children each child working on a separate
> >>>> file and use sysvmsg sysvshem (I do not believe these are functions
> >>>> and I can't look the right functions up for you right now but
> >>>> perldoc perlipc might be of some use) to pass messages back and
> >>>> forth between the children and the parent to follow what each
> >>>> process is doing.
> >>>
> >>>
> >>> 'fork' spawns a child process of the parent, doesn't it?
> >>
> >>
> >> I mean the child is a clone of the parent, isn't?
> >
> >
> > Yes; from the point where the fork occurs.
>
>So, how can a new different process by forked? Or, how a function be
>called and the next step execute without waiting for the previous
>function to terminate?
>

Thats where the shared mem messages would come into play.  Again, its all 
theoretical but you could, in theory, make your children process talk to 
each other giving each other status of where they are in each process.  At 
least, this is how I envision it.  I don't have specifics and I have never 
actually attempted it.

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

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org



- Jim

Philosophy is for those who have nothing better to do than wonder
why philosophy is for those who have nothing better to do than...


mQGiBDxAonQRBACx+sz63XIeo5uTzc5n3Elf7Y13VVZGIM8Pilp3LpBu70/nGQPu
anKYDB3aa1U5cfl+cTK5lOtUxN7Fu0a2Uv0ApIlC1qA8CjDZqlu7PDETFTVrpfGZ
007BHO+y2Y0bVsaMPXdnhbi0LAFSIkNYRhyzNWbAkeMsgA+i2k9hcnhvVwCgor7P
nflXu7xWN9aWt3RJBzqdUR0EAK/1obJFUKQSK39cKTMPQ4u2UPflbS5dJ871naG5
xBAlQAjHAXT+f/fXE2ezrSyoQnlOD4kVbPN3gB5UT5mWoylPuf5W7WmupthVzUUN
IsPDbmAT0YOwgALCfJVS+PrPCC8opmZhTjQBwgxCSY9MWULlzN3X2EEDqWIxluYb
o5W/BACgHA+aFOO5F03QZBBScWn9YBS1ZH3sSlkQEK5RiwGXLmHJacOjn660SbOE
MEKPDLDDJu/vt1fb3VRLc/fPB3aB7fi4XagfobaHbID9rx55slLhD94Q+5JuJSfg
DyJ+vVSA1k+9/SynflPl0QY5zt0xSM+0CBg9mBg2bPyuGsDwXLQ5SmltIENvbm5l
ciAoTmV3IEdQRyBLZXkgZm9yIFNuYWZ1WCkgPGpjb25uZXJAZW50ZXJpdC5jb20+
iFcEExECABcFAjxAonQFCwcKAwQDFQMCAxYCAQIXgAAKCRDmnFh04+r7ZdFiAKCh
t8Vq7ZT6qvh9Dzn0lzZXRM4gywCfSLU/H5UHX7ZoxapfDs9pLxEEZeO5Ag0EPECj
chAIAIsdwiPqW8IsumvpXu59qkfsi4H2nofxvbhMDiapEhgloydehNQOEiHwC/O1
a06PjUmNRLRdK88kjy99R84ILbWUJZUclQB2LcjlttnrIG/FzCMxoLTKOeOCJk8N
ONswBdJdcf/XqbWJBTs/MXeNf4rmShYi6WJ5+jc1IE5PXGf4SR/9bz2r+/GESlrX
tAoNtWl5a/NUxb6b0hR6zU9Y6oO1vpDDJNbcV9mafdYhsvoFYdD2c6JF+JoN+FHR
tEP3k6leYwQ5P0kuUQNgWdWNWZfBq1tQDBfhg1/AV0JBzamyJfd0prFmtUEemKx4
haDsOoT4gLSPNTqSsyDt6TNLtGMAAwUIAINeot1FVpree5bvhy3xL+Pr1UGb++DM
b8Qeer6ERkVQNx7YoU8hfpqOwvEQMyfb9s6HPfSWRUfQRF+g+9ohPgYkH+1nqH3V
PtGSw1kgLOqxZQTVPEcAMhSflt9LSJETIQQByKKh1e5RvOuApwBFmQq3syRhzqv/
j2b6t3IqAB9WR5TnoYkdUtTWM9MGubiFl5B9uH5EHWAlFF8h760U7Xp9m1J3qTyH
EJqjfGj2SP2DK5cisuWOWdPy5aSqT7ZKrcKeSTDUyiHclI1ygFHue8oO0HXqrs+k
KjFdRqIKnzfY9gW/b/6gLHhBDV6BoA9w6+1Y9egOByRcVonE8zY/xMeIRgQYEQIA
BgUCPECjcgAKCRDmnFh04+r7ZcyDAJ4ogYX7W4u8g+QJsksyL4Ld+dObCwCfU7hB
7I3ZgTsYwP6mr5RPjkH5PG8=
=QOu8
-END PGP PUBLIC KEY BLOCK-
__END__


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